Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SkyWatch – Operating System Simulation

1. Project Overview

SkyWatch simulates a realistic Operating System (OS) for air traffic control, demonstrating process management, scheduling, and inter-process communication. It’s perfect for learning advanced OS concepts, process scheduling algorithms, and IPC mechanisms.

  • Multi-Level Feedback Queue (MLFQ) scheduling
  • Forked Process Management – Jet generation and lifecycle
  • Inter-Process Communication – POSIX FIFOs for updates
  • Signal Handling – Graceful termination and cleanup
  • Real-time Monitoring – Queue and runway display
  • Dynamic Jet Lifecycle – Fuel tracking, emergencies, runway allocation
  • Logging – Event tracking for debugging and analysis

2. Tech Stack

  • Language: C++17 or later
  • Platform: Linux / WSL (POSIX-compliant)
  • Compiler: g++ 7+
  • Concurrency & IPC: fork(), select(), FIFOs, threads, mutex
  • Storage: Local runtime logging
  • Visualization: Terminal-based queue and radar display

3. Project Structure

SkyWatch_System_With_Threads_&_Pipes/
├── include/
│   └── skywatch.h
├── src/
│   ├── main.cpp
│   ├── scheduler.cpp
│   ├── jet.cpp
│   ├── display.cpp
│   └── atc.cpp
├── build.sh
├── .gitignore
├── LICENSE
└── README.md

4. Setup & Usage

chmod +x build.sh
./build.sh

or

./skywatch

5. Major Components

5.1 Jet Generator

  • Forks jet child processes dynamically
  • Creates FIFO for each jet
  • Sends metadata to ATC
  • Simulates random arrivals

5.2 ATC (Air Traffic Control)

  • Event-driven controller using select()
  • Manages scheduling queues
  • Reads jet updates via FIFOs
  • Allocates runways
  • Handles user input commands

5.3 Scheduler (MLFQ)

  • Three Priority Queues:

    • Q0 – Emergency Jets (Shortest Remaining Time First)
    • Q1 – Standard Jets (Round Robin)
    • Q2 – Batch Jets (FCFS)
  • Dynamic promotion/demotion

  • Aging to prevent starvation

  • Selects next jet for runway

5.4 Display Module

  • Real-time queue visualization
  • Radar-style overview
  • Jet status updates
  • Runway occupancy display

5.5 Jet Process

  • Individual jet simulation
  • Fuel consumption tracking
  • Queue traversal and emergency handling

6. Scheduling Workflow

  1. Jet Created – Generator forks jet, FIFO created
  2. ATC Receives Jet – JetInfo struct, assigned to queue
  3. Scheduler Chooses Jet – Based on priority, fuel, time quantum
  4. Running Jet – Communicates with ATC via FIFO
  5. Jet Terminates – Signals ATC, FIFO removed, memory cleaned

7. Function Explanation

main.cpp

  • Global state setup
  • FIFO creation
  • Signal handlers (SIGINT)
  • Starts ATC loop

jet.cpp

  • Jet lifecycle, fuel tracking, FIFO messaging

scheduler.cpp

  • Queue management
  • MLFQ scheduling, promotion/demotion
  • Jet selection

display.cpp

  • Terminal-based queue visualization

atc.cpp

  • Main event loop
  • Reads FIFO messages
  • Processes user commands

8. Future Improvements

  • Add GUI visualization
  • Switch FIFOs to Unix domain sockets
  • Thread-based jet simulation for Windows
  • Configurable runtime parameters
  • Export logs to JSON/CSV

9. Ethical & Legal Notice

  • For educational and experimental purposes only
  • Controlled environment testing
  • Misuse for unauthorized access is prohibited

10. Author & Contact

Name: Mohid Umer
Email: mohidumer112@gmail.com

SkyWatch demonstrates OS scheduling, IPC, and process management through a technically rigorous, real-time simulation.

About

threadsSkyWatch – Real-time Operating System simulation in C++ featuring MLFQ scheduling, process management, and inter-process communication for air traffic control.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages