# sfluorine/halogen architecture

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

- Interactive diagram: https://gitdiagram.com/sfluorine/halogen
- Repository: https://github.com/sfluorine/halogen

## Overview

Halogen is an early, minimal operating-system kernel. Its sampled runtime entry point initializes the text terminal, then prints repeated decimal values and newlines. The terminal manages cursor position, colors, and scrolling; VGA encoding turns characters and colors into display cells, which the terminal writes to the VGA text buffer. The README gives no further product capabilities, and boot assembly was not sampled, so boot-time wiring is left out.

Main entry points: [`kernel/tty.c`](https://github.com/sfluorine/halogen/blob/master/kernel/tty.c) (Terminal), [`kernel/kernel.c`](https://github.com/sfluorine/halogen/blob/master/kernel/kernel.c) (Kernel entry), [`kernel/vga.c`](https://github.com/sfluorine/halogen/blob/master/kernel/vga.c) (VGA encoding), [`kernel/vga.h`](https://github.com/sfluorine/halogen/blob/master/kernel/vga.h) (VGA text buffer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kernel["Kernel runtime"]
  node_runtime["Kernel entry<br/>[kernel.c]"]
end

subgraph group_display["Text display"]
  node_terminal["Terminal<br/>[tty.c]"]
  node_encoding["VGA encoding<br/>[vga.c]"]
  node_buffer[("VGA text buffer<br/>[vga.h]")]
end

node_runtime -->|"initializes and writes"| node_terminal
node_terminal -->|"encodes cells"| node_encoding
node_terminal -->|"writes display cells"| node_buffer

click node_runtime "https://github.com/sfluorine/halogen/blob/master/kernel/kernel.c"
click node_terminal "https://github.com/sfluorine/halogen/blob/master/kernel/tty.c"
click node_encoding "https://github.com/sfluorine/halogen/blob/master/kernel/vga.c"
click node_buffer "https://github.com/sfluorine/halogen/blob/master/kernel/vga.h"

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_runtime toneBlue
class node_terminal,node_encoding,node_buffer toneAmber
```

## Components

### Kernel runtime

- [Kernel entry](https://github.com/sfluorine/halogen/blob/master/kernel/kernel.c): `kernel/kernel.c`

### Text display

- [Terminal](https://github.com/sfluorine/halogen/blob/master/kernel/tty.c): `kernel/tty.c`
- [VGA encoding](https://github.com/sfluorine/halogen/blob/master/kernel/vga.c): `kernel/vga.c`
- [VGA text buffer](https://github.com/sfluorine/halogen/blob/master/kernel/vga.h): `kernel/vga.h`

## Connections

- Kernel entry → Terminal: initializes and writes
- Terminal → VGA encoding: encodes cells
- Terminal → VGA text buffer: writes display cells
