Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[![Build & Test](https://github.com/kernelite/milo/actions/workflows/ci.yml/badge.svg)](https://github.com/kernelite/milo/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/kernelite/milo/badge.svg?branch=main)](https://coveralls.io/github/kernelite/milo?branch=main)
[![Qlty Coverage](https://qlty.sh/gh/kernelite/projects/milo/coverage.svg)](https://qlty.sh/gh/kernelite/projects/milo)
[![Documentation](https://img.shields.io/badge/Docs-GitHub%20Pages-222222?style=flat-square&logo=githubpages&logoColor=white)](https://kernelite.github.io/milo/)
[![C++ Standard](https://img.shields.io/badge/C%2B%2B-20-00599C?style=flat-square&logo=cplusplus&logoColor=white)](https://en.cppreference.com/w/cpp/20)
[![Architecture](https://img.shields.io/badge/Arch-AArch64%20%2F%20Arm64-0091BD?style=flat-square&logo=arm&logoColor=white)](https://developer.arm.com/documentation/102374/latest/)
[![Target Platform](https://img.shields.io/badge/Target-QEMU%20virt%20(Cortex--A53)-FF6600?style=flat-square&logo=qemu&logoColor=white)](https://www.qemu.org/docs/master/system/arm/virt.html)
Expand Down
41 changes: 41 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
SPDX-License-Identifier: GPL-3.0-only
Copyright (c) 2026 Marco Buschini <marco.buschini@gmail.com>
-->

# 🛡️ Milo Documentation

**Milo** is a freestanding C++20 microkernel built for **AArch64** (`cortex-a53` / `cortex-a57`) on QEMU `virt`, pairing an architecture-agnostic Hardware Abstraction Layer (`kernel/hal/`) with a Linux AArch64 (`LP64`) syscall/ABI compatibility layer. It executes hardware-independent kernel subsystems natively on the host under `snitch` with ASan/UBSan and coverage instrumentation while also booting full `EL0` user-space binaries and shells on QEMU.

* **Source Repository:** [github.com/kernelite/milo](https://github.com/kernelite/milo)
* **License:** [GNU General Public License v3.0 (GPL-3.0)](https://github.com/kernelite/milo/blob/main/LICENSE)

## Architecture & Engineering Guides

| Guide | Topics Covered |
| :--- | :--- |
| [01 — Architecture Overview](01-architecture-overview.md) | Microkernel privilege boundaries (`EL1` vs. `EL0`), TCB scope, system block diagram, and directory-to-subsystem mapping. |
| [02 — Boot and Initialization](02-boot-and-initialization.md) | Step-by-step AArch64 boot flow, `kmain` bring-up sequence, initial `EL0` user-space execution, and boot sequence diagram. |
| [03 — Memory Management](03-memory-management.md) | Physical/virtual address ranges, `PageFrameAllocator`, `KernelHeap` slab/compound allocator, and `AddressSpace` paging, CoW, and `PageCache`. |
| [04 — Tasks and Scheduling](04-tasks-and-scheduling.md) | `Process` states, `Runqueue` and `WaitQueue` mechanics, preemptive timer scheduling, and `EL1`/`EL0` context switching. |
| [05 — IPC and Syscalls](05-ipc-and-syscalls.md) | AArch64 `svc #0` ABI, full syscall reference table (84 syscalls), `Pipe` ring buffers, and `AF_UNIX` stream/datagram sockets. |
| [06 — Hardware and Interrupts](06-hardware-and-interrupts.md) | Exception vectors, GICv2 interrupt routing, ARM Generic Timer, PL011 UART, `fw_cfg`/`ramfb`, and VirtIO-MMIO drivers. |
| [07 — Contributing and Debugging](07-contributing-and-debugging.md) | QEMU + GDB debugging workflow, panic/fault diagnostics, commit/license rules, and checklists for adding syscalls, drivers, or host tests. |
| [08 — Testing and CI](08-testing-and-ci.md) | Host `snitch` ASan/UBSan test harness, `gcovr` coverage, quality gates, on-target `milo>` tests, and GitHub Actions CI workflows. |
| [09 — Engineering Patterns & Best Practices](09-design-patterns-and-best-practices.md) | Freestanding C++20 patterns, RAII/Rule of Five, HAL & DDK isolation, dual-target testing, forensic logging, and quality gates. |

## Reference & Architecture Decision Records

* [Milo Features, Repository Layout & Build Reference](reference.md) — Detailed feature summary, repository directory layout, toolchain/host prerequisites, build/shell commands, and roadmap.
* [ADR 0001: Host & Freestanding C++20 Unit Testing Framework (`snitch`)](adr/0001-unit-testing-framework.md) — Architectural decision record for the `snitch` host test runner, HAL mocks, and QEMU test coexistence.

## Quick Start

```bash
make -j"$(nproc)" all # Build build/kernel.elf, build/kernel.bin, and initrds/busybox.cpio
make -j"$(nproc)" test-host # Run ASan/UBSan snitch host tests and gcovr reports
make -j"$(nproc)" quality # Run format-check, license-check, lint-report, and test-host
make run # Build disk.img if needed and boot kernel.bin on QEMU virt (Ctrl+A then X to exit)
```

For full toolchain prerequisites, QEMU/GDB debugging workflows, and contribution rules, see [07 — Contributing and Debugging](07-contributing-and-debugging.md) and the [Build Reference](reference.md).
Loading