# leutariker/asmos architecture

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

- Interactive diagram: https://gitdiagram.com/leutariker/asmos
- Repository: https://github.com/leutariker/asmos

## Overview

asmos appears to be a small x86 assembly operating-system project, with boot stages, hardware-related modules, command handling, and low-level interface definitions. The only sampled implementation is `mkboot.py`: it reads a boot sector and payload files, constructs a FAT16 floppy image, and writes the result. The README provides no further capability or runtime-flow details, so connections among the unsampled assembly modules are omitted rather than inferred.

Main entry points: [`mkboot.py`](https://github.com/leutariker/asmos/blob/master/mkboot.py) (FAT16 image builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_system["System modules"]
  node_apic["APIC<br/>[apic.asm]"]
  node_bga["BGA<br/>[bga.asm]"]
  node_cmd["Commands<br/>[cmd.asm]"]
end

subgraph group_interfaces["Low-level interfaces"]
  node_ata["ATA definitions<br/>[ata.inc]"]
  node_crt0["Startup definitions<br/>[crt0.inc]"]
  node_elf64["ELF64 definitions<br/>[elf64.inc]"]
  node_fat16["FAT16 definitions<br/>[fat16.inc]"]
end

subgraph group_image["Image creation"]
  node_mkboot["FAT16 image builder<br/>[mkboot.py]"]
end

node_boot_input["Boot sector and payloads"]
node_disk_image["Floppy image"]

node_boot_input -->|"reads files"| node_mkboot
node_mkboot -->|"writes image"| node_disk_image

click node_stage1 "https://github.com/leutariker/asmos/blob/master/stage1.asm"
click node_stage2 "https://github.com/leutariker/asmos/blob/master/stage2.asm"
click node_stage3 "https://github.com/leutariker/asmos/blob/master/stage3.asm"
click node_apic "https://github.com/leutariker/asmos/blob/master/apic.asm"
click node_bga "https://github.com/leutariker/asmos/blob/master/bga.asm"
click node_cmd "https://github.com/leutariker/asmos/blob/master/cmd.asm"
click node_ata "https://github.com/leutariker/asmos/blob/master/include/ata.inc"
click node_crt0 "https://github.com/leutariker/asmos/blob/master/include/crt0.inc"
click node_elf64 "https://github.com/leutariker/asmos/blob/master/include/elf64.inc"
click node_fat16 "https://github.com/leutariker/asmos/blob/master/include/fat16.inc"
click node_mkboot "https://github.com/leutariker/asmos/blob/master/mkboot.py"

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,node_stage3 toneBlue
class node_apic,node_bga,node_cmd toneAmber
class node_ata,node_crt0,node_elf64,node_fat16 toneMint
class node_mkboot toneRose
class node_boot_input,node_disk_image toneIndigo
```

## Components

### Boot stages

- [Stage 1](https://github.com/leutariker/asmos/blob/master/stage1.asm): `stage1.asm`
- [Stage 2](https://github.com/leutariker/asmos/blob/master/stage2.asm): `stage2.asm`
- [Stage 3](https://github.com/leutariker/asmos/blob/master/stage3.asm): `stage3.asm`

### System modules

- [APIC](https://github.com/leutariker/asmos/blob/master/apic.asm): `apic.asm`
- [BGA](https://github.com/leutariker/asmos/blob/master/bga.asm): `bga.asm`
- [Commands](https://github.com/leutariker/asmos/blob/master/cmd.asm): `cmd.asm`

### Low-level interfaces

- [ATA definitions](https://github.com/leutariker/asmos/blob/master/include/ata.inc): `include/ata.inc`
- [Startup definitions](https://github.com/leutariker/asmos/blob/master/include/crt0.inc): `include/crt0.inc`
- [ELF64 definitions](https://github.com/leutariker/asmos/blob/master/include/elf64.inc): `include/elf64.inc`
- [FAT16 definitions](https://github.com/leutariker/asmos/blob/master/include/fat16.inc): `include/fat16.inc`

### Image creation

- [FAT16 image builder](https://github.com/leutariker/asmos/blob/master/mkboot.py): `mkboot.py`

### Other components

- **Boot sector and payloads**
- **Floppy image**

## Connections

- Boot sector and payloads → FAT16 image builder: reads files (evidence: `mkboot.py`)
- FAT16 image builder → Floppy image: writes image (evidence: `mkboot.py`)
