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.

  • threads/thread.c, threads/thread.h – Alarm list logic, priority-aware scheduling (thread_set_priority(), thread_get_priority())
  • devices/timer.c – Reimplemented timer_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.

  • 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.

  • 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.

  • filesys/inode.c – Indexed inode (direct + single indirect), dynamic growth, and partial free logic