# pbalduino/menios architecture

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

- Interactive diagram: https://gitdiagram.com/pbalduino/menios
- Repository: https://github.com/pbalduino/menios

## Overview

MeniOS is a hobby x86-64 operating system. Its principal workflow is booting into kernel initialization, launching the user-mode init process, and providing an interactive shell whose commands use OS services to produce results. The graph preserves documented process, filesystem, device, and userland capabilities; it also shows memory management as an internal kernel layer. Several subsystems are represented from README descriptions and tree paths because their implementation excerpts were not supplied, so those links are documented at the capability level rather than inferred from module names.

Main entry points: [`src/kernel/core/main.c`](https://github.com/pbalduino/menios/blob/trunk/src/kernel/core/main.c) (Kernel startup), [`src/kernel/fs/vfs/vfs.c`](https://github.com/pbalduino/menios/blob/trunk/src/kernel/fs/vfs/vfs.c) (Virtual filesystem), [`src/kernel/syscall/syscall.c`](https://github.com/pbalduino/menios/blob/trunk/src/kernel/syscall/syscall.c) (Syscall interface), [`app/mosh/mosh.c`](https://github.com/pbalduino/menios/blob/trunk/app/mosh/mosh.c) (Mosh shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kernel["Kernel and hardware"]
  node_kernel_entry["Kernel startup<br/>[main.c]"]
  node_acpi["ACPI discovery"]
  node_interrupt_timer["Interrupts and timers"]
  node_drivers["Hardware drivers"]
  node_console_fb["Console and framebuffer"]
end

subgraph group_process["Processes and memory"]
  node_scheduler["Scheduler and threads<br/>[kthread.c]"]
  node_processes["Process management<br/>[proc.c]"]
  node_syscalls["Syscall interface<br/>[syscall.c]"]
  node_elf_vm["ELF and virtual memory<br/>[elf_loader.c]"]
  node_kernel_memory["Kernel memory<br/>[kmalloc.c]"]
end

subgraph group_storage["Filesystems and devices"]
  node_vfs["Virtual filesystem<br/>[vfs.c]"]
  node_fat32["FAT32 filesystem<br/>[fat32.c]"]
  node_pseudo_fs["Pseudo filesystems"]
  node_block_io["Block cache and devices<br/>[block_device.c]"]
end

subgraph group_userland["Userland and libc"]
  node_init["User-mode init<br/>[init.c]"]
  node_shell["Mosh shell<br/>[mosh.c]"]
  node_utilities["Shell utilities"]
  node_libc["User libc<br/>[stdlib.c]"]
end

node_bootloader(("Limine boot"))
node_hardware(("x86-64 hardware"))
node_user(("User"))

node_bootloader -.->|"boots"| node_kernel_entry
node_kernel_entry -->|"initializes"| node_acpi
node_kernel_entry -->|"initializes"| node_interrupt_timer
node_kernel_entry -->|"initializes"| node_scheduler
node_kernel_entry -->|"initializes"| node_drivers
node_kernel_entry -->|"launches"| node_init
node_hardware -->|"discovered by"| node_acpi
node_hardware -.->|"accessed by"| node_drivers
node_kernel_entry -->|"initializes"| node_console_fb
node_init -.->|"starts"| node_shell
node_user -->|"interacts with"| node_shell
node_shell -.->|"runs"| node_utilities
node_shell -.->|"uses"| node_syscalls
node_utilities -.->|"uses"| node_libc
node_libc -.->|"invokes"| node_syscalls
node_syscalls -.->|"dispatches"| node_processes
node_processes -.->|"schedules"| node_scheduler
node_processes -.->|"executes via"| node_elf_vm
node_kernel_entry -->|"initializes"| node_vfs
node_vfs -.->|"supports"| node_fat32
node_vfs -.->|"provides"| node_pseudo_fs
node_vfs -.->|"uses"| node_block_io
node_syscalls -.->|"serves file operations"| node_vfs
node_elf_vm -.->|"uses"| node_kernel_memory

click node_kernel_entry "https://github.com/pbalduino/menios/blob/trunk/src/kernel/core/main.c"
click node_acpi "https://github.com/pbalduino/menios/tree/trunk/src/kernel/acpi"
click node_interrupt_timer "https://github.com/pbalduino/menios/tree/trunk/src/kernel/arch/x86_64"
click node_drivers "https://github.com/pbalduino/menios/tree/trunk/src/kernel/drivers"
click node_console_fb "https://github.com/pbalduino/menios/tree/trunk/src/kernel/console"
click node_scheduler "https://github.com/pbalduino/menios/blob/trunk/src/kernel/proc/kthread.c"
click node_processes "https://github.com/pbalduino/menios/blob/trunk/src/kernel/proc/proc.c"
click node_syscalls "https://github.com/pbalduino/menios/blob/trunk/src/kernel/syscall/syscall.c"
click node_elf_vm "https://github.com/pbalduino/menios/blob/trunk/src/kernel/user/elf_loader.c"
click node_kernel_memory "https://github.com/pbalduino/menios/blob/trunk/src/kernel/mem/kmalloc.c"
click node_vfs "https://github.com/pbalduino/menios/blob/trunk/src/kernel/fs/vfs/vfs.c"
click node_fat32 "https://github.com/pbalduino/menios/blob/trunk/src/kernel/fs/fat32/fat32.c"
click node_pseudo_fs "https://github.com/pbalduino/menios/tree/trunk/src/kernel/fs"
click node_block_io "https://github.com/pbalduino/menios/blob/trunk/src/kernel/block/block_device.c"
click node_init "https://github.com/pbalduino/menios/blob/trunk/src/usermode/init.c"
click node_shell "https://github.com/pbalduino/menios/blob/trunk/app/mosh/mosh.c"
click node_utilities "https://github.com/pbalduino/menios/tree/trunk/app"
click node_libc "https://github.com/pbalduino/menios/blob/trunk/user/libc/stdlib.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_kernel_entry,node_acpi,node_interrupt_timer,node_drivers,node_console_fb,node_user toneBlue
class node_scheduler,node_processes,node_syscalls,node_elf_vm,node_kernel_memory toneAmber
class node_vfs,node_fat32,node_pseudo_fs,node_block_io toneMint
class node_init,node_shell,node_utilities,node_libc toneRose
class node_bootloader,node_hardware toneIndigo
```

## Components

### Kernel and hardware

- [Kernel startup](https://github.com/pbalduino/menios/blob/trunk/src/kernel/core/main.c): `src/kernel/core/main.c`
- [ACPI discovery](https://github.com/pbalduino/menios/tree/trunk/src/kernel/acpi): `src/kernel/acpi`
- [Interrupts and timers](https://github.com/pbalduino/menios/tree/trunk/src/kernel/arch/x86_64): `src/kernel/arch/x86_64`
- [Hardware drivers](https://github.com/pbalduino/menios/tree/trunk/src/kernel/drivers): `src/kernel/drivers`
- [Console and framebuffer](https://github.com/pbalduino/menios/tree/trunk/src/kernel/console): `src/kernel/console`

### Processes and memory

- [Scheduler and threads](https://github.com/pbalduino/menios/blob/trunk/src/kernel/proc/kthread.c): `src/kernel/proc/kthread.c`
- [Process management](https://github.com/pbalduino/menios/blob/trunk/src/kernel/proc/proc.c): `src/kernel/proc/proc.c`
- [Syscall interface](https://github.com/pbalduino/menios/blob/trunk/src/kernel/syscall/syscall.c): `src/kernel/syscall/syscall.c`
- [ELF and virtual memory](https://github.com/pbalduino/menios/blob/trunk/src/kernel/user/elf_loader.c): `src/kernel/user/elf_loader.c`
- [Kernel memory](https://github.com/pbalduino/menios/blob/trunk/src/kernel/mem/kmalloc.c): `src/kernel/mem/kmalloc.c`

### Filesystems and devices

- [Virtual filesystem](https://github.com/pbalduino/menios/blob/trunk/src/kernel/fs/vfs/vfs.c): `src/kernel/fs/vfs/vfs.c`
- [FAT32 filesystem](https://github.com/pbalduino/menios/blob/trunk/src/kernel/fs/fat32/fat32.c): `src/kernel/fs/fat32/fat32.c`
- [Pseudo filesystems](https://github.com/pbalduino/menios/tree/trunk/src/kernel/fs): `src/kernel/fs`
- [Block cache and devices](https://github.com/pbalduino/menios/blob/trunk/src/kernel/block/block_device.c): `src/kernel/block/block_device.c`

### Userland and libc

- [User-mode init](https://github.com/pbalduino/menios/blob/trunk/src/usermode/init.c): `src/usermode/init.c`
- [Mosh shell](https://github.com/pbalduino/menios/blob/trunk/app/mosh/mosh.c): `app/mosh/mosh.c`
- [Shell utilities](https://github.com/pbalduino/menios/tree/trunk/app): `app`
- [User libc](https://github.com/pbalduino/menios/blob/trunk/user/libc/stdlib.c): `user/libc/stdlib.c`

### Other components

- **Limine boot**
- **x86-64 hardware**
- **User**

## Connections

- Limine boot → Kernel startup: boots (evidence: `README.md`)
- Kernel startup → ACPI discovery: initializes (evidence: `src/kernel/core/main.c`)
- Kernel startup → Interrupts and timers: initializes (evidence: `src/kernel/core/main.c`)
- Kernel startup → Scheduler and threads: initializes (evidence: `src/kernel/core/main.c`)
- Kernel startup → Hardware drivers: initializes (evidence: `src/kernel/core/main.c`)
- Kernel startup → User-mode init: launches (evidence: `src/kernel/core/main.c`)
- x86-64 hardware → ACPI discovery: discovered by (evidence: `README.md`)
- x86-64 hardware → Hardware drivers: accessed by
- Kernel startup → Console and framebuffer: initializes (evidence: `src/kernel/core/main.c`)
- User-mode init → Mosh shell: starts (evidence: `README.md`)
- User → Mosh shell: interacts with (evidence: `README.md`)
- Mosh shell → Shell utilities: runs (evidence: `README.md`)
- Mosh shell → Syscall interface: uses (evidence: `README.md`)
- Shell utilities → User libc: uses (evidence: `README.md`)
- User libc → Syscall interface: invokes (evidence: `README.md`)
- Syscall interface → Process management: dispatches (evidence: `README.md`)
- Process management → Scheduler and threads: schedules (evidence: `README.md`)
- Process management → ELF and virtual memory: executes via (evidence: `README.md`)
- Kernel startup → Virtual filesystem: initializes (evidence: `src/kernel/core/main.c`)
- Virtual filesystem → FAT32 filesystem: supports (evidence: `README.md`)
- Virtual filesystem → Pseudo filesystems: provides (evidence: `README.md`)
- Virtual filesystem → Block cache and devices: uses
- Syscall interface → Virtual filesystem: serves file operations (evidence: `README.md`)
- ELF and virtual memory → Kernel memory: uses
