Skip to content

Ali-khan-786/kernelviz

Repository files navigation

🖥️ KernelViz

An interactive Operating System Visualizer built with React, TypeScript, and Vite that helps students understand CPU Scheduling algorithms and Deadlock Detection through real-time simulation and visualization.

🔗 Live Demo: https://kernelviz.vercel.app


✨ Features

📊 CPU Scheduling Visualizer

Supports simulation of the following scheduling algorithms:

  • First Come First Serve (FCFS)
  • Shortest Job First (SJF)
  • Shortest Remaining Time First (SRTF)
  • Round Robin (RR)
  • Priority Scheduling (Non-Preemptive)
  • Priority Scheduling (Preemptive)

📈 Performance Metrics

For every simulation, KernelViz calculates:

  • Waiting Time
  • Turnaround Time
  • Response Time
  • Completion Time
  • CPU Utilization
  • Throughput

📅 Interactive Gantt Chart

Visualize process execution with a dynamic Gantt Chart that updates according to the selected scheduling algorithm.


🔒 Deadlock Detection

Includes an implementation of Banker's Algorithm to determine whether the system is in a safe or unsafe state.

Features include:

  • Resource Allocation Matrix
  • Maximum Need Matrix
  • Need Matrix Calculation
  • Safe Sequence Detection
  • Deadlock Detection
  • Recovery Suggestions
  • Step-by-step execution log

🛠️ Tech Stack

Technology Purpose
React Frontend UI
TypeScript Type Safety
Vite Build Tool
Tailwind CSS Styling
shadcn/ui UI Components
Lucide React Icons

🚀 Getting Started

Clone the repository

git clone https://github.com/Ali-khan-786/kernelviz.git

Navigate to project

cd kernelviz

Install dependencies

npm install

Start development server

npm run dev

Open

http://localhost:5173

📂 Project Structure

src
│
├── components
│   └── UI Components
│
├── hooks
│
├── lib
│   ├── cpu-scheduler.ts
│   ├── bankers-algorithm.ts
│   └── utils.ts
│
├── pages
│   ├── cpu-scheduling.tsx
│   ├── deadlock-detection.tsx
│   └── not-found.tsx
│
├── App.tsx
└── main.tsx

🧠 Algorithms Implemented

CPU Scheduling

  • FCFS
  • SJF
  • SRTF
  • Round Robin
  • Priority (Non-Preemptive)
  • Priority (Preemptive)

Deadlock

  • Banker's Algorithm

🎯 Learning Objectives

KernelViz was developed to simplify complex Operating System concepts through interactive visualization.

It helps students understand:

  • Process Scheduling
  • Context Switching
  • CPU Utilization
  • Safe and Unsafe States
  • Deadlock Detection
  • Resource Allocation
  • Performance Analysis

🔮 Future Improvements

  • Disk Scheduling Algorithms
  • Page Replacement Algorithms
  • Memory Allocation Visualization
  • Producer-Consumer Simulation
  • Dining Philosophers Simulation
  • Multi-Level Queue Scheduling
  • Export Simulation Report as PDF
  • Load Sample Test Cases

🤝 Contributing

Contributions, suggestions, and improvements are always welcome.

Feel free to fork the repository and submit a pull request.


👨‍💻 Author

Ali Khan

GitHub: https://github.com/Ali-khan-786

If you found this project useful, consider giving it a ⭐.

About

Interactive Operating System Visualizer featuring CPU Scheduling and Banker's Algorithm with real-time animations.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages