# PandOS **[Shahir Ahmed](https://github.com/Shahir-47) and [Boosung Kim](https://github.com/BoosungKim)** Operating Systems Project – PandOS Kernel for uMPS3 ## Overview PandOS is a custom operating system developed for the **uMPS3** emulator, a 3000 RISC architecture simulator. This project implements key OS functionalities such as: - **Time-sharing & Multiprogramming** – Running multiple processes concurrently. - **Process Scheduling** – Using the **round-robin** algorithm for CPU time allocation. - **Device Interrupt Handling** – Managing hardware interaction through interrupts. - **System Call Management** – Supporting I/O, process creation, and termination. - **Trap Handling** – Managing runtime errors to maintain system stability. - **Deadlock Detection** – Preventing system-wide resource locks. - **Virtual Memory with Paging** – Enabling efficient memory management via **TLB paging**. For a more detailed explanation of the project, see the [Technical Report](./PandOS-Implementation-Report.pdf). ## Implementation Phases ### **Phase 1: Queue Management** - Implemented **Process Control Blocks (PCB)** and **Active Semaphore Lists (ASL)**. - Designed **linked list structures** for process scheduling and synchronization. ### **Phase 2: Kernel Development** - Added **round-robin scheduler**, **interrupt handlers**, and **system calls** for I/O and process management. - Integrated **passeren (P) / verhogen (V) operations** for mutual exclusion. ### **Phase 3: Support Level** - Implemented **paging and virtual memory** with **TLB address translation**. - Enabled **eight concurrent user processes** with swap pool management. ## Setup & Compilation ### **1. Compile the PandOS Kernel** Navigate to the `pandos/phase3` directory and run: ```sh make ``` To clean up previous builds: ```sh make clean ``` ### **2. Set Up uMPS3 Emulator** 1. Launch uMPS3: ```sh umps3 ``` 2. Create a new machine configuration: - **Set directory** to `pandos/phase3` - Adjust general settings: - **TLB Size**: 32 - **TLB Floor**: `0x80000000` - **RAM Size (Frames)**: 128 3. Configure Flash Drives: - Assign each flash drive to a corresponding user process (see [Technical Report](./PandOS-Implementation-Report.pdf) for details). 4. Enable all 8 terminals under the **"Terminals"** tab. ### **3. Run PandOS** 1. Power on the emulator. 2. Open **Windows > Terminal 0-7** to observe output from all eight user processes. 3. Click the **Run (▶) button**. ## Testing To test **swapStress.c**: 1. Modify `Makefile` in `pandos/phase3/resources/testers`: - Replace `terminalTest5.umps` with `swapStress.umps` 2. Recompile and run: ```sh make umps3 ``` ## Reflection This project deepened our understanding of **process synchronization**, **virtual memory**, and **low-level OS design**. Implementing **paging with TLB** and handling **device interrupts** provided valuable experience in kernel development. ## **Technical Report** For a full breakdown of implementation details, see [PandOS-Implementation-Report.pdf](./PandOS-Implementation-Report.pdf). ## **Authors** [Shahir Ahmed](https://github.com/Shahir-47) & [Boosung Kim](https://github.com/BoosungKim)