Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌅 CoreDawn — Light at the Heart of Machines

Where kernels breathe, processes live, and memory remembers.

CoreDawn is not just an Operating System simulator. It is a living kernel narrative — a space where classic OS theory wakes up, moves, competes for CPU time, fragments memory, talks through shared buffers, and finally… terminates.

This project is built to feel like an OS, not merely explain one.

🧠 Designed as a learning battlefield ⚙️ Engineered as a kernel core 💻 Written in pure C with POSIX threads


🧑‍💻 Created & Engineered By

AbdulRehman Gulfaraz Systems • Low-level Engineering • OS Internals

“Before building applications, I wanted to understand what gives them life.”


🔥 What Is CoreDawn?

CoreDawn is a Mini Operating System Simulator that recreates the heartbeat of an OS kernel:

  • Processes compete for CPU
  • Memory gets allocated, split, fragmented, and healed
  • Files live inside a virtual disk
  • Messages travel through shared memory
  • A scheduler runs silently on another thread — just like a real CPU

And you control everything through a root-level shell.

This is not a GUI toy. This is a command-driven kernel experience.


🖥️ The Experience

When CoreDawn boots, you enter:

root@CoreDawn:/

From here, you can:

  • Create and kill processes
  • Fork execution trees
  • Load programs from /bin
  • Switch CPU scheduling algorithms on the fly
  • Inspect RAM at the block level
  • Watch processes evolve through states
  • Read IPC messages protected by mutex locks
  • Run a full automated kernel simulation

Every command you type changes the system state.


⚙️ Core Capabilities

🧩 Process Management

  • Dynamic process creation

  • PID allocation starting from 1000

  • Parent → Child forking

  • Explicit process states:

    • READY
    • RUNNING
    • TERMINATED

Each process owns:

  • Priority
  • CPU burst time
  • Memory segment
  • Execution life

⏱️ CPU Scheduling Engine

Runs on a separate pthread, simulating CPU time slices.

Supported algorithms:

  • 🔄 Round Robin (Quantum = 2)
  • 📥 FCFS
  • Shortest Job First
  • 🏁 Priority Scheduling

Execution ends with a text-based Gantt Chart, because timing matters.


🧠 Memory Management Unit (MMU)

Simulated RAM: 1024 units

Allocation Strategy:

  • First-Fit

Memory intelligence:

  • Block splitting on allocation
  • Automatic coalescing on free
  • External fragmentation awareness

You don’t just use memory — you see it breathe.


📂 Virtual File System

A fully navigable disk abstraction:

  • Rooted at /
  • Protected /bin directory
  • Dynamic working directory tracking

Supported shell commands:

ls | cd | mkdir | touch | rm

The shell prompt updates as you move — just like a real OS.


🔐 Inter-Process Communication (IPC)

Processes speak through a shared circular buffer:

  • Stores last 10 messages
  • Fully mutex-protected
  • Race-condition safe

This module exists to prove concurrency correctness, not just message passing.


🏗️ Internal Architecture

CoreDawn/
├── src/
│   ├── process_manager.c    # Process lifecycle
│   ├── scheduler.c          # CPU logic
│   ├── memory_manager.c     # RAM simulation
│   ├── file_system.c        # Virtual disk
│   ├── ipc_manager.c        # Shared memory + mutex
│   ├── simulation.c         # Automated kernel demo
│   └── shell.c              # Root CLI
│
├── include/
│   └── core_structs.h       # Kernel data structures
│
├── bin/
│   └── coredawn
│
└── Makefile

Each file mirrors a real kernel responsibility.


🧬 Kernel Data Structures

Process Control Block (PCB)

typedef struct {
    int pid;
    char name[32];
    ProcessState state;
    int priority;
    int burst_time;
    int remaining_time;
    int memory_offset;
    int memory_size;
} PCB;

This is the identity, memory, and fate of a process.


Memory Block

typedef struct {
    int start_index;
    int size;
    int is_free;
    int pid;
} MemoryBlock;

Every byte knows who owns it — or if it’s waiting.


🤖 Automated Simulation Mode

Run:

simulate

CoreDawn will type commands on its own and demonstrate:

  1. File system creation
  2. Program installation
  3. Process loading & forking
  4. Memory fragmentation
  5. IPC messaging
  6. Scheduler execution

Think of it as:

A cinematic kernel self-test


🛠️ Build & Run

Requirements

  • GCC
  • Linux / Unix
  • POSIX Threads

Compile

make

Run

./bin/coredawn

Clean

make clean

🎯 Why CoreDawn Exists

CoreDawn was built to:

  • Transform OS theory into motion
  • Understand kernel decision-making
  • Practice low-level system design
  • Respect how much happens before main() ever runs

This project is not optimized for shortcuts. It is optimized for clarity, correctness, and control.


🔮 What Comes Next

  • Multi-core scheduler simulation
  • Paging & virtual memory
  • Deadlock detection
  • Persistent disk storage
  • User mode vs Kernel mode separation

🌌 Final Words

CoreDawn is where:

  • Processes are born
  • Memory fragments and heals
  • Schedulers decide fate
  • And machines quietly come alive

Light doesn’t shine from the UI. It shines from the kernel.

About

CoreDawn is a lightweight terminal-driven operating system core simulator built in C for Linux environments. It serves as a conceptual model demonstrating how real operating systems manage processes, memory, communication, and system resources.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages