# The kernel: low-level or high-level, frankly Evidence tags as in the methodology. The question for every disc board in this family has been "does the BIOS run as itself?" (psx-python's decision 7: "No HLE BIOS"). For the Xbox the answer has consequences no other board has had, because the BIOS is a complete operating system kernel and the firmware is also a set of keys (firmware-and-secrets.md). ## What the kernel is `xboxkrnl.exe`: "closely related to the Windows NT ntoskrnl.exe" (`Kernel` r6596), with the HAL, file systems (FATX, the disc's XDVDFS), the HDD and DVD drivers, the boot animation in its INIT section, and **375 exports** by ordinal (the wiki's export table; nxdk's `lib/xboxkrnl/xboxkrnl.h`, CC0-1.0, gives names and prototypes; its `.def` lists the import library). The exports cover: the memory manager (contiguous and write-combined allocation, page protection), the object and I/O managers (IRPs, device objects), the scheduler (threads, events, semaphores, timers, DPCs, APCs, interrupts connected by `KeConnectInterrupt`), the HAL (`HalReadSMBusValue`, the PIC, reboot), the Av* video-mode calls, crypto (`Xc*`: SHA-1, RC4, RSA, HMAC), and Xbox data (`XboxEEPROMKey`, `XboxHardwareInfo`, the launch data page). **Titles do not reach the hardware only through the kernel.** Direct3D, DirectSound and the input libraries are linked statically into each XBE (the XBE header lists their versions: `XBE` r7427) and program the NV2A's push buffer, the APU and USB directly. So however the kernel is handled, **the GPU, APU and USB must be emulated at register level**. That is why the older HLE emulators also replaced D3D and DSound by recognising library functions inside each title (Cxbx-Reloaded is "HLE/LLE hybrid", `Emulators` r7319; OBSERVED as a description, its GPL source never read). ## Low-level: the flash runs as itself The board emulates the hardware; the player supplies the MCPX boot ROM, a flash image, their EEPROM and an HDD image; the MCPX ROM decrypts the loader, the loader decrypts and decompresses the kernel, the kernel boots, unlocks the disk, authenticates the disc, launches the title (`Boot Process` r7377). - **For**: the hardware is the specification and the kernel is just software running on it, exactly the family's method. Thread scheduling, timer interrupts, DPC timing, file-system behaviour, the order of hardware accesses: all emerge from the machine model, deterministically, and can be judged by hardware tests running under the real kernel. MAME already boots BIOS 4134 to paging-on in two frames (x86-p3-python mame-oracle.md), so the path is concrete. - **Against**: nothing runs without the player's firmware **and** their EEPROM **and** an HDD image, and discs need their security sectors (storage.md). The hardware model must be complete for the boot: the PIC's challenge, the EEPROM, ATA security, the DVD authentication pages, the video encoder probe, USB enumeration. The boot itself is long: the boot animation alone is seconds of emulated time, billions of instructions (HYPOTHESIS), so the Python specification cannot boot a game; gate cases start from transplanted states (the late-era method). ## High-level: the kernel replaced The board loads an XBE directly and answers its kernel imports with our own implementations of the 375 exports. - **For**: no firmware, EEPROM or HDD image; no boot time; no keys anywhere. - **Against, frankly**: - It is **a second implementation of an operating system**, not of hardware: an NT memory manager, object and I/O manager, scheduler, two file systems, a HAL, crypto. Its specification would be Microsoft's behaviour, which only the real kernel shows. The sources would be Microsoft's public NT documentation for the NT-shaped parts (tier 2 for NT, not for the Xbox's variant), the wiki's per-export pages and nxdk's prototypes (tier 3), and the LLE board as the judge (tier 5 relative to hardware, but the only complete one). ReactOS (GPL) and Cxbx-Reloaded (GPL) are closed boxes. - **It changes results.** A title's threads would be scheduled by our scheduler, not Microsoft's; timer and DPC timing, allocation addresses, file-system timing and the order of hardware accesses would differ. Titles with races behave differently. Under the charter that makes it a **concession**: named, off by default, recorded in save states, judged against the LLE run, never the definition. - It does not remove the hard part: the GPU, APU and USB are still register-level. - Its size is of the order of the whole hardware specification again (HYPOTHESIS; Cxbx and Cxbx-Reloaded have worked on theirs for many years: OBSERVED from their public project history, not their source). ## Middle paths 1. **Test-program loader** (proposed, M2): load an nxdk-built XBE (our own and abaire's test programs) straight into RAM with page tables set as the kernel would, and answer the handful of exports such programs import (memory allocation, `HalReadSMBusValue`, `KeQueryPerformanceCounter`, `AvSetDisplayMode`, debug print, `HalReturnToFirmware`) with a small stub that is documented as a **test harness, not a machine mode**. It lets most gate cases run in CI with no firmware. Its exports are judged by running the same program under the real kernel (LLE) when the player's firmware is present. 2. **State transplant after boot** (the late-era method): the Rust tier boots the real kernel to a title's first frame, writes a state, and Python runs slices from it. Exact, no concession; firmware still required to produce the state, and the state holds decrypted kernel memory, so **gate states are firmware too**: never committed, never shared, regenerated from the player's firmware (decision X2). 3. **Skipping the MCPX ROM or the loaders** is not possible without their keys, which come from the firmware itself; there is no keyless shortcut, and none is proposed. ## Recommendation (decision X2 in the handoff brief) - **LLE is the specification.** The board boots the player's flash with the player's MCPX ROM; everything commercial needs them, said plainly in the README. - **The test-program loader** is part of the board's tooling for firmware-free gate cases, with its stub exports listed and each judged against an LLE run. - **No HLE kernel is planned.** If one is ever wanted (for players without a console), it is a separate project and a named concession, judged against LLE, built from public documentation only.