OS-161 is an instructional OS created by Harvard University as a standalone kernel and a simple userland, all written in C.
The source code contains implementations to the following things (added by me):
- Implementation of Locks, Condition Variables and Reader-Writer Locks
- Implementation of file system calls - open, close, read, write, getpid, dup2
- Implementation of Process System calls - fork, execv, sbrk
- Implementation of a fully functional virtual memory subsystem - uses paging and swapping to manage memory
To understand the code better, I have put together a guide of where the important files are present in the source and their contents.
This will enable others to read my code and understand the internal workings of the OS if they want to.
a. kern/syscall/execv.c - Execv() system call implementation
b. kern/syscall/fileOperations.c - implementation of open(), close(), read(), write(), dup2(), chdir(), getcwd(), lseek()
c. kern/syscall/fork.c - fork() system call implementation
d. kern/syscall/waitpidexit.c - waitpid() and exit() system calls implementation
e. kern/vm/pageTable.c - implementation of a linked list based page table structure for the new virtual memory subsystem
f. kern/vm/swapOperations.c - implementations of swapin, swapout such that pages are moved between the disk and memory
g. kern/arch/mips/vm/vm.c - VM implemntation ; algorithm to allocate and free pages (as well kernel pages ) and the coremap functionality has been added.