PennOS
A User-level UNIX-like Operating System
PennOS is a UNIX-like operating system that consists of a priority scheduler, flat file system, and user-level shell interface. It runs as a guest OS within a single process. PennOS was written in C and compiled with clang on Linux.
I completed this project in a 4 person team for my Operating Systems course in Fall 2016 taught by Professor Boon Loo. For my primary roles, I coded the entire file system and a generic linked list implementation used throughout the project.
File System
The file system is mounted in a single file in a loopback like manner on the host OS. The file system provides user level functions including mounting, stdin/stdout access, file creation, reading, writing, seeking, deletion, and redirection. The file system is FAT based, is persistent through each instance of PennOS for a given file system, and can maintain up to 409 individual files or up to 511 KB of data.
Kernel/Scheduler
The priority based scheduler utilizes the ucontext library to create and switch threads, each with its own context. It provides user level and kernel level functionality to create, stop, terminate, and change the priority of threads. The scheduler also provides synchronous signal handling and process status information.
Shell
The shell is the user interface that grants the user access to the file system and scheduling functionality. It is capable of job control, file manipulation, redirection, synchronous child waiting, terminal signaling, and terminal control of stdin.
Integration and Testing
Since each major component was coded separately, focus on integration was critical. Our team handled this by employing rigorous testing methods before integration. In addition to tools such as gdb and valgrind, unit testing proved an invaluable tool for finding bugs.
In particular, I found extensive unit testing to be the fastest and most reliable way to ensure that all functionality continued to work as the code was updated or modified. Additionally for the file system, 2 programs I coded external to PennOS, which were capable of reading and writing to the filesystem, helped verify the functionality of the system calls without requiring PennOS to be operational.