Skip to content

A C-based simulation of an elevator system using First Come First Serve (FCFS) scheduling. Developed for an Operating Systems lab project to demonstrate process creation and inter-process communication using pipes.

Notifications You must be signed in to change notification settings

ilyaan-umatia/Elevator-Control-System-oslab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Elevator Control System πŸšͺπŸ›—

A C-based simulation of an elevator system developed as a lab project for Operating Systems. The system uses First Come First Serve (FCFS) scheduling to manage elevator requests and demonstrates core OS concepts like process creation and inter-process communication (IPC) using pipes.

πŸ“Œ Objective

Simulate an elevator that processes floor requests in the order they arrive (FCFS). The goal is to calculate:

  • Waiting Time
  • Completion Time
  • Realistic elevator movement between floors

🧠 Key Features

  • Randomly generates elevator requests (arrival time, target floor, burst time)
  • Parent process creates and sends requests to the child process using pipes
  • Child process calculates:
    • Waiting time
    • Completion time
    • Serves each request by simulating floor movement
  • Tabular output of request details and timings

πŸ”§ Technologies Used

  • Language: C
  • Concepts: Process Creation (fork()), Pipes, Structs, Scheduling
  • Platform: Ubuntu (Linux Terminal)

πŸ”„ Sample Workflow

  1. Parent process generates 1–5 random elevator requests.
  2. Sends requests to child process via a pipe.
  3. Child process:
    • Processes each request in FCFS order.
    • Simulates elevator travel using sleep() based on burst time.
    • Calculates and prints waiting and completion times.

🏁 How to Run

gcc ecs-code.c -o ecs-code
./ecs-code

About

A C-based simulation of an elevator system using First Come First Serve (FCFS) scheduling. Developed for an Operating Systems lab project to demonstrate process creation and inter-process communication using pipes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages