← Back to CheddarOS Overview

Kernel Development Journal

Engineering milestones, raw COM1 telemetry, and bare-metal breakthroughs from Project Bullfrogg.

• Project Bullfrogg Update

Architectural Shift: Canonical SystemContext and Bare-Metal Hardening in CheddarOS

CheddarOS Bullfrogg Kernel Architecture SystemContext SMP Tadpole NVMe Bare-Metal

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
• Project Bullfrogg Update

Tadpole Evolves: Dynamic Record Lifecycle and Heap Reclamation in CheddarOS

Tadpole Compiler Bullfrogg Kernel Memory-Management x86-64 OOP

Until now, CheddarOS records operated primarily as static singletons or raw pointers cast over known memory buffers. While deterministic, this approach created architectural friction for desktop-grade abstractions—most notably dynamic UI widgets, windowing structures, and growable buffer pools. To eliminate this bottleneck, we engineered native heap record lifecycle management directly into the Tadpole compiler.

We expanded Tadpole's grammar and lexer with two dedicated keywords: `new` as an expression and `destroy` as a first-class statement. In `TadpoleParser.cs`, `ParsePrimary` handles scoped record construction with parameter lists, while `ParseStatement` captures teardown targets. At the same time, we hardened the compiler's diagnostic engine to reject reserved keywords used as variable names with actionable, contextual errors.

Backend code generation in `X64Emitter.cs` lowers both primitives under standard Microsoft x64 calling conventions while enforcing 16-byte RSP frame alignment. A `new` expression calculates the record footprint, calls `allocate_memory`, spills the instance pointer across argument evaluations, and invokes the record's `constructor` with `self` loaded into `RCX`. Conversely, `destroy` introduces an automatic null guard, dispatches the record's `destructor` for internal teardown, and hands the backing allocation to `free_memory`.

To tie the compiler directly to the Bullfrogg kernel, `heap.tad` was updated with top-level allocator hooks into the intrusive free-list heap at `0xFFFFC00000000000`. During bare-metal verification in `widget_test.tad`, dynamic instantiation, field assignment, method execution, and explicit destruction were tested end-to-end. The intrusive free list immediately reclaimed and coalesced the freed block, confirming zero-drift memory recycling without fragmenting the kernel heap.

With `new` and `destroy` fully operational in native Tadpole, the path is cleared for a comprehensive kernel refresh—unlocking modular desktop UI components, clean driver state lifecycles, and modern system software design.

Console Log Excerpt

[0.604993] HEAP: Initialized at virt 0xFFFFC00000000000 (Capacity: 0x0000000000000008 KB)
[0.607469] HEAP: Smoke test passed. Dynamic allocations verified.
[0.608340] LIFECYCLE: Commencing heap record lifecycle test...
[0.608904]   [TestWidget::constructor] Initialized widget id=0x0000000000000539 at addr=0xFFFFC00000004020
[0.610187]   [TestWidget::PrintDetails] ID: 0x0000000000000539 Dim: 0000000000000320x0000000000000258
[0.611846]   [TestWidget::destructor] Teardown widget id=0x0000000000000539 at addr=0xFFFFC00000004020
[0.613252] LIFECYCLE: Widget destroyed.
[0.613752] LIFECYCLE: Re-allocated 24 bytes at addr=0xFFFFC00000004020
[0.614572] LIFECYCLE: Memory recycling VERIFIED (reused same block).
[0.616198] LIFECYCLE: Null-pointer destroy test passed.
[1.888347] CheddarFS: Active Generation [GEN: 0x0000000000000020] Selected from Slot 0x0000000000000001
• Project Bullfrogg Update

Operation MetalPond: Eradicating Emulator Assumptions for Bare-Metal Silicon

Bare-Metal Kernel NVMe PCIe VMM SMP Hardware

Emulators lie through their teeth. QEMU is extraordinarily forgiving: virtual devices transition instantaneously, DMA shares host-coherent cache lines, framebuffers sit conveniently below 4 GB, and peripheral devices appear neatly on Bus 0. To break free from virtual training wheels and prepare CheddarOS for physical motherboards, we launched 'Operation MetalPond'—a strict, ground-up audit of our bare-metal hardware compliance.

The audit uncovered several critical areas where physical silicon would have triggered early triple-faults or silent corruption. Modern discrete GPUs map GOP framebuffers high in 64-bit MMIO space, exposing our boot structure's legacy 32-bit truncation. We immediately widened `BootParams.framebuffer` across `boot.tad`, `vmm.tad`, and `framebuffer.tad`, ensuring full 64-bit physical address handling regardless of memory topology.

Next, we systematically hardened the storage stack. Physical NVMe controllers enforce variable microcode readiness windows via `CAP.TO`, which we now inspect to calculate dynamic timeout ceilings. To prevent CPU cache coherency races during PCIe bus mastering, we introduced `PAGE_FLAG_UNCACHEABLE` (`0x1B`, asserting `PWT` and `PCD`) into the VMM, strictly remapping Admin queues, I/O queues, and our read buffers with preceding `invlpg` invalidations and `sfence`/`lfence` pipeline serialization.

We closed out the offensive by tackling SMP allocation boundaries and PCIe bridge topologies. We enforced a strict sub-4GB guarantee on initial PML4 root table allocations to protect real-mode AP trampoline handoffs. Finally, `pci.tad` was upgraded with recursive Type 0x01 bridge traversal—complete with cycle-detection bitmaps and memory-space bus mastering enablement—ensuring physical M.2 NVMe drives wired behind PCH chipset lanes are discovered instantly.

All seven P0 blockers have been executed and verified. The kernel advances to Generation 11 in the CheddarFS pool, maintaining perfect QEMU stability while meeting the uncompromising demands of physical silicon.

Console Log Excerpt

[0.000624] MCFG: PCIe ECAM Base: 0x00000000E0000000 (Busses: 0x0000000000000000 - 0x00000000000000FF)
[0.611237] MADT: Total active CPU cores discovered: 0x0000000000000004
[1.224808] [SMP] Core 0x0000000000000000: GS_BASE armed at 0x0000000001020600 (LAPIC 0x0000000000000000)
[1.240151] SMP: slot CR3 0x0000000000103000
[1.264978] SMP: AP [APIC ID: 0x0000000000000001] Online. Probe 0x0000000000000033
[1.283604] SMP: AP [APIC ID: 0x0000000000000002] Online. Probe 0x0000000000000033
[1.311438] SMP: AP [APIC ID: 0x0000000000000003] Online. Probe 0x0000000000000033
[1.313960] SMP: Total cores synchronized: 0x0000000000000004
[1.417533] [SMP] Bringup barrier released.
[1.629722] PCI: Starting ECAM scan for NVMe...
[1.631904] PCI: Found NVMe Controller at [B:D:F] 0x0000000000000000:0x0000000000000002:0x0000000000000000 Vendor: 0x0000000000001B36 Device: 0x0000000000000010
[1.640853] NVMe: Splash Stage 05 NVMe Online (75%) BAR0: 0x000000C000000000
[1.844325] NVMe: Controller Initialized & Ready (CSTS.RDY=1)
[1.846572] NVMe: Phase 2 init OK.
[1.849066] NVMe: Phase 3 queues OK.
[1.853122] NVMe: CHEDDAR! verified from LBA 1048576.
[1.855627] CheddarFS: Superblock Magic Verified
[1.857254] CheddarFS: Active Generation [GEN: 0x000000000000000B] Selected from Slot 0x0000000000000001
[1.858688] CheddarFS: Root Inode LBA Hint: 0x00000000001008C0
[1.869020] CheddarFS: Splash Stage 06 C-FS Online (90%).
[2.371801] CheddarFS Mounted Read-Only.
• Project Bullfrogg Update

Self-Contained NVMe Boot: In-Place ESP Injection and Generational CoW Preservation

CheddarOS NVMe UEFI CheddarFS cFS-Cli Bootloader

We have achieved a major milestone for CheddarOS deployment and disk architecture: the system now boots as a fully autonomous, self-contained NVMe storage device. Previously, running iterative builds relied on QEMU mounting an external host-backed FAT directory fallback. With today's pipeline overhaul, our primary `cheddar_disk.img` handles the entire boot chain from firmware handoff to secondary generational mounting.

The key breakthrough came from teaching `cFS-Cli` how to perform surgical in-place ESP updates. Zone B (the UEFI System Partition from LBA 2048 to 1,048,575) was re-architected to conform strictly to EDK2's `FatPkg` specifications. By configuring a standard 32-sector reserved region, zeroing out 16-bit FAT fields, writing proper FSInfo and backup boot sectors, and aligning cluster allocation, firmware immediately recognizes the ESP as an active filesystem on `Boot0001` without manual shell intervention.

Simultaneously, we extended `cFS-Cli inject-esp` to carry both `BOOTX64.EFI` and the stitched `CHEDDAR.BIN` binary into the FAT32 volume, eliminating external boot dependencies. Right alongside the firmware payload, the pipeline automatically issues an `inject-file` transaction to write the new kernel straight into the CheddarFS `/System/` hierarchy.

Because this injection adheres to native CheddarFS Copy-on-Write (CoW) semantics, updating the operating system advances the active superblock to Generation 6 while leaving all prior generational snapshots completely untouched. The result is an instantaneous, non-destructive workflow: compile in Tadpole, stitch the flat binary, inject in-place, and watch all 4 SMP cores take flight directly from raw NVMe storage.

Console Log Excerpt

>>> Injecting updated binaries into existing NVMe image...
  -> Updating Zone B ESP (BOOTX64.EFI + CHEDDAR.BIN)...
ESP written: 1048576 sectors, 8192 FAT sectors, 129020 clusters
Done.
  -> Archiving CHEDDAR.BIN to CheddarFS (System/)...
Injected: CHEDDAR.BIN (EID: 4108d42a-d710-4077-99cd-3e0d7401b7e2, Generation: 6, Blocks: 3)
>>> In-place update complete. Existing generations preserved.
>>> Launching QEMU...
BdsDxe: loading Boot0001 "UEFI QEMU NVMe Ctrl CHEDDAR01 1" from PciRoot(0x0)/Pci(0x2,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)
BdsDxe: starting Boot0001 "UEFI QEMU NVMe Ctrl CHEDDAR01 1" from PciRoot(0x0)/Pci(0x2,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)
[Bootloader] CHEDDAR.BIN loaded. Transitioning...
[0.000000] Ribbit... (CheddarOS Tadpole Kernel Online)
[1.312810] SMP: Total cores synchronized: 0x0000000000000004
[1.629533] PCI: Found NVMe Controller at [B:D:F] 0x0000000000000000:0x0000000000000002:0x0000000000000000
[1.864706] NVMe: CHEDDAR! verified from LBA 1048576.
[1.869573] CheddarFS: Superblock Magic Verified
[1.871752] CheddarFS: Active Generation [GEN: 0x0000000000000006] Selected from Slot 0x0000000000000002
[2.384619] CheddarFS Mounted Read-Only.
• Project Bullfrogg Update

Tadpole Evolves: Control-Flow Overhaul, Strict Grammar, and Kernel Refactoring

Tadpole Compiler Grammar Kernel SMP Bare-Metal

Today was a massive leap forward for both the Tadpole compiler and the CheddarOS (Bullfrogg) kernel. We completed a comprehensive overhaul of Tadpole's control-flow mechanics, implementing first-class `break` and `continue` loop-control keywords alongside statement-level `select ... end select` and expression-level `match ... end match`.

The addition of `break` and `continue` immediately cleaned up complex driver polling loops and multi-stage initialization sequences. In the AP SMP bringup routines, resource allocation checks that previously wrapped dozens of lines inside nested flag checks were converted into clean guard clauses, while hardware-wait loops now exit early via break the instant target cores register online rather than grinding through redundant polling cycles.

For multi-way branching, `select` and `match` eliminate sprawling linear if/or-if ladders. Both constructs feature comma-delimited match lists (`when 1, 2, 3`), avoiding accidental C-style fallthrough while grouping shared logic. To preserve bare-metal safety, the X64Emitter avoids push/pop alignment hazards by allocating target spill slots directly inside the frame reserve (`mov [rbp - off], rax`), guaranteeing strict 16-byte stack alignment across arbitrary nested calls.

Alongside these features, we hardened the grammar from v0.2.0 to v0.3.0 by completely removing the ambiguous 'bare end' allowance. Every construct—functions, records, loops, assemblies, and branches—now mandates explicit closers (`end function`, `end while`, `end select`), providing deterministic parser recovery. We capped the day by migrating `keyboard.tad`, replacing 40+ scancode equality checks with a single clean `match` and routing COM1 console chords through `select`, all verified with zero kernel regressions across 4 ticking SMP cores.

Console Log Excerpt

[2.880339] IDLE: chord monitor live (D = swap view, ESC = console; PS/2 + COM1).
[5.195120] CHORD ESC: entering abort console...
[5.214408] 
[5.214693] == CHEDDAR ABORT CONSOLE (COM1) ==
[5.216720] Type on PS/2 or the COM1 terminal. 'help' lists commands.
[5.218390] cheddar> info
[16.196894] cores online: 0x0000000000000004
[16.197634] ticks per core: 0x00000000000005D1 0x00000000000005CF 0x00000000000005CD 0x00000000000005CA
[16.199060] pmm free frames: 0x0000000000004C67
[16.200841] pmm total frames: 0x0000000000007E16
[16.201689] cr3: 0x0000000000103000
[16.202265] debug tty: OFF
[16.202657] cheddar> demo
[22.884274] demo: spawning A (self) + B (AP1 or self in safe mode)...
[22.885840] demo: A=0x00000000001B3000 B=0x00000000001B5000 (tasks run as the idle loop yields)
[22.891514] cheddar> [demo B core 0x0000000000000001 iter 0x0000000000000001]
[22.900700] cheddar> [demo B core 0x0000000000000001 iter 0x0000000000000002]
[22.909736] cheddar> [demo B core 0x0000000000000001 iter 0x0000000000000003]
[22.920402] cheddar> [demo B core 0x0000000000000001 iter 0x0000000000000004]
• Project Bullfrogg Update

Tadpole Evolves: OOP Records, Kernel Refactoring, and cFS Tooling

Tadpole OOP Compiler Kernel CheddarFS Tooling

Tadpole has officially broken past purely procedural semantics. The compiler now features full Stage-1 record-based OOP with instance method lowering (`expr.Method(args...)`), resolving instance targets directly to static `Record::Method(self, args...)` dispatches adhering strictly to MS x64 calling conventions.

With compiler-level OOP online, almost the entire CheddarOS driver stack was systematically refactored. Procedural singletons have been restructured into clean, encapsulated record representations—including `Timer`, `PciBus`, `Pmm`, and `Lapic`—providing structured instance accessors while preserving exact bare-metal field layouts.

On the storage front, CheddarFS received an upgraded file catalog schema to break free from the 14-character filename constraint, enabling arbitrary long filenames across the volume. Generation 2 mounting was validated seamlessly off our NVMe test storage.

To support our storage pipeline, we developed `cFS-Cli` for unattended image generation and `cFS-Now` (CheddarFS Inspector)—a visual desktop tool featuring an allocation block map visualizer, raw 4K hex inspections, and real-time superblock CRC32C validation across active generational slots.

CheddarOS bootscreen showing Stage 06 Merkle root mount and verified Generation 2
Graphical bootscreen displaying all 6 boot stages green, Generation 2 CheddarFS active, and keyboard chord intercept ready.
Raw COM1 ring log buffer showing verified AP cores and NVMe phase 3 queues
Live COM1 buffer verifying 4-core SMP check-ins, NVMe Phase 2/3 queues ready, and CheddarFS Gen 2 mount from LBA 1048576.
cFS-Now visual inspector showing 1GB disk image, block map visualizer, hex dump, and validated CRC32C superblock metadata
cFS-Now Inspector analyzing the 1GB disk image: Superblock Ring Header at LBA 1048576, verified CRC32C checksums, and block map allocation view.

Console Log Excerpt

[1.318498] SMP: Total cores synchronized: 0x0000000000000004
[1.420234] [SMP] Timer check: cpu0x0=0x12 cpu0x1=0x0E cpu0x2=0x0C cpu0x3=0x0A
[1.637803] PCI: Found NVMe Controller at [B:D:F] 0x0000:0x0002:0x0000 Vendor: 0x1B36 Device: 0x0010
[1.853587] NVMe: Controller Initialized & Ready (CSTS.RDY=1)
[1.858454] NVMe: Phase 3 queues OK.
[1.860930] NVMe: CHEDDAR! verified from LBA 1048576.
[1.863879] CheddarFS: Superblock Magic Verified
[1.864597] CheddarFS: Active Generation [GEN: 0000000000000002] Selected from Slot 0000000000000001
[1.870383] CheddarFS: Root Inode LBA Hint: 0x00000000001001C0
[2.383449] CheddarFS Mounted Read-Only.
[2.383790] IDLE: chord monitor live (D = swap view, ESC = console; PS/2 + COM1).
• Project Bullfrogg Update

Stage 06 Reached: The Kernel is 100% Native Tadpole

Milestone Kernel Tadpole Bare-Metal CheddarFS

No foreign C runtime, no third-party assemblers, and zero glue layers. The CheddarOS (Project Bullfrogg) kernel is executing live on bare-metal x86-64 architecture with 100% Tadpole compiled code.

During early handoff, the bootloader encounters a relocated entry at 0x05DAD000 and immediately jumps to native Tadpole execution. From there, the kernel configures the PMM bitmap, initial page tables, registers the 256-entry IDT via LIDT, and loads the kernel GDT without relying on external toolchains.

The kernel enumerates ACPI tables via XSDT, activates HPET timers, and wakes all Application Processors via INIT/SIPI broadcast sequences. Four physical SMP cores synchronize and check in at 1.278s before the PCI subsystem scans ECAM space to map BAR0 and bring the NVMe controller online.

From there, CheddarFS verifies its superblock magic, locks Generation 1, and mounts read-only right as the interactive bootscreen swaps between the graphical horizon and the raw COM1 ring log via hardware chords.

CheddarOS Graphical Bootscreen showing Stage 05 SMP and NVMe online
Graphical bootscreen showing ACPI topology, 4-core SMP sync, NVMe initialization, and early interactive boot chords.
CheddarOS Raw COM1 Ring Buffer Terminal Output
Live COM1 log buffer capturing SMP AP core wakeups, I/O queue setup, and CheddarFS root inode resolution.

Console Log Excerpt

[Bootloader] CHEDDAR.BIN loaded. Transitioning...
[0.000000] Ribbit... (CheddarOS Tadpole Kernel Online)
[0.000000] GDT: Kernel GDT loaded. CS=0x08, SS=0x10.
[0.000000] IDT: 256-entry table initialized and loaded via LIDT.
[0.000000] VMM: CR3 updated with new PML4 base: 0x0000000000103000
[0.612783] MADT: Total active CPU cores discovered: 0x0000000000000004
[1.278661] SMP: Total cores synchronized: 0x0000000000000004
[1.701909] NVMe: Controller Initialized & Ready (CSTS.RDY=1)
[1.714857] CheddarFS: Superblock Magic Verified [GEN: 1]
[2.232247] CheddarFS Mounted Read-Only.