A small operating-system simulator written in Java + JavaFX. It walks through process scheduling, memory management, mutexes, and a tiny interpreter, with a live UI that shows what is happening every tick.
- Schedulers: Round Robin, HRRN, MLFQ (pick at startup)
- Memory view: live PCB / variable / instruction rows
- Process queues: Ready, Blocked, Finished
- Mutexes: file, user input, user output (locked / free + owner + wait queue)
- Disk + swap: processes get swapped to
DISK_FOLDER/when memory is full - Event log: every system call, scheduler decision, and swap event is logged in the UI
- JDK 23+ (developed against JDK 25 — Eclipse Temurin)
- JavaFX SDK 23+ (download from Gluon)
- Windows (the helper script is PowerShell — Linux/macOS users can run the equivalent
javac/javacommands by hand)
- Download the JavaFX SDK zip from Gluon and extract it somewhere, e.g.
C:\Users\<you>\Downloads\openjfx-26.0.1_windows-x64_bin-sdk\ - Open
run.ps1and update the$JFXvariable at the top to point at thelibfolder of your SDK (the one containingjavafx.controls.jar). - Open PowerShell in the project folder and run:
First-time only — if PowerShell blocks the script, run this once:
.\run.ps1
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
The script will clean bin/, recompile every .java under src/, copy all non-Java resources (FXML, CSS, program files) into bin/, and launch the app.
$JFX = "C:\path\to\javafx-sdk-XX\lib"
# Compile
$sources = (Get-ChildItem -Recurse src -Filter *.java).FullName
javac --module-path $JFX --add-modules javafx.controls,javafx.fxml -d bin $sources
# Copy resources (FXML, CSS, sample programs) into bin
Get-ChildItem -Path src -Recurse -File | Where-Object { $_.Extension -ne ".java" } | ForEach-Object {
$relative = $_.FullName.Substring((Resolve-Path src).Path.Length + 1)
$destination = Join-Path "bin" $relative
$dir = Split-Path $destination -Parent
if (-not (Test-Path $dir)) { New-Item -ItemType Directory -Path $dir -Force | Out-Null }
Copy-Item $_.FullName $destination -Force
}
# Run
java --enable-native-access=javafx.graphics --module-path $JFX --add-modules javafx.controls,javafx.fxml -cp bin main.MainThe repo ships with Eclipse project files (.project, .classpath). Configure the JavaFX user library to point at your SDK's lib/ folder (Window → Preferences → Java → Build Path → User Libraries), then right-click src/main/Main.java → Run As → Java Application.
- Pick an algorithm in the startup dialog (Round Robin / HRRN / MLFQ) and set a quantum (used by Round Robin and MLFQ; ignored by HRRN).
- The main window opens with three sample processes pre-loaded (
Program_1.txt,Program_2.txt,Program_3.txtundersrc/programs/). - Top-bar buttons:
- Start — auto-run, one tick every 5 seconds
- Step — advance one tick
- Pause — stop the auto-runner
- Reset — clear state and re-init
- The CLOCK label counts up, processes move through Ready → Running → Blocked → Finished, and the memory / PCB tables + event log update each tick.
To make ticks faster, lower TIME_BETWEEN_CLOCKS_SEC in src/main/MainController.java.
src/
main/ — JavaFX entry point + controllers + SimulationEngine
scheduler/ — Round Robin, HRRN, MLFQ
memory/ — main memory + swap
systemcalls/ — read/write memory, disk I/O, input, print
mutex/ — file / user-input / user-output mutexes
interpreter/ — executes one instruction per tick
models/ — Process, PCB, MemoryWord, ResourceType, …
viewModels/ — table-row + snapshot DTOs for the UI
view/ — FXML layouts + style.css
programs/ — sample programs the engine loads at startup
Team 108 — GUC, DMET / Operating Systems course.