API simulator that implements fork and exec system calls on top of the interrupt simulator from A1.
Simulates an OS with fixed memory partitions that handles fork/exec syscalls. Tracks process control blocks (PCBs) and manages memory allocation for programs. Outputs execution logs and system status snapshots.
Compile and run:
chmod +x build.sh
./build.sh
./bin/interrupts trace.txt vector_table.txt device_table.txt external_files.txttrace.txt- main trace with CPU/SYSCALL/FORK/EXEC activitiesvector_table.txt- ISR vector addressesdevice_table.txt- device delays in msexternal_files.txt- available programs and their sizesprogram*.txt- external program traces loaded by EXEC
execution.txt- timestamped execution log (CSV format)system_status.txt- PCB/memory snapshots after each FORK/EXEC
6 fixed partitions: 40, 25, 15, 10, 8, 2 MB Init process starts in partition 6 (2 MB, uses 1 MB)
- FORK uses vector 2, EXEC uses vector 3
- Child processes run before parent resumes
- Loader time is 15ms per MB of program size