# luci-code-2014/luis architecture

> Architecture diagram of the GitHub repository luci-code-2014/luis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/luci-code-2014/luis
- Repository: https://github.com/luci-code-2014/luis

## Overview

LuiS is a small x86_64 operating system targeting BIOS/Legacy boot from MBR. Its apparent workflow is firmware boot, bootloader stages, kernel entry, then kernel initialization and VGA text output; the README confirms the boot target, but the boot and assembly sources were not sampled, so those transitions are shown as unverified. The sampled kernel initializes the IDT and prints to VGA; the keyboard callback can print translated characters, although IDT and keyboard activation are commented out in the sampled initialization. Connections involving unsampled assembly are therefore omitted or dashed.

Main entry points: [`kernel/kernel.c`](https://github.com/luci-code-2014/luis/blob/main/kernel/kernel.c) (VGA text output), [`boot/stage1.asm`](https://github.com/luci-code-2014/luis/blob/main/boot/stage1.asm) (Stage 1), [`boot/stage2.asm`](https://github.com/luci-code-2014/luis/blob/main/boot/stage2.asm) (Stage 2), [`kernel/entry/kernel_entry.asm`](https://github.com/luci-code-2014/luis/blob/main/kernel/entry/kernel_entry.asm) (Kernel entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot"]
  node_stage1["Stage 1<br/>[stage1.asm]"]
  node_stage2["Stage 2<br/>[stage2.asm]"]
end

subgraph group_kernel["Kernel"]
  node_entry["Kernel entry<br/>[kernel_entry.asm]"]
  node_kernel_main["Kernel main<br/>[kernel.c]"]
  node_idt["IDT setup<br/>[idt.c]"]
  node_interrupts["Interrupt handlers<br/>[interrupts.asm]"]
end

subgraph group_io["Input and Output"]
  node_keyboard["Keyboard input<br/>[idt.c]"]
  node_vga["VGA text output<br/>[kernel.c]"]
end

node_firmware(("BIOS firmware"))

node_firmware -.->|"starts boot"| node_stage1
node_stage1 -.->|"loads stage"| node_stage2
node_stage2 -.->|"loads kernel"| node_entry
node_entry -.->|"enters kernel"| node_kernel_main
node_kernel_main -->|"calls init"| node_idt
node_kernel_main -->|"prints text"| node_vga
node_vga -->|"writes characters"| node_vga
node_keyboard -->|"prints characters"| node_vga

click node_stage1 "https://github.com/luci-code-2014/luis/blob/main/boot/stage1.asm"
click node_stage2 "https://github.com/luci-code-2014/luis/blob/main/boot/stage2.asm"
click node_entry "https://github.com/luci-code-2014/luis/blob/main/kernel/entry/kernel_entry.asm"
click node_kernel_main "https://github.com/luci-code-2014/luis/blob/main/kernel/kernel.c"
click node_idt "https://github.com/luci-code-2014/luis/blob/main/kernel/idt.c"
click node_interrupts "https://github.com/luci-code-2014/luis/blob/main/kernel/arch/interrupts.asm"
click node_keyboard "https://github.com/luci-code-2014/luis/blob/main/kernel/idt.c"
click node_vga "https://github.com/luci-code-2014/luis/blob/main/kernel/kernel.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_stage1,node_stage2 toneBlue
class node_entry,node_kernel_main,node_idt,node_interrupts toneAmber
class node_keyboard,node_vga toneMint
class node_firmware toneIndigo
```

## Components

### Boot

- [Stage 1](https://github.com/luci-code-2014/luis/blob/main/boot/stage1.asm): `boot/stage1.asm`
- [Stage 2](https://github.com/luci-code-2014/luis/blob/main/boot/stage2.asm): `boot/stage2.asm`

### Kernel

- [Kernel entry](https://github.com/luci-code-2014/luis/blob/main/kernel/entry/kernel_entry.asm): `kernel/entry/kernel_entry.asm`
- [Kernel main](https://github.com/luci-code-2014/luis/blob/main/kernel/kernel.c): `kernel/kernel.c`
- [IDT setup](https://github.com/luci-code-2014/luis/blob/main/kernel/idt.c): `kernel/idt.c`
- [Interrupt handlers](https://github.com/luci-code-2014/luis/blob/main/kernel/arch/interrupts.asm): `kernel/arch/interrupts.asm`

### Input and Output

- [Keyboard input](https://github.com/luci-code-2014/luis/blob/main/kernel/idt.c): `kernel/idt.c`
- [VGA text output](https://github.com/luci-code-2014/luis/blob/main/kernel/kernel.c): `kernel/kernel.c`

### Other components

- **BIOS firmware**

## Connections

- BIOS firmware → Stage 1: starts boot
- Stage 1 → Stage 2: loads stage
- Stage 2 → Kernel entry: loads kernel
- Kernel entry → Kernel main: enters kernel
- Kernel main → IDT setup: calls init (evidence: `kernel/kernel.c`)
- Kernel main → VGA text output: prints text (evidence: `kernel/kernel.c`)
- VGA text output → VGA text output: writes characters (evidence: `kernel/kernel.c`)
- Keyboard input → VGA text output: prints characters (evidence: `kernel/idt.c`)
