Welcome to OS Simulator — a comprehensive, multi-platform application designed to visualize and simulate core Operating System concepts, including Process Scheduling, Deadlock Management, and Continuous Memory Allocation. Built with Kotlin Multiplatform (KMP), it provides a consistent experience across Desktop, Android, and Web platforms.
This simulator provides dynamic visualization and calculation across three major operating system domains:
-
Algorithms Implemented: Simulate and compare six classic algorithms:
-
First-Come, First-Served (FCFS)
-
Shortest Job First (SJF) (Preemptive and Non-Preemptive)
-
Shortest Remaining Time First (SRTF)
-
Round Robin (RR)
-
Priority Scheduling (Preemptive and Non-Preemptive)
-
-
Visualization: Dynamic Gantt Chart visualization of process execution.
-
Metrics: Calculates and displays key performance metrics: Average Waiting Time (AWT) and Average Turnaround Time (ATT).
-
Resource Allocation Graph (RAG): Dynamically builds and visualizes the RAG as resources are allocated and requested.
-
Deadlock Detection: Features a tool that actively scans the graph to detect the presence of circular wait conditions.
-
Banker's Algorithm: Computes the Safe Sequence for resource allocation to demonstrate deadlock avoidance.
-
Allocation Algorithms: Demonstrates the core continuous memory allocation strategies:
-
First Fit
-
Best Fit
-
Worst Fit
-
Next Fit
-
-
Visualization: Clears visualization of memory partitioning, allocation, and deallocation.
-
Fragmentation Analysis: Clearly visualizes and calculates Internal and External Fragmentation caused by the different strategies.
This project leverages the power of Kotlin Multiplatform for cross-platform delivery:
-
Core Language: Kotlin
-
Cross-Platform UI: Compose Multiplatform (Desktop/JVM, Android, Web)
-
Architecture: MVVM/State-Driven Composables
-
Targets: Android, Desktop (JVM), and Web (WasmJs/JS)
Since this is a Kotlin Multiplatform project, setup is straightforward across all environments.
-
Clone the repository:
git clone https://github.com/ItsDeadlyProgrammer/OperatingSystem.git
-
Open in IntelliJ IDEA or Android Studio:
- Use the latest stable version of IntelliJ IDEA (Ultimate recommended for Compose Multiplatform) or Android Studio.
-
Run a specific target:
-
Android: Select the
composeApp
module and run theandroidApp
configuration on an emulator or physical device. -
Desktop (JVM): Run the
composeApp/run
Gradle task (or select the main desktop configuration in your IDE). -
Web (WasmJs/JS): Run the
composeApp:wasmJsBrowserDevelopmentRun
Gradle task and openhttp://localhost:8080/
in your browser.
-
You can experience the application across all its supported platforms:
Try the interactive simulator built with WasmJs directly in your browser:
Download the standalone APK to install on your Android device:
Download the dedicated MSI installer package for Windows:
❤️ This project is a strong demonstration of complex data structure visualization and the power of Kotlin Multiplatform for building educational tools. Feel free to fork, explore, and contribute! PRs are always welcome. ❤️