Skip to content

A dynamic web-based simulation of real-time clock (RTC) management and synchronization across OS partitions

License

Notifications You must be signed in to change notification settings

Haksham/Linux-project

Repository files navigation

🕒 Real-Time Clock Partition Simulator

A dynamic, interactive web-based simulation of real-time clock (RTC) management and synchronization across OS partitions.
Built for Linux session.


🚀 Overview

This project demonstrates master-slave RTC synchronization in a multi-partition system:

  • Linux acts as the Master Partition, reading time from the hardware clock.
  • Windows OS and Ubuntu are Slave Partitions whose clocks can drift and become out of sync.
  • You can simulate clock drift, observe out-of-sync states, and manually synchronize all partitions—just like using timedatectl set-local-rtc 1 in Linux.

✨ Features

  • Live RTC Simulation: Visualize how clocks drift and sync in real time.
  • Master-Slave Architecture: Linux (master) always stays in sync; others can drift.
  • Manual & Bulk Sync: Instantly synchronize all slave partitions with a single click.
  • Visual Feedback: Out-of-sync states are clearly highlighted.
  • Modern UI: Responsive, attractive interface using React and Next.js.
  • Command Simulation: Simulate Linux RTC commands and observe their effects.

🖼️ Screenshots

RTC Dashboard

Out of Sync Example

Sync All Example

Sync All Example

Sync All Example

🛠️ Getting Started

1. Clone the repository

git clone https://github.com/yourusername/linux-proj.git
cd linux-proj

2. Start the RTC Master Server

cd rtc-sim
npm install
node index.js

3. Start the Frontend

cd ../frontend
npm install
npm run dev

Open http://localhost:3000 in your browser.


🏗️ Project Structure

📁 linux-proj/ (Root) ├── frontend/ (Next.js frontend) │   ├── app/

│   │   ├── layout.js
│   │   ├── page.js
│   │   └── globals.css
│   ├── components/
│   │   └── PartitionClock.js
│   ├── pic/ (Screenshots & images)
│   │   ├── p1.png
│   │   ├── p2.png
│   │   ├── p3.png
│   │   ├── p4.png
│   │   ├── p5.png
│   ├── .gitignore
│   ├── jsconfig.json
│   ├── next.config.mjs
│   ├── package.json
│   ├── postcss.config.mjs
│   ├── README.md
│   ├── requirements.txt
│   └── tailwind.config.mjs
├── rtc-sim/ (Node.js backend)
│   ├── .gitignore
│   ├── index.js
│   ├── package.json
│   └── requirements.txt
├── .gitignore
├── Commands.txt
├── LICENSE
├── Makefile
├── README.md
├── rtc_slave.c
├── rtc_sync.c


⚙️ How It Works

  • Master Clock: The backend (rtc-sim/index.js) broadcasts the current time to all partitions.
  • Partitions: Each partition (component) simulates its own clock, which may drift.
  • Synchronization: Slave partitions periodically sync to the master, or can be manually synced via UI buttons.
  • Command Simulation: Use the UI to simulate commands like timedatectl set-local-rtc 1 for instant synchronization.

🖥️ Useful Commands

The following commands (from Commands.txt) are useful for working with the kernel RTC module:

make

sudo insmod rtc_sync.ko

sudo dmesg | grep rtc_shm

ls -l /dev/rtc_shm

cat /dev/rtc_shm

gcc rtc_slave.c -o rtc_slave

sudo ./rtc_slave

sudo rmmod rtc_sync

📚 References


👨‍💻 Authors

  • Harsh V M
  • Karthik Hegde

📝 License

This project is licensed under the MIT License. See LICENSE for details.

About

A dynamic web-based simulation of real-time clock (RTC) management and synchronization across OS partitions

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages