Implementing an OS Kernel
Creating operating system primitives for OS 161.
As part of an Operating Systems course, I worked with one other student to implement a number of basic primitives for an operating system kernel. The course used OS161, which is a toy operating system meant for educational purposes. The operating system is intentionally missing a number of the primitives that you would expect to see in a real operating system kernel, and you work through implementing the primitives to create a more complete operating system.
The implementation happend in a couple distinct stages. First we implemented sleep locks, condition variables, and reader-writer locks, which are important synchronization primitives needed for the implementation of processes and the file system. Then we implemented a number of system calls, which included basic filesystem calls (open, close, read, write) and process system calls (exec, fork, getpid, wait). For our coursework, this was the extent of the implementation, but we also created unit tests that were written to verify the correctness of our solutions.
This was a neat way of learning oprating systems, because at each stage it felt like you are unlocking a different piece of functionality in the operating systems, and new concepts and ideas open up with each step of the OS161 sequence.