# bayusetiawan42/appia architecture

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

- Interactive diagram: https://gitdiagram.com/bayusetiawan42/appia
- Repository: https://github.com/bayusetiawan42/appia

## Overview

This is a small bare-metal x86 kernel. Its demonstrated runtime workflow is kernel entry code calling KMain, which clears the VGA text screen and prints text; the console writes video memory and uses port I/O to manage the cursor. The tree also includes boot, disk, GDT, mode-switching, and boot-print assembly modules, but their contents and wiring were not sampled, so their relationships are omitted.

Main entry points: [`drivers/vgaconsole.c`](https://github.com/bayusetiawan42/appia/blob/master/drivers/vgaconsole.c) (VGA Console), [`kernel/kernel.c`](https://github.com/bayusetiawan42/appia/blob/master/kernel/kernel.c) (Kernel Main), [`drivers/ports.c`](https://github.com/bayusetiawan42/appia/blob/master/drivers/ports.c) (Port I/O), [`boot/kernel_entry.asm`](https://github.com/bayusetiawan42/appia/blob/master/boot/kernel_entry.asm) (Kernel Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot Assembly"]
  node_boot_main["Boot<br/>[boot.asm]"]
  node_disk["Disk Access<br/>[disk.asm]"]
  node_gdt["GDT Setup<br/>[gdt.asm]"]
  node_entry["Kernel Entry<br/>[kernel_entry.asm]"]
  node_boot_print["Boot Printing<br/>[print.asm]"]
  node_switch32["32-bit Switch<br/>[switch32.asm]"]
end

subgraph group_kernel["Kernel"]
  node_kmain["Kernel Main<br/>[kernel.c]"]
end

subgraph group_drivers["Hardware Drivers"]
  node_console["VGA Console<br/>[vgaconsole.c]"]
  node_ports["Port I/O<br/>[ports.c]"]
end

node_machine(("Machine"))
node_vga_memory["VGA Text Memory"]
node_io_hardware["I/O Hardware"]

node_entry -->|"enters"| node_kmain
node_kmain -->|"calls"| node_console
node_console -->|"cursor I/O"| node_ports
node_console -->|"writes"| node_vga_memory
node_ports -->|"reads/writes"| node_io_hardware

click node_boot_main "https://github.com/bayusetiawan42/appia/blob/master/boot/boot.asm"
click node_disk "https://github.com/bayusetiawan42/appia/blob/master/boot/disk.asm"
click node_gdt "https://github.com/bayusetiawan42/appia/blob/master/boot/gdt.asm"
click node_entry "https://github.com/bayusetiawan42/appia/blob/master/boot/kernel_entry.asm"
click node_boot_print "https://github.com/bayusetiawan42/appia/blob/master/boot/print.asm"
click node_switch32 "https://github.com/bayusetiawan42/appia/blob/master/boot/switch32.asm"
click node_kmain "https://github.com/bayusetiawan42/appia/blob/master/kernel/kernel.c"
click node_console "https://github.com/bayusetiawan42/appia/blob/master/drivers/vgaconsole.c"
click node_ports "https://github.com/bayusetiawan42/appia/blob/master/drivers/ports.c"

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_boot_main,node_disk,node_gdt,node_entry,node_boot_print,node_switch32 toneBlue
class node_kmain toneAmber
class node_console,node_ports toneMint
class node_machine,node_vga_memory,node_io_hardware toneIndigo
```

## Components

### Boot Assembly

- [Boot](https://github.com/bayusetiawan42/appia/blob/master/boot/boot.asm): `boot/boot.asm`
- [Disk Access](https://github.com/bayusetiawan42/appia/blob/master/boot/disk.asm): `boot/disk.asm`
- [GDT Setup](https://github.com/bayusetiawan42/appia/blob/master/boot/gdt.asm): `boot/gdt.asm`
- [Kernel Entry](https://github.com/bayusetiawan42/appia/blob/master/boot/kernel_entry.asm): `boot/kernel_entry.asm`
- [Boot Printing](https://github.com/bayusetiawan42/appia/blob/master/boot/print.asm): `boot/print.asm`
- [32-bit Switch](https://github.com/bayusetiawan42/appia/blob/master/boot/switch32.asm): `boot/switch32.asm`

### Kernel

- [Kernel Main](https://github.com/bayusetiawan42/appia/blob/master/kernel/kernel.c): `kernel/kernel.c`

### Hardware Drivers

- [VGA Console](https://github.com/bayusetiawan42/appia/blob/master/drivers/vgaconsole.c): `drivers/vgaconsole.c`
- [Port I/O](https://github.com/bayusetiawan42/appia/blob/master/drivers/ports.c): `drivers/ports.c`

### Other components

- **Machine**
- **VGA Text Memory**
- **I/O Hardware**

## Connections

- Kernel Entry → Kernel Main: enters
- Kernel Main → VGA Console: calls
- VGA Console → Port I/O: cursor I/O
- VGA Console → VGA Text Memory: writes
- Port I/O → I/O Hardware: reads/writes
