# Universalisos Kernel — Stage 1 Bare-Metal Skeleton (C++) This is the first bootable type-1 hypervisor milestone for Universalisos: a minimal bare-metal kernel written in **C++** that runs on QEMU's ARM `virt` machine and prints to the PL011 UART. ## Building Requires `arm-none-eabi-gcc` and `qemu-system-arm`. ```bash cd kernel make ``` Outputs: - `kernel.elf` — ELF image for debugging - `kernel.bin` — raw binary for QEMU `-kernel` ## Running in QEMU ```bash make run ``` This runs `qemu-system-arm` with the ELF image so that QEMU loads the kernel at the address specified in the linker script. Expected output: ``` Universalisos type-1 hypervisor booted. Stage 1: bare-metal C++ skeleton running on QEMU ARM virt. ``` Press `Ctrl+A` then `X` to exit QEMU. ## Inspecting the binary ```bash make dump ``` ## Layout | File | Purpose | |------|---------| | `arch/arm/boot.S` | Assembly entry point, stack/BSS setup | | `arch/arm/linker.ld` | Memory layout for QEMU virt (load at 0x40000000) | | `arch/arm/uart.cpp` | PL011 UART driver | | `arch/arm/uart.h` | UART interface | | `kernel.cpp` | `kernel_main()` entry point | ## Design notes - The kernel is loaded by QEMU at RAM base `0x40000000`. - A 64 KiB stack is reserved immediately after the BSS section. - Interrupts are disabled in the boot stub; the kernel idles with `wfi`.