# minosproject/minos2 architecture

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

- Interactive diagram: https://gitdiagram.com/minosproject/minos2
- Repository: https://github.com/minosproject/minos2

## Overview

Minos2 is an AArch64 microkernel OS. Its principal workflow is booting the kernel and root service, then running user processes that use kernel-managed memory, scheduling, IPC and filesystem services; applications can access an Ext4 root filesystem through the virtio block driver. The tree also contains libc, device-tree handling, a shell and virtualization support. Edges are limited to relationships documented in the README or visible in the supplied excerpts and source index; several subsystem interactions remain unverified.

Main entry points: [`kernel/core/init.c`](https://github.com/minosproject/minos2/blob/main/kernel/core/init.c) (Kernel initialization), [`kernel/userspace/process.c`](https://github.com/minosproject/minos2/blob/main/kernel/userspace/process.c) (Processes and objects), [`user.libc/ldso/dynlink.c`](https://github.com/minosproject/minos2/blob/main/user.libc/ldso/dynlink.c) (Dynamic linker), [`kernel/userspace/root_service.c`](https://github.com/minosproject/minos2/blob/main/kernel/userspace/root_service.c) (Root service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boot["Boot and platform"]
  node_platform["Platform support"]
  node_kernel_init["Kernel initialization<br/>[init.c]"]
  node_root_service["Root service<br/>[root_service.c]"]
  node_device_tree["Device tree handling<br/>[of.c]"]
  node_libfdt_overlay["Tree overlay operations<br/>[fdt_overlay.c]"]
end

subgraph group_kernel["Kernel services"]
  node_scheduler["Task scheduling<br/>[sched.c]"]
  node_memory["Memory management<br/>[page.c]"]
  node_userspace["Processes and objects<br/>[process.c]"]
  node_syscalls["System call boundary<br/>[syscall.c]"]
  node_ipc["IPC and endpoints<br/>[endpoint.c]"]
end

subgraph group_user["User environment"]
  node_libc_linker["Dynamic linker<br/>[dynlink.c]"]
  node_libc_threads["Thread runtime<br/>[pthread_impl.h]"]
  node_libc_core["Libc state<br/>[libc.h]"]
  node_service_api["Service registration<br/>[service.c]"]
  node_shell["Embedded shell<br/>[esh.h]"]
  node_shell_parser["Shell argument parser<br/>[esh_argparser.c]"]
  node_ps["Process viewer<br/>[ps.c]"]
  node_pangu["Process loader<br/>[process.c]"]
end

subgraph group_storage["Storage and devices"]
  node_vfs["Filesystem service<br/>[ext4_server.c]"]
  node_ext4["Ext4 implementation<br/>[ext4.c]"]
  node_virtio_main["Block driver entry<br/>[main.c]"]
  node_virtio_block["Virtio block driver<br/>[virtio-blk.c]"]
  node_virtio_api["Virtio device API<br/>[virtio.h]"]
end

subgraph group_virtualization["Virtualization"]
  node_vm["Virtual machine manager<br/>[vm.c]"]
  node_vmm["Virtual machine monitor<br/>[vmm.c]"]
  node_virtual_io["Virtual devices and IRQs<br/>[vdev.c]"]
end

node_boot_actor(("Bootloader"))

node_boot_actor -->|"boots"| node_kernel_init
node_kernel_init -->|"starts"| node_root_service
node_virtio_main -->|"calls init"| node_virtio_api
node_vfs -.->|"uses"| node_ext4
node_virtio_block -.->|"uses"| node_virtio_api
node_libc_linker -->|"references"| node_libc_threads
node_libc_linker -->|"references"| node_libc_core
node_service_api -->|"uses state"| node_libc_core
node_shell -.->|"parses with"| node_shell_parser
node_root_service -->|"loads"| node_pangu
node_device_tree -.->|"uses library"| node_libfdt_overlay
node_kernel_init -.->|"runs tasks"| node_scheduler
node_kernel_init -.->|"initializes memory"| node_memory
node_userspace -.->|"uses boundary"| node_syscalls
node_userspace -.->|"uses IPC"| node_ipc
node_vm -.->|"managed by"| node_vmm
node_vmm -.->|"dispatches devices"| node_virtual_io

click node_platform "https://github.com/minosproject/minos2/tree/main/kernel/platform"
click node_kernel_init "https://github.com/minosproject/minos2/blob/main/kernel/core/init.c"
click node_root_service "https://github.com/minosproject/minos2/blob/main/kernel/userspace/root_service.c"
click node_scheduler "https://github.com/minosproject/minos2/blob/main/kernel/core/sched.c"
click node_memory "https://github.com/minosproject/minos2/blob/main/kernel/core/page.c"
click node_userspace "https://github.com/minosproject/minos2/blob/main/kernel/userspace/process.c"
click node_syscalls "https://github.com/minosproject/minos2/blob/main/kernel/userspace/syscall.c"
click node_ipc "https://github.com/minosproject/minos2/blob/main/kernel/userspace/endpoint.c"
click node_vfs "https://github.com/minosproject/minos2/blob/main/user.libs/liblwext4/ext4_server.c"
click node_ext4 "https://github.com/minosproject/minos2/blob/main/user.libs/liblwext4/src/ext4.c"
click node_virtio_main "https://github.com/minosproject/minos2/blob/main/user.driver/virtio-blk/main.c"
click node_virtio_block "https://github.com/minosproject/minos2/blob/main/user.driver/virtio-blk/virtio-blk.c"
click node_virtio_api "https://github.com/minosproject/minos2/blob/main/user.driver/virtio-blk/virtio.h"
click node_libc_linker "https://github.com/minosproject/minos2/blob/main/user.libc/ldso/dynlink.c"
click node_libc_threads "https://github.com/minosproject/minos2/blob/main/user.libc/src/internal/pthread_impl.h"
click node_libc_core "https://github.com/minosproject/minos2/blob/main/user.libc/src/internal/libc.h"
click node_service_api "https://github.com/minosproject/minos2/blob/main/user.libc/src/minos/service.c"
click node_shell "https://github.com/minosproject/minos2/blob/main/user.bin/esh/esh.h"
click node_shell_parser "https://github.com/minosproject/minos2/blob/main/user.bin/esh/esh_argparser.c"
click node_ps "https://github.com/minosproject/minos2/blob/main/user.bin/ps/ps.c"
click node_pangu "https://github.com/minosproject/minos2/blob/main/user.sbin/pangu/src/process.c"
click node_device_tree "https://github.com/minosproject/minos2/blob/main/user.sbin/chiyou/of.c"
click node_libfdt_overlay "https://github.com/minosproject/minos2/blob/main/kernel/libs/libfdt/fdt_overlay.c"
click node_vm "https://github.com/minosproject/minos2/blob/main/kernel/virt/vm.c"
click node_vmm "https://github.com/minosproject/minos2/blob/main/kernel/virt/vmm.c"
click node_virtual_io "https://github.com/minosproject/minos2/blob/main/kernel/virt/vdev.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_platform,node_kernel_init,node_root_service,node_device_tree,node_libfdt_overlay toneBlue
class node_scheduler,node_memory,node_userspace,node_syscalls,node_ipc toneAmber
class node_libc_linker,node_libc_threads,node_libc_core,node_service_api,node_shell,node_shell_parser,node_ps,node_pangu toneMint
class node_vfs,node_ext4,node_virtio_main,node_virtio_block,node_virtio_api toneRose
class node_vm,node_vmm,node_virtual_io,node_boot_actor toneIndigo
```

## Components

### Boot and platform

- [Platform support](https://github.com/minosproject/minos2/tree/main/kernel/platform): `kernel/platform`
- [Kernel initialization](https://github.com/minosproject/minos2/blob/main/kernel/core/init.c): `kernel/core/init.c`
- [Root service](https://github.com/minosproject/minos2/blob/main/kernel/userspace/root_service.c): `kernel/userspace/root_service.c`
- [Device tree handling](https://github.com/minosproject/minos2/blob/main/user.sbin/chiyou/of.c): `user.sbin/chiyou/of.c`
- [Tree overlay operations](https://github.com/minosproject/minos2/blob/main/kernel/libs/libfdt/fdt_overlay.c): `kernel/libs/libfdt/fdt_overlay.c`

### Kernel services

- [Task scheduling](https://github.com/minosproject/minos2/blob/main/kernel/core/sched.c): `kernel/core/sched.c`
- [Memory management](https://github.com/minosproject/minos2/blob/main/kernel/core/page.c): `kernel/core/page.c`
- [Processes and objects](https://github.com/minosproject/minos2/blob/main/kernel/userspace/process.c): `kernel/userspace/process.c`
- [System call boundary](https://github.com/minosproject/minos2/blob/main/kernel/userspace/syscall.c): `kernel/userspace/syscall.c`
- [IPC and endpoints](https://github.com/minosproject/minos2/blob/main/kernel/userspace/endpoint.c): `kernel/userspace/endpoint.c`

### User environment

- [Dynamic linker](https://github.com/minosproject/minos2/blob/main/user.libc/ldso/dynlink.c): `user.libc/ldso/dynlink.c`
- [Thread runtime](https://github.com/minosproject/minos2/blob/main/user.libc/src/internal/pthread_impl.h): `user.libc/src/internal/pthread_impl.h`
- [Libc state](https://github.com/minosproject/minos2/blob/main/user.libc/src/internal/libc.h): `user.libc/src/internal/libc.h`
- [Service registration](https://github.com/minosproject/minos2/blob/main/user.libc/src/minos/service.c): `user.libc/src/minos/service.c`
- [Embedded shell](https://github.com/minosproject/minos2/blob/main/user.bin/esh/esh.h): `user.bin/esh/esh.h`
- [Shell argument parser](https://github.com/minosproject/minos2/blob/main/user.bin/esh/esh_argparser.c): `user.bin/esh/esh_argparser.c`
- [Process viewer](https://github.com/minosproject/minos2/blob/main/user.bin/ps/ps.c): `user.bin/ps/ps.c`
- [Process loader](https://github.com/minosproject/minos2/blob/main/user.sbin/pangu/src/process.c): `user.sbin/pangu/src/process.c`

### Storage and devices

- [Filesystem service](https://github.com/minosproject/minos2/blob/main/user.libs/liblwext4/ext4_server.c): `user.libs/liblwext4/ext4_server.c`
- [Ext4 implementation](https://github.com/minosproject/minos2/blob/main/user.libs/liblwext4/src/ext4.c): `user.libs/liblwext4/src/ext4.c`
- [Block driver entry](https://github.com/minosproject/minos2/blob/main/user.driver/virtio-blk/main.c): `user.driver/virtio-blk/main.c`
- [Virtio block driver](https://github.com/minosproject/minos2/blob/main/user.driver/virtio-blk/virtio-blk.c): `user.driver/virtio-blk/virtio-blk.c`
- [Virtio device API](https://github.com/minosproject/minos2/blob/main/user.driver/virtio-blk/virtio.h): `user.driver/virtio-blk/virtio.h`

### Virtualization

- [Virtual machine manager](https://github.com/minosproject/minos2/blob/main/kernel/virt/vm.c): `kernel/virt/vm.c`
- [Virtual machine monitor](https://github.com/minosproject/minos2/blob/main/kernel/virt/vmm.c): `kernel/virt/vmm.c`
- [Virtual devices and IRQs](https://github.com/minosproject/minos2/blob/main/kernel/virt/vdev.c): `kernel/virt/vdev.c`

### Other components

- **Bootloader**

## Connections

- Bootloader → Kernel initialization: boots
- Kernel initialization → Root service: starts
- Block driver entry → Virtio device API: calls init (evidence: `user.driver/virtio-blk/main.c`)
- Filesystem service → Ext4 implementation: uses
- Virtio block driver → Virtio device API: uses
- Dynamic linker → Thread runtime: references (evidence: `user.libc/ldso/dynlink.c`)
- Dynamic linker → Libc state: references (evidence: `user.libc/ldso/dynlink.c`)
- Service registration → Libc state: uses state (evidence: `user.libc/src/minos/service.c`)
- Embedded shell → Shell argument parser: parses with (evidence: `user.bin/esh/esh_argparser.c`)
- Root service → Process loader: loads
- Device tree handling → Tree overlay operations: uses library
- Kernel initialization → Task scheduling: runs tasks
- Kernel initialization → Memory management: initializes memory
- Processes and objects → System call boundary: uses boundary
- Processes and objects → IPC and endpoints: uses IPC
- Virtual machine manager → Virtual machine monitor: managed by
- Virtual machine monitor → Virtual devices and IRQs: dispatches devices
