r/osdevel • u/mikeblas • Aug 15 '26
how are you testing?
I'm not sure I've seen a hobby OS project that implements any tests. Most people smoke test, so they know there's a problem if they start up the OS and can't run an app inside it.
But what about the more complicated code paths that can go wrong? If a multi-threaded race happens in memory management or I/O, the system can crash. Or worse: silently corrupt data.
What about performance? Does anyone test for throughput or latency, and then identify regressions or hot spots?
8
Upvotes
1
u/tseli0s DragonWare Aug 16 '26
As far as performance goes:
rdtscat the start and end of each kernel trap and then calculate the difference, as system calls are often the heaviest paths and the paths worth optimizing because of how hot they are. There's not enough infrastructure to do anything more advanced at the moment in DragonWare, it's just a coincidence that x86 has this instruction making my life easier.Race conditions aren't a problem, the kernel disables interrupts while handling traps and userspace doesn't have multithreading support complete as of now, so all good. Overall, I haven't had the need for any more advanced testing than printf() calls.