Skip to content

About

A modular C-based operating system simulation featuring process scheduling (RR, HRRN, MLFQ), memory management with swapping, mutex-based synchronization, and a custom interpreter with system calls.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖥️ Operating System Simulation (C)

📌 Overview

This project is a modular operating system simulation developed as part of the Operating Systems (CSEN 602) course.

It implements core OS concepts including process management, memory allocation, scheduling algorithms, synchronization, and system calls, with a clear system architecture centered around a kernel and modular components.


🧠 Key Concepts

  • Process Scheduling Algorithms (RR, HRRN, MLFQ)
  • Memory Management & Swapping
  • Synchronization (Mutex & Semaphores)
  • System Calls & Interpreter Design
  • Process Control Blocks (PCB)
  • Modular OS Architecture

⚙️ System Architecture

The system follows a modular kernel-based design, where a central kernel coordinates all subsystems:

🔹 Core Modules

  • Kernel → Controls system execution and coordination
  • Process Manager → Handles process creation and lifecycle
  • Scheduler → Implements RR, HRRN, and MLFQ
  • Memory Manager → Allocates memory and enforces boundaries
  • Swap Manager → Handles process swapping between memory and disk
  • Interpreter → Executes program instructions
  • System Calls Layer → Handles I/O and memory operations
  • Mutex Manager → Ensures mutual exclusion on shared resources
  • Queues → Ready & Blocked process queues
  • Trace Module → Logs system state at each clock cycle

🔄 Process Management

  • Processes created from program text files at configurable arrival times

  • Each process has a PCB containing:

    • Process ID
    • State
    • Program Counter
    • Memory Boundaries
  • Full lifecycle simulation (Ready, Running, Blocked, Finished)


🧠 Memory Management

  • Fixed memory size: 40 words

  • Stores:

    • Instructions
    • Variables
    • PCB data
  • Memory protection between processes

  • Process swapping to disk when memory is full


⏱️ Scheduling Algorithms

  • Round Robin (RR) → Preemptive scheduling with time slices
  • Highest Response Ratio Next (HRRN) → Non-preemptive scheduling
  • Multi-Level Feedback Queue (MLFQ) → Multi-priority scheduling system

🔐 Synchronization

  • Mutexes for:

    • File access
    • User input
    • Output display
  • Uses:

    • semWait
    • semSignal
  • Blocked queues for waiting processes


🧾 System Calls

  • File read/write
  • User input handling
  • Output display
  • Memory read/write operations

🧩 Interpreter

Executes instructions from program files, including:

  • assign
  • print
  • readFile
  • writeFile
  • printFromTo
  • semWait / semSignal

📊 System Trace Output

  • Ready & Blocked queues after each scheduling event
  • Current executing process
  • Executed instruction per cycle
  • Memory state at each clock cycle
  • Process swapping logs (memory ↔ disk)

🛠️ Technologies Used

  • C Programming Language
  • Data Structures & Algorithms
  • Operating Systems Concepts

⚠️ Notes

  • Designed to simulate core OS behavior, not a full production OS
  • Emphasis on correctness, modularity, and system architecture

👩‍💻 Author

Developed as part of coursework at the German University in Cairo.

About

A modular C-based operating system simulation featuring process scheduling (RR, HRRN, MLFQ), memory management with swapping, mutex-based synchronization, and a custom interpreter with system calls.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages