vishnu-11 commited on
Commit
48470e7
·
verified ·
1 Parent(s): dc2ae9f

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +268 -0
README.md ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CyberLab OS :: Dual-Architecture Operating Systems Engineering & Research Platform
2
+
3
+ <div align="center">
4
+
5
+ ![OS](https://img.shields.io/badge/OS-CyberLab--OS%20v1.0-cyan?style=for-the-badge&logo=linux)
6
+ ![Kernel](https://img.shields.io/badge/Kernel-RustOS%20Bare--Metal%20x86-orange?style=for-the-badge&logo=rust)
7
+ ![Course](https://img.shields.io/badge/Course-25PCCS201%20Operating%20Systems-purple?style=for-the-badge)
8
+ ![Institution](https://img.shields.io/badge/Institution-JAIN%20(Deemed--to--be%20University)-red?style=for-the-badge)
9
+ ![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)
10
+ [![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Download%20ISO-yellow?style=for-the-badge)](https://huggingface.co/vishnu-11/CyberLab-OS-ISO)
11
+
12
+
13
+ **Student**: Vishnu C
14
+ **USN**: 25BTRCL282
15
+ **Class**: 3rd Semester, B.Tech AI & ML (Section E)
16
+ **Department**: Computer Science & Engineering, Faculty of Engineering & Technology (FET)
17
+ **University**: JAIN (Deemed-to-be University), Bangalore, India
18
+ **Course**: 25PCCS201 — Operating Systems
19
+
20
+ </div>
21
+
22
+ ---
23
+
24
+ ## 📌 Executive Summary
25
+
26
+ **CyberLab OS** is an operating systems engineering and research platform developed for Course **25PCCS201: Operating Systems**. It bridges low-level bare-metal systems programming, virtualization, live Linux distribution mastering, hardware network telemetry, and academic research:
27
+
28
+ 1. **CyberLab OS Live Workstation**: A bootable live Linux desktop operating system featuring an auto-launching terminal, Snap Store application manager, and custom hardware Wi-Fi scanning suite bridged to the physical **Realtek 8852BE Wi-Fi 6 NIC**.
29
+ 2. **RustOS Bare-Metal Kernel**: A standalone, freestanding 32-bit x86 Ring-0 kernel written in Rust (`no_std`, `no_main`, Multiboot 1 compliant) implementing custom GDT, IDT, 8259 Dual PIC, 100 Hz PIT timer, VGA color driver, and PS/2 keyboard shell.
30
+ 3. **Discrete-Event CPU Scheduling Simulation Lab**: A rigorous empirical investigation into *"Fairness vs. Throughput in Preemptive CPU Scheduling"*, evaluating First-Come-First-Served (FCFS), Shortest-Job-First (SJF), and Round Robin (RR) across 50 paired random seeds.
31
+ 4. **Official Academic Documentation & Viva Package**: Comprehensive project reports, benchmark charts, slide-by-slide viva guide, and 4 course lab examination PDFs.
32
+
33
+ ---
34
+
35
+ ## 📸 Live Visual Verification & Screenshots
36
+
37
+ <div align="center">
38
+
39
+ ### 1. CyberLab OS Live Desktop & Terminal
40
+ *Bootable live desktop running in Oracle VirtualBox with centered CyberLab Terminal and desktop icons.*
41
+ ![CyberLab OS Live Desktop](screenshots/live_desktop_with_terminal.png)
42
+
43
+ ### 2. Real-Time Hardware Wi-Fi Scanner (`wifi` CLI & Wi-Fi Center)
44
+ *Physical Realtek 8852BE bridging showing active link to `Vishnu’s iPhone` (5 GHz, Ch 149, 1201 Mbps) alongside nearby networks.*
45
+ ![Real-Time Wi-Fi Scan](screenshots/realtime_wifi_scan.png)
46
+
47
+ ### 3. Dedicated Wi-Fi Center GUI Window
48
+ *One-click desktop launcher opening the standalone telemetry console.*
49
+ ![Wi-Fi Center Launcher](screenshots/wifi_center_gui_live.png)
50
+
51
+ ### 4. Verified Internet Connectivity (ICMP `ping`)
52
+ *Live ICMP transit via bridged wireless interface with 0% packet loss.*
53
+ ![Ping Verification](screenshots/realtime_wifi_ping.png)
54
+
55
+ </div>
56
+
57
+ ---
58
+
59
+ ## 🏛️ System Architecture
60
+
61
+ ```text
62
+ +---------------------------------------------------------------------------------------------------+
63
+ | CYBERLAB OS PLATFORM |
64
+ +-------------------------------------------------+-------------------------------------------------+
65
+ | LAYER A: GUEST OS | LAYER B: RESEARCH LAB |
66
+ | - SliTaz / Openbox Lightweight X11 Desktop | - Discrete-Event CPU Scheduling Simulator |
67
+ | - Centered Auto-Starting Sakura Terminal | - C Engine (scheduler_sim.c) |
68
+ | - Dedicated Desktop Launchers: | - Python Engine (cpu_scheduling_fairness_sim) |
69
+ | * CyberLab Terminal | - 50-Seed Paired Stochastic Trials |
70
+ | * Wi-Fi Center (/usr/bin/wifi-center) | - Jain's Fairness Index & Throughput Metrics |
71
+ | * Snap Store (TazPanel Package Manager) | - Figures 1–7 Publication Charts |
72
+ | - Hardware Telemetry Suite (/usr/bin/wifi) | - Academic Reports & Lab Evaluation PDFs |
73
+ +-------------------------------------------------+-------------------------------------------------+
74
+ | LAYER C: BARE-METAL RUSTOS |
75
+ | - 32-bit x86 Protected Mode Kernel (Multiboot 1 compliant) |
76
+ | - Custom Global Descriptor Table (GDT) & Interrupt Descriptor Table (IDT) |
77
+ | - 8259 Programmable Interrupt Controller (PIC) Remapping (IRQs 0x20–0x2F) |
78
+ | - Programmable Interval Timer (PIT) at 100 Hz (10 ms time-slice quantum) |
79
+ | - Direct Memory-Mapped VGA Text Buffer (0xB8000) & PS/2 Keyboard Driver |
80
+ +---------------------------------------------------------------------------------------------------+
81
+ | LAYER D: HYPERVISOR & HARDWARE LINK |
82
+ | - Oracle VirtualBox 7.2.22 Workstation VM (4096 MB RAM, 2 vCPUs, VBoxSVGA 128 MB VRAM) |
83
+ | - Bridged Network Adapter -> Physical Realtek 8852BE Wireless LAN WiFi 6 PCI-E NIC |
84
+ | - Subnet Gateway: 172.20.10.1 (Vishnu’s iPhone) | VM IP: 172.20.10.3 |
85
+ +---------------------------------------------------------------------------------------------------+
86
+ ```
87
+
88
+ ---
89
+
90
+ ## 🔬 Academic Research Module: Fairness vs. Throughput in CPU Scheduling
91
+
92
+ ### 1. Abstract
93
+ This empirical research investigates whether throughput-maximizing CPU scheduling policies compromise fairness and induce starvation in multi-programmed systems. We compare **First-Come-First-Served (FCFS)**, non-preemptive **Shortest-Job-First (SJF)**, and **Round Robin (RR)** with varying time quanta ($q$) and context-switch costs ($\delta$) under identical stochastic workloads (exponential burst sampling).
94
+
95
+ ### 2. Core Mathematical Formulations
96
+
97
+ #### Useful Throughput ($T$)
98
+ The proportion of simulation horizon spent executing application instructions:
99
+ $$T = \frac{\sum_{i=1}^{n} S_i}{H}$$
100
+ where $S_i$ is service time granted to process $P_i$ and $H$ is the total simulation horizon.
101
+
102
+ #### Jain's Fairness Index ($J$)
103
+ Measures equality of CPU service allocation across competing processes:
104
+ $$J = \frac{\left(\sum_{i=1}^{n} x_i\right)^2}{n \sum_{i=1}^{n} x_i^2}$$
105
+ where $x_i = S_i / B_i$ is the normalized service ratio, $n = 8$, and $J \in [1/n, 1.0]$. A value of $J = 1.0$ represents perfect fairness, while $1/8 = 0.125$ indicates single-process monopolization.
106
+
107
+ ### 3. Empirical Results (50 Paired Seeds, 95% Confidence Intervals)
108
+
109
+ | Metric | FCFS (Baseline) | Shortest Job First (SJF) | Round Robin ($q=5$) |
110
+ | :--- | :---: | :---: | :---: |
111
+ | **Useful Throughput ($T$)** | $0.9798 \pm 0.0002$ | **$0.9996 \pm 0.0000$** | $0.9446 \pm 0.0001$ |
112
+ | **Jain's Fairness Index ($J$)** | $0.6222 \pm 0.0071$ | $0.1799 \pm 0.0135$ | **$0.9340 \pm 0.0010$** |
113
+ | **Minimum CPU Share (%)** | $2.58 \pm 0.07\%$ | $0.01 \pm 0.01\%$ *(Starvation)* | **$6.70 \pm 0.09\%$** |
114
+ | **Context Switch Count** | $1,008.2 \pm 10.4$ | **$21.0 \pm 1.6$** | $2,770.0 \pm 6.4$ |
115
+ | **Mean Waiting Time** | $45.12 \pm 0.81$ | $12.34 \pm 0.45$ | $18.92 \pm 0.52$ |
116
+
117
+ ### 4. Key Scientific Findings
118
+ - **The SJF Starvation Trap**: While SJF achieves near-perfect throughput ($0.9996$), its fairness collapses to $0.1799$, starving long jobs to just $0.01\%$ of CPU capacity.
119
+ - **Round Robin Overhead & Fairness**: Round Robin achieves near-optimal fairness ($0.9340$) and starvation resistance ($6.70\%$ minimum share) at the cost of a $5.5\%$ throughput penalty due to $2,770$ context switches.
120
+ - **Quantum Sensitivity**: Throughput monotonically decreases as quantum $q \to 0$ due to excessive scheduling switches, confirming the optimal engineering threshold at $q \approx 10\delta$.
121
+
122
+ ---
123
+
124
+ ## 📡 Wireless Network & Hardware Telemetry
125
+
126
+ The platform bridges VirtualBox networking directly to the host's physical **Realtek 8852BE Wi-Fi 6 PCI-E NIC**.
127
+
128
+ ### 1. Active Wireless Link Telemetry
129
+ - **Connected SSID**: `Vishnu’s iPhone` `[CONNECTED / ACTIVE]`
130
+ - **BSSID**: `5e:b5:ea:28:f1:f2`
131
+ - **Signal Strength**: `100% (-45 dBm)` (Excellent link quality)
132
+ - **Protocol**: `802.11ax (Wi-Fi 6)` / `5 GHz (Channel 149)`
133
+ - **Security**: `WPA3-Personal (H2E / CCMP Authenticated)`
134
+ - **Throughput Rate**: `1201.0 Mbps` (Tx) / `1201.0 Mbps` (Rx)
135
+
136
+ ### 2. Available Devices in Range (Scan Output)
137
+
138
+ | SSID | Signal | Band | Channel | Security | Connection Status |
139
+ | :--- | :---: | :---: | :---: | :---: | :--- |
140
+ | **`Vishnu’s iPhone`** | **100%** | **5 GHz** | **149** | **WPA3-Personal** | **CONNECTED (Active Device)** |
141
+ | **`Mouni’s iPhone`** | 88% | 5 GHz | 36 | WPA3-Personal | Available in range |
142
+ | **`Jain_Student`** | 75% | 5 GHz | 48 | WPA2-Enterprise | Available in range |
143
+ | **`Jaswanth`** | 70% | 2.4 GHz | 6 | WPA2-Personal | Available in range |
144
+ | **`Airtel_Vishnu.c`** | 60% | 5 GHz | 44 | WPA2-Personal | Saved Profile / Known |
145
+ | **`ASUS_8_2G_5G`** | 45% | 2.4 GHz | 1 | WPA2-Personal | Available in range |
146
+
147
+ ---
148
+
149
+ ## ⚙️ RustOS Bare-Metal Kernel Architecture
150
+
151
+ Located in `rustos/`, the freestanding x86 kernel demonstrates bare-metal systems fundamentals:
152
+ - **`src/main.rs`**: Entry point (`_start`) in freestanding Ring-0 protected mode.
153
+ - **`src/gdt.rs`**: Flat memory model with kernel code and data segment descriptors.
154
+ - **`src/idt/`**: Interrupt Descriptor Table handling CPU division errors, double faults, and hardware IRQs.
155
+ - **`src/pic.rs`**: Dual 8259 PIC remapped to vectors `0x20` (Master) and `0x28` (Slave) to prevent CPU exception conflicts.
156
+ - **`src/pit.rs`**: Channel 0 PIT configured in Square Wave Mode (Rate Generator) at 100 Hz.
157
+ - **`src/keyboard.rs`**: PS/2 scan-code interpreter with key event queue.
158
+ - **`src/vga_buffer.rs`**: Memory-mapped $80 \times 25$ color text buffer at physical address `0xB8000` with KaTeX-styled ASCII colors.
159
+ - **`src/shell.rs`**: Interactive bare-metal shell with commands: `help`, `info`, `clear`, `ticks`, `echo`, `reboot`.
160
+
161
+ ---
162
+
163
+ ## 📁 Repository Directory Structure
164
+
165
+ ```text
166
+ CyberLab-OS/
167
+ ├── README.md # Executive platform showcase (this file)
168
+ ├── Start-CyberLab.ps1 # PowerShell 1-click launcher for VirtualBox
169
+ ├── Start-CyberLab.bat # Windows batch launcher
170
+ │
171
+ ├── cyberlab-os/ # Live Linux OS distribution
172
+ │ ├── build.sh # Base build definition
173
+ │ ├── desktop/ # Desktop entry files (Terminal, Wi-Fi Center, Snap Store)
174
+ │ ├── scripts/ # System utilities
175
+ │ │ ├── wifi # Standalone wireless scanner & ping CLI
176
+ │ │ ├── wifi-center # Interactive Wi-Fi Center terminal launcher
177
+ │ │ ├── wifi-center-run # Interactive shell runner
178
+ │ │ ├── sync-host-wifi.ps1 # Host-to-guest telemetry synchronization
179
+ │ │ └── rebuild-iso.sh # Fast LZMA streaming ISO mastering script
180
+ │ ├── network-center/ # Qt6 Network Center source code
181
+ │ └── system-monitor/ # Qt6 Process & Resource Monitor source code
182
+ │
183
+ ├── research-lab/ # Academic Research Lab
184
+ │ ├── src/ # Simulation engines (C & Python)
185
+ │ │ ├── cpu_scheduling_fairness_simulator.py
186
+ │ │ └── scheduler_sim.c
187
+ │ ├── benchmarks/ # Automated benchmark pipelines
188
+ │ │ ├── run_all_experiments.py
189
+ │ │ └── generate_charts.py
190
+ │ └── reports/ # Results & Publication Figures
191
+ │ ├── fairness_vs_throughput_summary.csv
192
+ │ ├── fairness_vs_throughput_results.json
193
+ │ └── figures/ # Figures 1 through 7 (PNG format)
194
+ │
195
+ ├── rustos/ # Bare-metal x86 Rust kernel
196
+ │ ├── Cargo.toml
197
+ │ ├── linker.ld
198
+ │ └── src/ # Kernel modules (GDT, IDT, PIC, PIT, VGA, Shell)
199
+ │
200
+ ├── docs/ # Comprehensive engineering documentation
201
+ │ ├── ARCHITECTURE.md # Dual-platform engineering details
202
+ │ ├── RESEARCH_PAPER_ANALYSIS.md # Formal research paper analysis
203
+ │ ├── PRESENTATION_GUIDE.md # Viva defense presentation script
204
+ │ ├── VIVA_QUESTIONS.md # 15 Core OS examination questions & answers
205
+ │ └── WIFI_IMPLEMENTATION.md # Physical NIC passthrough & telemetry notes
206
+ │
207
+ ├── screenshots/ # Live verification screenshots
208
+ │ ├── live_desktop_with_terminal.png
209
+ │ ├── realtime_wifi_scan.png
210
+ │ ├── realtime_wifi_status.png
211
+ │ ├── realtime_wifi_ping.png
212
+ │ └── wifi_center_gui_live.png
213
+ │
214
+ ├── OS lab report copy (4).pdf # Official OS Laboratory Evaluation Report
215
+ ├── Vishnu C_282_OS PI.pdf # Performance Index (PI) Submission
216
+ ├── Vishnu. C_282_DD.pdf # Detailed Design (DD) Submission
217
+ └── Vishnu. C_282_linux.pdf # Linux Implementation Report
218
+ ```
219
+
220
+ ---
221
+
222
+ ## 🚀 How to Run
223
+
224
+ ### 1. Launch CyberLab OS in VirtualBox (Windows)
225
+ Run the native launcher:
226
+ ```powershell
227
+ .\Start-CyberLab.ps1
228
+ ```
229
+ Or execute `Start-CyberLab.bat`. The VM will start with 4 GB RAM, bridged Wi-Fi 6 networking, and load directly into the live desktop with the central terminal.
230
+
231
+ ### 2. Run the CPU Scheduling Research Benchmarks
232
+ ```bash
233
+ cd research-lab
234
+ python benchmarks/run_all_experiments.py
235
+ python benchmarks/generate_charts.py
236
+ ```
237
+
238
+ ### 3. Run the Rust Bare-Metal Kernel
239
+ In QEMU:
240
+ ```bash
241
+ cd rustos
242
+ cargo build --release
243
+ qemu-system-i386 -kernel target/target/release/rustos
244
+ ```
245
+
246
+ ---
247
+
248
+ ## 🎓 Academic Viva Questions & Answers (Summary)
249
+
250
+ 1. **Q: Why does Shortest Job First (SJF) cause starvation?**
251
+ *A: SJF greedily selects the ready process with the smallest remaining burst. Continuous arrivals of short jobs prevent long jobs from ever acquiring the CPU, causing Jain's fairness index to drop to $0.1799$ and minimum share to collapse to $0.01\%$.*
252
+
253
+ 2. **Q: How does Round Robin solve starvation?**
254
+ *A: RR imposes a strict hardware-enforced preemption quantum ($q$). Every active process is guaranteed a time-slice within at most $(n-1)q$ units, producing high fairness ($0.9340$) and balanced minimum share ($6.70\%$).*
255
+
256
+ 3. **Q: Why does VirtualBox default NAT block ICMP `ping` on Windows?**
257
+ *A: VirtualBox default NAT operates as a user-mode socket proxy without raw IP socket privileges on Windows. Switching to Bridged Networking attaches VirtualBox's filter driver directly to the Realtek 8852BE wireless NIC, assigning a genuine LAN IP and enabling raw ICMP packet transit.*
258
+
259
+ ---
260
+
261
+ ## 📜 Author & Academic Accreditation
262
+
263
+ - **Author**: Vishnu C (USN: `25BTRCL282`)
264
+ - **Degree**: Bachelor of Technology (B.Tech) in Artificial Intelligence & Machine Learning
265
+ - **Semester**: 3rd Semester, Section E
266
+ - **Institution**: Faculty of Engineering and Technology, **JAIN (Deemed-to-be University)**, Bengaluru, Karnataka, India
267
+ - **Course**: 25PCCS201 — Operating Systems
268
+ - **Date**: Academic Year 2026–2027