Architectural Shift: Canonical SystemContext and Bare-Metal Hardening in CheddarOS
With dynamic record lifecycles active in the Tadpole toolchain, we leveraged this capability to eliminate one of the oldest technical debts in the Bullfrogg kernel: unmanaged communication cells in low physical RAM. Previously, early bootstrap and post-heap subsystems passed state through hardcoded memory offsets like `0x01020030` and `0x01020038`. We transitioned the kernel to a unified `SystemContext` record allocated directly on the intrusive kernel heap at Stage 04, establishing explicit ownership over the platform, memory managers, and storage fabric.
The migration revealed several subtle bare-metal invariants that required rigorous isolation. During early bootstrap, an address collision occurred where the scheduler core table (`SCHED_BASE`) and the framebuffer singleton were both mapped to `0x01021600`. Because of this overlap, idle task yields were clobbering display state, while the abort console's `tasks` command misinterpreted the framebuffer pointer as a run-queue head, triggering unhandled page faults. Relocating `SCHED_BASE` to `0x01021200` with dedicated early zeroing cleanly decoupled task tracking from video hardware.
We further hardened the SMP bringup and hardware discovery pipeline. Premature Local APIC queries inside ACPI enumeration were triggering fault loops prior to paging enablement, while AP wake loops stalled due to uncalibrated timer counts. By anchoring LAPIC ID discovery post-mapping and driving calibration off the hardware HPET, all AP cores now reliably advance through the real-mode trampoline to `Probe 0x33`, initialize per-core PAT settings, arm per-CPU `IA32_GS_BASE` blocks, and synchronize cleanly across the multi-core bringup barrier.
Finally, we overhauled the interactive PS/2 and serial abort chord engine. Handlers for toggling between the splash screen and the debug TTY (`Chord D`), pausing log queues, and spawning console diagnostics were decoupled from legacy bootloader cells and re-routed directly through `sysctx_get_root()`. With artificial post-init timing delays pruned, CheddarOS boots smoothly into an SMP-synchronized environment with NVMe block storage and CheddarFS mounted in roughly 1.3 seconds.
Console Log Excerpt
[0.012721] MADT: Local APIC Base: 0x00000000FEE00000
[0.025204] MADT: Total active CPU cores discovered: 0x0000000000000004
[0.983683] SMP: Core 0x0000000000000000: GS_BASE armed at 0x0000000001020600 (LAPIC 0x0000000000000000)
[1.038498] SMP: LAPIC timer: 0x0000000003269780 ticks/10ms periodic vec 0x40
[1.146655] SMP: AP [APIC ID: 0x0000000000000001] Online. Probe 0x0000000000000033
[1.253816] SMP: AP [APIC ID: 0x0000000000000002] Online. Probe 0x0000000000000033
[1.356852] SMP: AP [APIC ID: 0x0000000000000003] Online. Probe 0x0000000000000033
[1.358943] SMP: Total cores synchronized: 0x0000000000000004
[2.171852] CheddarFS: Active Generation [GEN: 0x0000000000000019] Selected from Slot 0x0000000000000000
[2.266552] CheddarFS Mounted Read-Only.
[20.462703] CHORD ESC: entering abort console...
[28.544253] tasks per core:
[28.544746] cpu0x0000000000000000: run=0x0000000000000000 switches=0x0000000000000000 yields=0x0000000000000000 qdepth=0x0000000000000000
[28.546736] cpu0x0000000000000001: run=0x0000000000198200 switches=0x0000000000000000 yields=0x0000000000000AB5 qdepth=0x0000000000000000