An interactive web-based Operating System Simulator built with React. This application provides a comprehensive platform for learning and visualizing key OS concepts including CPU scheduling algorithms, synchronization problems, deadlock detection, and more.
- Algorithms Supported:
- First Come First Served (FCFS)
- Shortest Job First (SJF) - Non-Preemptive & Preemptive
- Round Robin
- Priority Scheduling
- Real-time Visualization: Interactive Gantt charts showing process execution over time
- Process Management: Add, edit, and manage processes with custom arrival times, burst times, and priorities
- Queue Visualization: Live updates of ready and waiting queues
- Controls: Play, pause, reset, and single-step execution
- Producer-Consumer Problem: Bounded buffer simulation with semaphores
- Readers-Writers Problem: Shared resource access with reader/writer priorities
- Dining Philosophers: Resource allocation and deadlock prevention
- Critical Section: Demonstration of race conditions with and without mutex
- Banker's Algorithm: Safe state checking and resource request handling
- Resource Allocation Graph: Visual representation of resource dependencies
- Analytics Dashboard: Performance metrics and algorithm comparison
- Dark/Light Theme: Toggle between themes for better visibility
- Responsive Design: Works on desktop and mobile devices
- Export Functionality: Generate PDFs of simulation results
- Preset Scenarios: Pre-loaded examples for quick testing
- Frontend Framework: React 18 with Hooks
- Build Tool: Vite
- Styling: Tailwind CSS
- Charts: Recharts
- Icons: Lucide React
- Animations: Framer Motion
- PDF Generation: jsPDF + html2canvas
- Routing: React Router DOM
- Node.js (v16 or higher)
- npm or yarn
-
Clone the repository:
git clone https://github.com/Parv2606/OS_Simulator.git cd OS_Simulator -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser: Navigate to
http://localhost:5173
- Navigate to the CPU Scheduling simulator
- Select an algorithm from the dropdown
- Add processes using the process editor (specify arrival time, burst time, priority if applicable)
- Click "Start" to begin the simulation
- Use controls to pause/resume or step through execution
- View the Gantt chart and metrics in real-time
- Choose a synchronization module (Producer-Consumer, Readers-Writers, Dining Philosophers, Critical Section)
- Adjust parameters (buffer size, number of philosophers, etc.)
- Run the simulation to observe synchronization behavior
- Monitor semaphore states and process interactions
- Go to the Banker's Algorithm section
- Define available resources and process requirements
- Simulate resource requests
- View safety checks and allocation graphs
src/
├── components/ # Reusable UI components
├── pages/ # Main application pages
├── engine/ # Simulation logic and algorithms
├── data/ # Presets and theoretical content
├── utils/ # Helper functions
└── App.jsx # Main application component
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow React best practices
- Use meaningful component and variable names
- Add comments for complex logic
- Test your changes thoroughly
This project is licensed under the MIT License - see the LICENSE file for details.
- Built for educational purposes to help students understand OS concepts
- Inspired by various OS textbooks and online resources
- Special thanks to the open-source community
If you have any questions or issues, please open an issue on GitHub or contact the maintainers.
Note: This simulator is designed for educational purposes and may not reflect real-world OS implementations perfectly. Use it as a learning tool alongside theoretical study.
- Producer Consumer with bounded buffer, mutex, and counting semaphores
- Readers Writers with shared-reader and exclusive-writer behavior
- Dining Philosophers with resource ordering to prevent deadlock
- Critical Section with and without a mutex to demonstrate race conditions
src/
components/
Controls.jsx
GanttChart.jsx
QueueView.jsx
data/
scenarios.js
engine/
processModel.js
scheduler.js
simulationEngine.js
sync/
mutex.js
semaphore.js
npm install
npm run devnpm run build