An interactive, educational web application that visualizes core Operating System concepts including CPU scheduling, memory management, and file system operations.
This OS Simulator is designed for students and educators to understand how operating systems work internally through interactive, step-by-step visualizations.
-
CPU Scheduling Algorithms
- FCFS (First Come First Serve)
- SJF/SRTF (Shortest Job First / Shortest Remaining Time First)
- Priority Scheduling (Preemptive & Non-Preemptive)
- Round Robin with configurable time quantum
-
Memory Management
- Paging simulation with page tables
- Virtual to physical address translation
- Page fault handling
- Page replacement algorithms (FIFO, LRU, Optimal)
-
File System
- Block-based file operations
- Create, read, write, delete operations
- Block allocation visualization
- Directory and file management
-
Educational Features
- Step-by-step explanations
- Real-time Gantt charts
- Performance metrics
- Process state transitions
- Demo scenarios for teaching
OS_SIMULATOR(Web_App)/
βββ backend/ # Python FastAPI backend
β βββ schedulers/ # CPU scheduling algorithms
β βββ memory/ # Memory management & paging
β βββ filesystem/ # File system simulation
β βββ routes/ # REST API endpoints
β βββ scenarios/ # Demo scenarios
βββ frontend/ # React.js frontend
βββ src/
β βββ pages/ # Main application pages
β βββ components/ # Reusable UI components
β βββ services/ # API integration
βββ public/
- Python 3.8 or higher
- Node.js 16 or higher
- npm or yarn
- Navigate to the backend directory:
cd backend- Install Python dependencies:
pip install -r requirements.txt- Start the FastAPI server:
python main.pyThe backend API will be available at http://localhost:8000
- API Documentation:
http://localhost:8000/docs
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will be available at http://localhost:5173
- Navigate to the CPU Scheduler page
- Select a scheduling algorithm (FCFS, SJF, Priority, or Round Robin)
- Add processes with arrival time, burst time, and priority
- Or load a pre-built demo scenario
- Click "Run Simulation" to see:
- Gantt chart visualization
- Performance metrics
- Step-by-step explanations
- Process details table
API endpoints available at /api/memory/*:
- Create page tables
- Allocate pages
- Simulate page faults
- Test page replacement algorithms
API endpoints available at /api/filesystem/*:
- Create files and directories
- Read/write operations
- Block visualization
- File deletion
- Operating Systems Courses: Demonstrate scheduling algorithms and their trade-offs
- Lab Sessions: Interactive exercises with custom scenarios
- Self-Study: Learn OS concepts through visualization
- Exam Preparation: Compare algorithm performance metrics
Pre-built scenarios available in backend/scenarios/:
fcfs_basic.json- Simple FCFS demonstrationround_robin_demo.json- Round Robin with time quantum effects
POST /api/scheduler/run- Run simulationPOST /api/scheduler/compare- Compare algorithmsGET /api/scheduler/algorithms- List available algorithms
POST /api/memory/create-page-table- Create page tablePOST /api/memory/access-page- Access page (may cause fault)POST /api/memory/page-replacement- Simulate replacement
POST /api/filesystem/create-file- Create filePOST /api/filesystem/read-file- Read filePOST /api/filesystem/write-file- Write to fileDELETE /api/filesystem/delete- Delete file/directory
Full API documentation available at http://localhost:8000/docs when running the backend.
The application features:
- Modern dark theme with vibrant accents
- Smooth animations using Framer Motion
- Responsive design for various screen sizes
- Glassmorphism effects
- Interactive visualizations
cd backend
pytest tests/ -v- Start both backend and frontend servers
- Navigate through the application
- Test each scheduling algorithm
- Verify metrics calculations
- Check explanations for accuracy
Backend:
- Python 3.8+
- FastAPI - Modern web framework
- Pydantic - Data validation
- Uvicorn - ASGI server
Frontend:
- React 18 - UI library
- Vite - Build tool
- React Router - Navigation
- Framer Motion - Animations
- Recharts - Data visualization
- Axios - HTTP client
This is an educational project. Contributions welcome for:
- Additional scheduling algorithms
- More memory management features
- Enhanced visualizations
- Additional demo scenarios
- Documentation improvements
Educational project - Free to use for learning purposes.
Developed as a comprehensive Operating Systems educational simulator.
- Inspired by classic OS textbooks and concepts
- Built for students and educators
- Designed with modern web technologies
For questions or issues:
- Check the API documentation at
/docs - Review demo scenarios for examples
- Examine the code comments for implementation details
Happy Learning! π