Skip to content

Latest commit

Β 

History

History
181 lines (126 loc) Β· 3.89 KB

File metadata and controls

181 lines (126 loc) Β· 3.89 KB

CloudKernel β˜οΈβš™οΈ

Overview

CloudKernel is a small Java-based simulation created for our Operating Systems Lab.
The purpose of this project is to show how a hypervisor-like system can manage multiple Virtual Machines (VMs) while coordinating shared resources.

Instead of building a real operating system, this project focuses on demonstrating important OS concepts like synchronization, resource sharing, and concurrent execution using Java threads.

The program simulates a system where several virtual machines start after the system boots, run tasks together, and share limited network resources.


πŸŽ“ Academic Information

Course: Operating Systems Lab
Semester: 4th Semester

Submitted to:
Mam Amara Nadeem

Submitted by:

  • Moavia Amir (2k24_BSAI_72)
  • Ali Raza (2k24_BSAI_44)
  • Muhammad Arslan Nasir (2k24_BSAI_26)

Submission Date:
March 03, 2026


🎯 Project Goals

This project was designed to help understand how operating systems manage:

  • System boot coordination
  • Thread synchronization
  • Limited resource sharing
  • Parallel execution of processes

All these ideas are implemented using Java concurrency utilities.


βš™οΈ Key Concepts Used

1. System Boot Coordination

Before any virtual machine starts running, the system must finish its boot process.

We simulate this using CountDownLatch.
It ensures that resources like Disk and RAM are ready before the virtual machines begin execution.


2. VM Cycle Synchronization

Each virtual machine performs its work in cycles.
To keep them synchronized, we use CyclicBarrier.

This means all VMs must finish a cycle before the next one begins.


3. Limited Network Access

In real systems, hardware resources are limited.
In this simulation, only two VMs can use the network at the same time.

This is managed using a Semaphore, which controls access to the shared network ports.


🧩 Project Structure

CloudKernel
β”‚
β”œβ”€β”€ src
β”‚ β”‚
β”‚ β”œβ”€β”€ Main.java
β”‚ β”‚
β”‚ β”œβ”€β”€ core
β”‚ β”‚ β”œβ”€β”€ BootManager.java
β”‚ β”‚ β”œβ”€β”€ ClockSynchronizer.java
β”‚ β”‚ └── NetworkPortManager.java
β”‚ β”‚
β”‚ β”œβ”€β”€ entities
β”‚ β”‚ └── VirtualMachine.java
β”‚ β”‚
β”‚ └── utils
β”‚ └── Logger.java
β”‚
β”œβ”€β”€ doc
β”‚ └── proposal
β”‚
└── README.md

πŸ— System Workflow

The program runs in the following order:

System Boot
β”‚
β–Ό
BootManager initializes resources
β”‚
β–Ό
Virtual Machines start (Threads)
β”‚
β–Ό
VMs execute cycles together
β”‚
β–Ό
Network access controlled by Semaphore
β”‚
β–Ό
Logs printed to terminal

▢️ How to Run the Project

1. Compile the project

javac -d out -sourcepath src src/Main.java

2. Run the program

java -cp out Main

πŸ–₯ Example Output

When the program runs, you may see output like:

[BOOT] Disk initialized
[BOOT] RAM initialized
[BOOT] System ready

[VM-1] Starting execution
[VM-2] Starting execution
[VM-3] Starting execution

[VM-1] Requesting network access
[VM-2] Requesting network access

[VM-1] Using network port
[VM-2] Using network port

[VM-3] Waiting for network port

The Logger class keeps the output organized so it is easier to read.

🧠 What We Learned

While building this project, we understood how operating systems handle:

  • Thread synchronization

  • Shared resource management

  • Parallel execution

  • Process coordination

These concepts are important for understanding how real operating systems and cloud platforms work.


πŸ“Œ Conclusion

CloudKernel is a simple educational simulation that demonstrates how a hypervisor-like system can coordinate virtual machines and manage shared resources.

Although it is a simplified model, it provides a clear understanding of synchronization and concurrency in operating systems.