# ivseznayfews/ivseznayfews-os architecture

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

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

## Overview

Ivseznayfews is a hobby x86 operating system with a current 64-bit kernel and an earlier 32-bit version. Its user-facing workflow is boot into a kernel, initialize hardware and interrupt handling, accept keyboard input in an interactive shell, execute commands, and display results. The 64-bit version also documents physical-page allocation, a kernel heap, and round-robin task switching. README capabilities are included where source excerpts were unavailable; those subsystem links are limited to documented behavior rather than inferred call chains.

Main entry points: [`64bit/kernel/kmain.cpp`](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/kmain.cpp) (64-bit startup), [`32bit/kernel/kmain.cpp`](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/kmain.cpp) (32-bit startup), [`64bit/kernel/isr.cpp`](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/isr.cpp) (Exceptions and IRQs), [`32bit/kernel/isr.cpp`](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/isr.cpp) (Exceptions and IRQs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Kernel startup"]
  node_kmain64["64-bit startup<br/>[kmain.cpp]"]
  node_multiboot64["Boot information<br/>[multiboot.cpp]"]
  node_gdt64["GDT<br/>[gdt.cpp]"]
  node_idt64["IDT and dispatch<br/>[idt.cpp]"]
  node_isr64["Exceptions and IRQs<br/>[isr.cpp]"]
  node_pic64["PIC<br/>[pic.cpp]"]
  node_kmain32["32-bit startup<br/>[kmain.cpp]"]
  node_gdt32["GDT<br/>[gdt.cpp]"]
  node_idt32["IDT and dispatch<br/>[idt.cpp]"]
  node_isr32["Exceptions and IRQs<br/>[isr.cpp]"]
  node_pic32["PIC<br/>[pic.cpp]"]
end

subgraph group_io["Input and output"]
  node_keyboard64["Keyboard driver<br/>[keyboard.cpp]"]
  node_shell64["Interactive shell<br/>[shell.cpp]"]
  node_vga64["VGA console<br/>[vga.cpp]"]
  node_serial64["Serial output<br/>[serial.cpp]"]
end

subgraph group_core64["64-bit kernel"]
  node_pit64["PIT timer<br/>[pit.cpp]"]
  node_pmm64["Physical allocator<br/>[pmm.cpp]"]
  node_heap64["Kernel heap<br/>[heap.cpp]"]
  node_task64["Task scheduler<br/>[task.cpp]"]
end

subgraph group_legacy32["32-bit kernel"]
  node_keyboard32["Keyboard driver<br/>[keyboard.cpp]"]
  node_shell32["Interactive shell<br/>[shell.cpp]"]
  node_vga32["VGA console<br/>[vga.cpp]"]
  node_serial32["Serial output<br/>[serial.cpp]"]
end

node_grub(("GRUB / Multiboot"))
node_grub32(("GRUB / Multiboot"))

node_grub -->|"boots"| node_kmain64
node_kmain64 -->|"reads boot data"| node_multiboot64
node_kmain64 -->|"initializes"| node_gdt64
node_kmain64 -->|"initializes"| node_idt64
node_kmain64 -->|"initializes"| node_pic64
node_kmain64 -->|"initializes"| node_keyboard64
node_kmain64 -->|"initializes"| node_pit64
node_kmain64 -->|"initializes"| node_pmm64
node_kmain64 -->|"initializes"| node_heap64
node_kmain64 -->|"initializes"| node_task64
node_kmain64 -->|"starts"| node_shell64
node_idt64 -->|"dispatches"| node_isr64
node_keyboard64 -->|"sends keys"| node_shell64
node_shell64 -->|"prints output"| node_vga64
node_isr64 -->|"reports exceptions"| node_vga64
node_isr64 -->|"reports exceptions"| node_serial64
node_heap64 -->|"allocates pages"| node_pmm64
node_vga64 -->|"locks output"| node_task64
node_grub32 -->|"boots"| node_kmain32
node_kmain32 -->|"initializes"| node_gdt32
node_kmain32 -->|"initializes"| node_idt32
node_kmain32 -->|"initializes"| node_pic32
node_kmain32 -->|"initializes"| node_keyboard32
node_kmain32 -->|"starts"| node_shell32
node_idt32 -->|"dispatches"| node_isr32
node_keyboard32 -->|"sends keys"| node_shell32
node_shell32 -->|"prints output"| node_vga32
node_isr32 -->|"reports exceptions"| node_vga32
node_isr32 -->|"reports exceptions"| node_serial32

click node_kmain64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/kmain.cpp"
click node_multiboot64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/multiboot.cpp"
click node_gdt64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/gdt.cpp"
click node_idt64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/idt.cpp"
click node_isr64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/isr.cpp"
click node_pic64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/pic.cpp"
click node_keyboard64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/keyboard.cpp"
click node_shell64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/shell.cpp"
click node_vga64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/vga.cpp"
click node_serial64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/serial.cpp"
click node_pit64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/pit.cpp"
click node_pmm64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/pmm.cpp"
click node_heap64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/heap.cpp"
click node_task64 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/task.cpp"
click node_kmain32 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/kmain.cpp"
click node_gdt32 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/gdt.cpp"
click node_idt32 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/idt.cpp"
click node_isr32 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/isr.cpp"
click node_pic32 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/pic.cpp"
click node_keyboard32 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/keyboard.cpp"
click node_shell32 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/shell.cpp"
click node_vga32 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/vga.cpp"
click node_serial32 "https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/serial.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_kmain64,node_multiboot64,node_gdt64,node_idt64,node_isr64,node_pic64,node_kmain32,node_gdt32,node_idt32,node_isr32,node_pic32 toneBlue
class node_keyboard64,node_shell64,node_vga64,node_serial64 toneAmber
class node_pit64,node_pmm64,node_heap64,node_task64 toneMint
class node_keyboard32,node_shell32,node_vga32,node_serial32 toneRose
class node_grub,node_grub32 toneIndigo
```

## Components

### Kernel startup

- [64-bit startup](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/kmain.cpp): `64bit/kernel/kmain.cpp`
- [Boot information](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/multiboot.cpp): `64bit/kernel/multiboot.cpp`
- [GDT](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/gdt.cpp): `64bit/kernel/gdt.cpp`
- [IDT and dispatch](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/idt.cpp): `64bit/kernel/idt.cpp`
- [Exceptions and IRQs](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/isr.cpp): `64bit/kernel/isr.cpp`
- [PIC](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/pic.cpp): `64bit/kernel/pic.cpp`
- [32-bit startup](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/kmain.cpp): `32bit/kernel/kmain.cpp`
- [GDT](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/gdt.cpp): `32bit/kernel/gdt.cpp`
- [IDT and dispatch](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/idt.cpp): `32bit/kernel/idt.cpp`
- [Exceptions and IRQs](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/isr.cpp): `32bit/kernel/isr.cpp`
- [PIC](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/pic.cpp): `32bit/kernel/pic.cpp`

### Input and output

- [Keyboard driver](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/keyboard.cpp): `64bit/kernel/keyboard.cpp`
- [Interactive shell](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/shell.cpp): `64bit/kernel/shell.cpp`
- [VGA console](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/vga.cpp): `64bit/kernel/vga.cpp`
- [Serial output](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/serial.cpp): `64bit/kernel/serial.cpp`

### 64-bit kernel

- [PIT timer](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/pit.cpp): `64bit/kernel/pit.cpp`
- [Physical allocator](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/pmm.cpp): `64bit/kernel/pmm.cpp`
- [Kernel heap](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/heap.cpp): `64bit/kernel/heap.cpp`
- [Task scheduler](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/64bit/kernel/task.cpp): `64bit/kernel/task.cpp`

### 32-bit kernel

- [Keyboard driver](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/keyboard.cpp): `32bit/kernel/keyboard.cpp`
- [Interactive shell](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/shell.cpp): `32bit/kernel/shell.cpp`
- [VGA console](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/vga.cpp): `32bit/kernel/vga.cpp`
- [Serial output](https://github.com/ivseznayfews/ivseznayfews-os/blob/main/32bit/kernel/serial.cpp): `32bit/kernel/serial.cpp`

### Other components

- **GRUB / Multiboot**
- **GRUB / Multiboot**

## Connections

- GRUB / Multiboot → 64-bit startup: boots
- 64-bit startup → Boot information: reads boot data
- 64-bit startup → GDT: initializes
- 64-bit startup → IDT and dispatch: initializes
- 64-bit startup → PIC: initializes
- 64-bit startup → Keyboard driver: initializes
- 64-bit startup → PIT timer: initializes
- 64-bit startup → Physical allocator: initializes
- 64-bit startup → Kernel heap: initializes
- 64-bit startup → Task scheduler: initializes
- 64-bit startup → Interactive shell: starts
- IDT and dispatch → Exceptions and IRQs: dispatches
- Keyboard driver → Interactive shell: sends keys
- Interactive shell → VGA console: prints output
- Exceptions and IRQs → VGA console: reports exceptions
- Exceptions and IRQs → Serial output: reports exceptions
- Kernel heap → Physical allocator: allocates pages
- VGA console → Task scheduler: locks output
- GRUB / Multiboot → 32-bit startup: boots
- 32-bit startup → GDT: initializes
- 32-bit startup → IDT and dispatch: initializes
- 32-bit startup → PIC: initializes
- 32-bit startup → Keyboard driver: initializes
- 32-bit startup → Interactive shell: starts
- IDT and dispatch → Exceptions and IRQs: dispatches
- Keyboard driver → Interactive shell: sends keys
- Interactive shell → VGA console: prints output
- Exceptions and IRQs → VGA console: reports exceptions
- Exceptions and IRQs → Serial output: reports exceptions
