Nachos
Nachos is an instructional operating system developed by the University of California, Berkeley. It is a working skeleton OS coded in C++ using a MIPS simulator to implement user programs. Nachos lacks many of the features of a traditional OS and therefor is very useful as a learning tool in an operating systems course.
Because many universities use Nachos in their operating systems courses, I will not post any of the code I wrote for my assignments, but I will describe what I implemented to give a general overview of my knowledge and experience.
Assignment 1 - Implement semaphores and condition variables, and then solve several synchronization problems using these implementations.
Assignment 2 - Implement several system calls related to file handling. These calls are Open, Read, Write, Close and Create. I designed and implemented a "file table" object that was used by each of these system calls.
Assignment 3 - Implement a few more system calls to enable multiprogramming in the OS. These included Exec, Join and Exit. This was a very tricky assignment and involved altering the address space of processes and maintaining a data structure to keep track of which threads spawned one another. I dealt with synchronization issues in this project to ensure that Exit and Join worked properly with one another.
Assignment 4 - Implement virtual memory and demand loading. This will only page in information upon page faults. For this assignment, I was guaranteed that I would never run out of memory.
Assignment 5 - Implement page replacement. This involved page outs and maintaining swap files for our programs. I implemented multiple replacement strategies including sequential and aging. I also implemented scripts that would run a user program, writing all memory accesses to disk, and then parse these accesses to tell me the optimum number of page replacements. This gave me a way to research how well my replacement strategies worked compared to the optimal number of replacements.
Assignment 6 - Implement a file system for Nachos. This included implementing single indirect blocks in file headers to allow file size to be up to 15K. I also implemented a memory cache for file blocks using a write-through policy that improved the performance of my file system.