# ankeshshri/project-os architecture

> Architecture diagram of the GitHub repository ankeshshri/project-os, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ankeshshri/project-os
- Repository: https://github.com/ankeshshri/project-os

## Overview

##### Project type and purpose
- From the file tree and README title “project-os,” this is a minimal operating-system (kernel) project written in C.
- Key files:
- code.c – most likely contains the kernel’s entry point and core routines
- “code with tables” – presumably defines OS tables (GDT/IDT or page tables)
- .vscode – IDE configuration (not part of runtime)

##### File structure
- There is no frontend/backend split or microservice boundary. Instead, this is a single C-code codebase that implements an OS kernel.
- The presence of a file with “tables” suggests low-level data structures for memory management and interrupt handling.
- No build scripts are shown, but we can assume a Makefile or build process compiles code.c and the tables file into a flat binary or ELF.

##### README for additional insights
- The README only names the project. We have no explicit architecture notes, so we infer a classic monolithic kernel design.

##### Key advice
- Layer boundaries (hardware vs kernel vs user land)
- Keep it high-level enough to see the full picture, but detailed enough to illustrate module responsibilities

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Hardware Layer
    subgraph "Hardware Layer"
        direction TB
        CPU["CPU"]:::hardware
        RAM["RAM"]:::hardware
        PIC["PIC/APIC"]:::hardware
        DISK["Disk/Peripherals"]:::hardware
    end

    %% Bootloader
    BOOT["Bootloader (BIOS/UEFI Stage)"]:::bootloader

    %% Kernel Layer
    subgraph "Kernel"
        direction TB
        ENTRY["Kernel Entry Point"]:::kernel
        MM["Memory Manager & Tables"]:::kernel
        INT["Interrupt & Exception Handler"]:::kernel
        SCHED["Scheduler & Task Management"]:::kernel
        DRV["Device Drivers"]:::kernel
        SYSCALL["System Call Interface"]:::kernel
    end

    %% User Land
    USER["Userland (Shell/Programs)"]:::user

    %% IDE Configuration and Documentation
    subgraph "Project Support"
        direction TB
        IDE[".vscode (IDE Config)"]:::docs
        DOC["README.md (Project Overview)"]:::docs
    end

    %% Connections
    CPU --> BOOT
    RAM --> BOOT
    BOOT -->|"loads kernel"| ENTRY
    ENTRY -->|"sets up GDT/IDT"| MM
    MM -->|"initializes paging"| ENTRY
    MM --> INT
    PIC -->|"hardware interrupt"| INT
    INT --> DRV
    DRV --> SCHED
    SCHED -->|"context switch"| ENTRY
    USER -->|"syscall"| SYSCALL
    SYSCALL --> ENTRY

    %% Side connections
    IDE --- DOC

    %% Click Events
    click ENTRY "https://github.com/ankeshshri/project-os/blob/main/code.c"
    click MM "https://github.com/ankeshshri/project-os/tree/main/code with tables"
    click IDE "https://github.com/ankeshshri/project-os/blob/main/.vscode"
    click DOC "https://github.com/ankeshshri/project-os/blob/main/README.md"

    %% Styles
    classDef hardware fill:#B0BEC5,stroke:#455A64,color:#263238;
    classDef bootloader fill:#FFF59D,stroke:#F9A825,color:#212121;
    classDef kernel fill:#90CAF9,stroke:#1565C0,color:#0D47A1;
    classDef user fill:#A5D6A7,stroke:#2E7D32,color:#1B5E20;
    classDef docs fill:#E0E0E0,stroke:#9E9E9E,color:#424242;
```
