The OS'24 Project is a comprehensive, hands-on implementation of an operating system designed to teach fundamental concepts like memory management, process scheduling, synchronization, and fault handling. It emphasizes modularity and provides students with a strong foundation in systems programming.
- A simple command-line interface to execute kernel-level commands.
- Supports commands like
kernel_info
,nclock
, and others for testing and interaction.
- Provides a bridge between user programs and the kernel, enabling secure execution of privileged operations.
- Validates user-provided pointers and ensures proper handling of invalid memory access.
- Kernel Heap: Implemented block and page-level allocators for dynamic memory allocation.
- First-Fit Strategy: Used for both block and page allocations.
- Supports functions like
kmalloc
,kfree
.
- User Heap: Memory allocation for user programs with lazy allocation using system calls.
- Page Allocator: Handles memory on a page-level granularity for efficient management.
- Shared Memory: Allows multiple processes to share memory regions for interprocess communication.
- Page Fault Handling: Implements lazy allocation and replacement policies to manage memory faults efficiently.
- Nth Chance Clock Replacement: Optimized page replacement algorithm for balancing performance and memory utilization.
- Locks:
- Implemented spinlocks for short critical sections with busy-waiting.
- Designed sleeplocks to handle longer critical sections by blocking threads and avoiding CPU wastage.
- Ensures safe access to shared kernel resources.
- Semaphores:
- User-level semaphores to synchronize processes.
- Operations include:
- semWait: Decreases the semaphore value and blocks the process if the value is negative.
- semSignal: Increases the semaphore value and unblocks waiting processes if needed.
- Handles common issues like deadlocks and priority inversion with proper locking mechanisms.
- Priority Round-Robin Scheduler:
- Preemptive scheduling with multiple priority levels.
- Prevents starvation by promoting processes based on their waiting time.
- Supports commands like
schedPRIRR
for dynamic configuration.