Skip to content

MahrozSarmad/OperatingSystemSimul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖥️ Operating System Simulation Project

A simplified simulation of core Operating System functionalities, designed to demonstrate how modern OS components interact with hardware, manage processes, and execute tasks efficiently.


📦 Features Implemented

  1. Hardware Resources
    Simulated CPU cores and memory blocks for resource management and allocation.

  2. Operating System Boot
    Initializes hardware abstraction, sets up process tables, and loads system modules.

  3. Instruction Guide
    A CLI-based user guide to help users interact with and test various OS features.

  4. Task Execution
    Tasks are executed using execlp, enabling isolated child processes to simulate real-world execution.

  5. Process Scheduling
    A dynamic scheduler backed by a circular queue structure that ensures fair and efficient process execution.

  6. Process Lifecycle
    Complete management of process creation, execution, waiting, and termination, with proper resource cleanup.

  7. Data Storage
    Simulated file and block-based storage for temporary data generated by processes.

  8. Handling Interrupts
    Installed SIGCHLD handlers to detect child process terminations and trigger resource deallocation.


❌ Modules That Were Not Implemented

  • null

⚙️ Challenges Faced & Solutions

  1. Uncontrolled Task Execution
    Tasks failed to run in sequence.
    Fixed using execlp in child processes along with the --wait flag to ensure sequential execution.

  2. Inefficient Process Queuing
    Resource limitations blocked new processes.
    Solved with a circular queue and retry logic in the scheduler when resources become available.

  3. Resource Leakage on Process Termination
    Memory/CPU remained locked after task exit.
    Resolved by handling SIGCHLD, deallocating resources, and removing stale process table entries.


📚 Learnings from the Project

  • Deep understanding of process lifecycle from creation to termination.
  • How OS manages hardware resources, including CPU time and memory.
  • The critical role of context switching for smooth multitasking.
  • Why and how resource leaks affect system stability, and ways to prevent them.
  • Implemented real-world OS concepts like interrupt handling, child processes, and dynamic scheduling.

🚀 Getting Started

  1. Clone the repo
    git clone https://github.com/MahrozSarmad/OperatingSystemSimul
    

About

This is a cmd based operating system simulation that involves scheduling, interrupts, signals, kernel mode and other basic tasks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages