# faishal882/uqaabos architecture

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

- Interactive diagram: https://gitdiagram.com/faishal882/uqaabos
- Repository: https://github.com/faishal882/uqaabos

## Overview

##### Project Type and Purpose
- UqaabOS is an operating system kernel project, built in C++ with some x86 assembly for low-level tasks. The project is focused on kernel development with support for multitasking, basic hardware drivers (keyboard, mouse, PCI, storage, VGA), interrupt management, and a basic GUI.

##### Analyzing the File Structure
- Top-Level Files:
- Files like .gitignore, Makefile, and README.md indicate standard project structure and build configuration.
- Linker script (linker.ld) and multiboot assembly file (src/multiboot.asm) suggest boot-time and linking responsibilities.
- Directories:
- src/core: Contains essential kernel components like global descriptor table (gdt.cpp), interrupts (interrupts, interruptstub.asm), and port operations.
- src/drivers: Contains directories for hardware device drivers such as keyboard, mouse, PCI, storage, and VGA.
- src/include: Provides header files for drivers, core functionalities (gdt, interrupts), standard C library, memory management, and multitasking. This separation helps define interfaces and ensures modularity.
- Other directories (src/libc, src/memorymanagement, src/multitasking) further outline specific sub-systems within the kernel.

##### Key Architectural Components
a. Bootloader and ISO Creation:
- ISO directory components, including GRUB configuration (iso/boot/grub/grub.cfg) used to boot UqaabOS.
- Role of bootloader (via GRUB and multiboot.asm) in loading the kernel.
b. Kernel Core:
- Primary kernel initialization sequence beginning in src/kernel.cpp.
- Boot starting point from src/multiboot.asm, which hands control over to the kernel.
- Core system components in src/core (GDT, interrupts, port I/O) which set up the basic execution environment.
c. Device Drivers:
- That these modules communicate with the kernel core and provide foundational support for device management.
d. Subsystems and Services:
- Memory Management: Represent the memory management components (src/memorymanagement/* and relevant headers).
- Multitasking: Capture the multitasking support (components in src/multitasking/ and corresponding headers).
- Standard Library (LibC): Show libc’s role (src/libc and src/include/libc) in providing standard I/O and basic library support.

##### Relationships and Interactions
- BIOS → GRUB bootloader (via ISO configuration) → Kernel Entry (multiboot.asm & kernel.cpp).
- Present the kernel as a central block with connected modules:
- Core sub-system (GDT, Interrupts, Port I/O)
- Memory Management and Multitasking modules.
- Device Drivers interacting with hardware events (keyboard, mouse, PCI, storage, VGA).
- LibC providing supplementary functions to other modules.
- That the submodules within a monolithic kernel call each other directly, so the relationships are tightly coupled.

##### Architectural Patterns and Design Principles
- Monolithic design pattern—that is, a single, unified kernel space that integrates all functionalities.
- Bootstrapping design (from bootloader to kernel initialization) which is essential for any OS.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Boot Process"
        A["Hardware/BIOS"]:::hardware
        B["GRUB Bootloader"]:::boot
        C["Boot Assembly"]:::boot
        D["Kernel Initialization"]:::boot
    end

    subgraph "Kernel"
        E["Kernel Core (Monolithic)"]:::core
        subgraph "Subsystems"
            F["Memory Management"]:::subsystem
            G["Multitasking"]:::subsystem
            H["LibC (Standard Library)"]:::subsystem
        end
        subgraph "Device Drivers"
            I["Drivers"]:::driver
            I1["Keyboard Driver"]:::driver
            I2["Mouse Driver"]:::driver
            I3["PCI Driver"]:::driver
            I4["Storage Driver"]:::driver
            I5["VGA Driver"]:::driver
        end
    end

    subgraph "Development Tools"
        J["Build Tools & ISO Creation"]:::dev
    end

    A -->|"boot"| B
    B -->|"loads"| C
    C -->|"transfersControl"| D
    D -->|"initializes"| E
    E -->|"integrates"| F
    E -->|"integrates"| G
    E -->|"integrates"| H
    E -->|"integrates"| I
    I -->|"contains"| I1
    I -->|"contains"| I2
    I -->|"contains"| I3
    I -->|"contains"| I4
    I -->|"contains"| I5
    J ---|"buildsISO"| B

    %% Click Events
    click B "https://github.com/faishal882/uqaabos/blob/master/iso/boot/grub/grub.cfg"
    click C "https://github.com/faishal882/uqaabos/blob/master/src/multiboot.asm"
    click D "https://github.com/faishal882/uqaabos/blob/master/src/kernel.cpp"
    click E "https://github.com/faishal882/uqaabos/tree/master/src/core"
    click I "https://github.com/faishal882/uqaabos/tree/master/src/drivers"
    click I1 "https://github.com/faishal882/uqaabos/blob/master/src/drivers/keyboard.cpp"
    click I2 "https://github.com/faishal882/uqaabos/blob/master/src/drivers/mouse.cpp"
    click I3 "https://github.com/faishal882/uqaabos/blob/master/src/drivers/pci.cpp"
    click I4 "https://github.com/faishal882/uqaabos/blob/master/src/drivers/storage/ata.cpp"
    click I5 "https://github.com/faishal882/uqaabos/blob/master/src/drivers/vga.cpp"
    click F "https://github.com/faishal882/uqaabos/blob/master/src/memorymanagement/memorymanagement.cpp"
    click F "https://github.com/faishal882/uqaabos/blob/master/src/include/memorymanagement/memorymanagement.h"
    click G "https://github.com/faishal882/uqaabos/blob/master/src/multitasking/multitasking.cpp"
    click G "https://github.com/faishal882/uqaabos/blob/master/src/include/multitasking/multitasking.h"
    click H "https://github.com/faishal882/uqaabos/blob/master/src/libc/stdio.cpp"
    click H "https://github.com/faishal882/uqaabos/blob/master/src/include/libc/stdio.h"

    %% Styles
    classDef hardware fill:#f9e,stroke:#333,stroke-width:2px;
    classDef boot fill:#bbf,stroke:#333,stroke-width:2px;
    classDef core fill:#bfb,stroke:#333,stroke-width:2px;
    classDef subsystem fill:#fbf,stroke:#333,stroke-width:2px;
    classDef driver fill:#ffb,stroke:#333,stroke-width:2px;
    classDef dev fill:#cdf,stroke:#333,stroke-width:2px;
```
