Pintos
Implemented core OS components based on Stanfordβs Pintos project.
π€ Contributors
π Project 1 β Threads (Partial Implementation)
Manual: Pintos Project 1
This project involved modifying the thread scheduler and timer mechanisms in PintOS. We implemented the alarm clock and priority-based scheduling, but priority donation was not included as it was optional.
π Related Code
-
threads/thread.c,threads/thread.hβ Alarm list logic, priority-aware scheduling (thread_set_priority(),thread_get_priority()) -
devices/timer.cβ Reimplementedtimer_sleep()using sleep queue -
lib/kernel/list.cβ Priority comparison for thread queue ordering
π Project 2 β User Programs (Full Implementation)
Manual: Pintos Project 2
This project consisted of two parts:
- 2-1: Argument passing, system call framework, and basic file I/O
- 2-2: Full implementation of user-level system calls
The final submission includes both phases, with complete support for all required functionality and test cases.
π Related Code
-
userprog/process.cβ Executable loading, argument stack setup, and child process tracking -
userprog/syscall.cβ System call interface:read,write,exec,wait,remove,filesize,seek,tell, etc. -
lib/user/syscall.cβ User-space syscall interface -
lib/string.c,threads/thread.cβ String helpers, per-thread file descriptor table -
filesys/file.c,filesys/inode.cβ Backend logic used by syscall layer for file operations
π Project 3 β Virtual Memory (Partial Implementation)
Manual: Pintos Project 3
This project required implementing virtual memory features such as supplemental page tables, demand paging, stack growth, and swapping. Due to time constraints, only a subset of core VM functionality was implemented, focusing on demand paging and stack growth.
π Related Code
-
vm/frame.c,vm/frame.hβ Frame table and eviction policy -
vm/page.c,vm/page.hβ Supplemental page table, lazy loading, and memory tracking -
vm/swap.c,vm/swap.hβ Swap disk interface and slot management -
userprog/exception.cβ Page fault handler -
userprog/process.cβ Stack growth and lazy segment loading
π All code in the
vm/directory was written from scratch, as the directory is empty by default.
π Project 4 β File Systems (Partial Implementation)
Manual: Pintos Project 4
This extra credit project focused solely on file growth features, omitting full file system extensions due to time constraints.
π§ Note: This project was not based on Project 3 (Virtual Memory). It was branched directly from the final state of Project 2, as it only required file system enhancements unrelated to virtual memory.
π Related Code
-
filesys/inode.cβ Indexed inode (direct + single indirect), dynamic growth, and partial free logic