How a-elbana/os-scheduler works
OS Scheduler is a discrete-event simulator: a user selects a scheduling mode, the generator reads and time-dispatches a workload, and the scheduler runs child workers against an emulated clock. Its main branches are HPF, Round Robin with demand-paged memory, and two-CPU FCFS with load balancing/stealing. Shared queues, PCB lookup, IPC helpers, and performance/logging support these flows. Relationships below rely on README statements and the provided excerpts; unsampled implementation details are not inferred.
Main entry points: scheduler.c Scheduler Entry · process_generator.c Process Generator · scheduler.h Scheduler Contract · RR.c Round Robin
Components 17
Workload and Clock
- Process Generator
process_generator.c - Emulated Clock
clk.c
Scheduling
- Scheduler Entry
scheduler.c - HPF Scheduler
HPF.c - Round Robin
RR.c - Two-CPU FCFS
TwoCPU.c - CPU Worker
process.c
Paging
- Paging Worker
processRR.c - MMU and NRU
MMU.c - Memory Types
MMU.h - RR Memory Traces
requests_1.txt
Runtime Support
- Ready Queues
queue.c - PCB Lookup
hash_table.c - Scheduler Contract
scheduler.h - IPC and Clock Helpers
headers.c - Shared Types
headers.h
Other components
- Operator
Connections 22
- Operator → Process Generator: selects mode
README.md - Process Generator → Emulated Clock: starts clock
README.md - Process Generator → Scheduler Entry: starts scheduler
README.md - Process Generator → Scheduler Entry: dispatches arrivals
process_generator.c - Scheduler Entry → HPF Scheduler: routes mode
scheduler.c - Scheduler Entry → Round Robin: routes mode
scheduler.c - Scheduler Entry → Two-CPU FCFS: routes mode
scheduler.c - Scheduler Entry → Ready Queues: uses queues
scheduler.c - Scheduler Entry → PCB Lookup: indexes PCBs
scheduler.c - Scheduler Entry → CPU Worker: starts worker
scheduler.c - Round Robin → Paging Worker: starts worker
RR.c - Paging Worker → RR Memory Traces: reads trace
README.md - Round Robin → MMU and NRU: handles paging
- MMU and NRU → Memory Types: uses definitions
MMU.c - Scheduler Entry → IPC and Clock Helpers: uses IPC helpers
scheduler.c - Process Generator → IPC and Clock Helpers: uses clock helpers
README.md - Process Generator → Shared Types: uses process messages
- Scheduler Contract → Shared Types: includes types
scheduler.h - Scheduler Contract → Ready Queues: includes queue API
scheduler.h - Scheduler Contract → PCB Lookup: includes lookup API
scheduler.h - Scheduler Entry → MMU and NRU: initializes memory
scheduler.c - Two-CPU FCFS → Ready Queues: queues processes
TwoCPU.c