2026-06-17 12:16:09 -04:00
|
|
|
# ForgeOS ARM64 Architecture
|
2026-06-16 14:07:52 -04:00
|
|
|
|
|
|
|
|
## Goal
|
|
|
|
|
|
2026-06-17 12:55:11 -04:00
|
|
|
ForgeOS ARM64 targets 64-bit ARM systems with UEFI firmware. The target image
|
|
|
|
|
boots systemd as PID 1 and uses Nix as the core package manager.
|
2026-06-16 14:07:52 -04:00
|
|
|
|
2026-06-17 12:55:11 -04:00
|
|
|
The current stack is:
|
|
|
|
|
|
|
|
|
|
- Linux kernel source from kernel.org
|
|
|
|
|
- systemd source from the upstream systemd project
|
|
|
|
|
- BusyBox source from busybox.net for static rescue and early-boot tools
|
|
|
|
|
- official Nix `aarch64-linux` binary tarball for the Nix store bootstrap
|
|
|
|
|
- ForgeOS shell scripts, identity files, unit files, boot configuration, and
|
|
|
|
|
image layout from this repository
|
2026-06-16 14:07:52 -04:00
|
|
|
|
|
|
|
|
## Boot Model
|
|
|
|
|
|
|
|
|
|
1. The disk image contains a GPT.
|
|
|
|
|
2. Partition 1 is a FAT32 EFI System Partition labeled `FORGE_EFI`.
|
2026-06-17 12:16:09 -04:00
|
|
|
3. `out/BOOTAA64.EFI` is a standalone GRUB UEFI fallback loader built for
|
|
|
|
|
`arm64-efi`.
|
|
|
|
|
4. The ARM64 Linux `Image` with EFI stub support is copied to
|
|
|
|
|
`EFI/BOOT/FORGEOS.EFI`.
|
|
|
|
|
5. UEFI firmware executes GRUB from `EFI/BOOT/BOOTAA64.EFI`.
|
|
|
|
|
6. GRUB starts the kernel with `root=PARTLABEL=root`.
|
2026-06-17 12:55:11 -04:00
|
|
|
7. The kernel mounts the ext4 root partition and executes `/sbin/init`.
|
|
|
|
|
8. `/sbin/init` points to `/usr/lib/systemd/systemd`.
|
|
|
|
|
9. systemd reaches `multi-user.target`, starts console login units, networkd,
|
|
|
|
|
resolved, timesyncd, the Nix bootstrap service, and nix-daemon.
|
|
|
|
|
|
|
|
|
|
The image also includes `rootfs.cpio.gz` on the EFI partition. The GRUB
|
|
|
|
|
initramfs entries can use `/init` and `/sbin/forgeos-switch-root` to locate and
|
|
|
|
|
switch to the real ext4 root partition before executing systemd.
|
2026-06-16 14:07:52 -04:00
|
|
|
|
|
|
|
|
## Root Filesystem Model
|
|
|
|
|
|
2026-06-17 12:16:09 -04:00
|
|
|
The default rootfs is assembled in `staging/rootfs` from:
|
2026-06-16 14:07:52 -04:00
|
|
|
|
2026-06-17 12:55:11 -04:00
|
|
|
- a systemd `DESTDIR` install tree
|
|
|
|
|
- a statically linked ARM64 BusyBox utility tree
|
|
|
|
|
- generated `/etc/passwd`, `/etc/shadow`, `/etc/group`, `/etc/fstab`,
|
|
|
|
|
`/etc/systemd/*`, network, hostname, profile, and OS identity files
|
|
|
|
|
- ForgeOS helper scripts from `overlay/rootfs`
|
|
|
|
|
- the official Nix ARM64 store closure plus registration metadata
|
2026-06-17 12:16:09 -04:00
|
|
|
- kernel modules from the ARM64 kernel build
|
2026-06-17 12:55:11 -04:00
|
|
|
- the ARM64 kernel image copied to `/boot`
|
2026-06-16 14:07:52 -04:00
|
|
|
|
2026-06-17 12:55:11 -04:00
|
|
|
systemd units are enabled by creating `.wants` symlinks in
|
|
|
|
|
`/etc/systemd/system`, matching systemd's normal enablement model. Nix follows a
|
|
|
|
|
multi-user daemon layout: `nixbld` users are generated in `/etc/passwd`,
|
|
|
|
|
`/etc/nix/nix.conf` declares `build-users-group = nixbld`, and
|
|
|
|
|
`nix-daemon.socket`/`nix-daemon.service` are enabled under systemd.
|
2026-06-16 14:07:52 -04:00
|
|
|
|
2026-06-17 12:16:09 -04:00
|
|
|
## QEMU Model
|
2026-06-16 14:07:52 -04:00
|
|
|
|
2026-06-17 12:16:09 -04:00
|
|
|
The run scripts use `qemu-system-aarch64` with:
|
2026-06-16 14:07:52 -04:00
|
|
|
|
2026-06-17 12:16:09 -04:00
|
|
|
- `-machine virt`
|
|
|
|
|
- `-cpu max`
|
|
|
|
|
- PL011 serial console through `ttyAMA0`
|
|
|
|
|
- AAVMF firmware for UEFI image boots
|
2026-06-17 12:55:11 -04:00
|
|
|
- virtio block, network, and rng devices
|
2026-06-16 14:07:52 -04:00
|
|
|
|
|
|
|
|
## Known Gaps
|
|
|
|
|
|
2026-06-17 12:55:11 -04:00
|
|
|
- The Nix payload is currently the official binary tarball rather than a
|
|
|
|
|
source-built Nix closure.
|
|
|
|
|
- The systemd build depends on an ARM64 sysroot for target development and
|
|
|
|
|
runtime libraries.
|
|
|
|
|
- No desktop environment or graphical login.
|
|
|
|
|
- No board-specific kernel profiles beyond QEMU `virt`.
|
|
|
|
|
- No Microsoft/shim-signed Secure Boot chain.
|
|
|
|
|
- No in-OS guided installer or update system.
|
2026-06-16 14:07:52 -04:00
|
|
|
|
|
|
|
|
## Suggested Next Steps
|
|
|
|
|
|
2026-06-17 12:55:11 -04:00
|
|
|
1. Add a first-class ARM64 sysroot recipe for systemd dependencies.
|
|
|
|
|
2. Add a source-built Nix recipe or a reproducible closure generator.
|
|
|
|
|
3. Add hardware profiles for common ARM64 laptops, SBCs, and servers.
|
|
|
|
|
4. Add CI that builds `make kernel`, `make rootfs`, and `make image` on an
|
2026-06-17 12:16:09 -04:00
|
|
|
x86_64 host with the AArch64 cross toolchain.
|