← Blog
MILESTONE · 0.6.0 kernel

Apple Silicon HAL: sigilOS on M1–M4

June 22, 2026 · sigil-kernel · Sigil-Docs
kernel hal apple-silicon powerpc 0.6.0

sigilOS now ships a complete Apple Silicon HAL targeting M1–M4: 11 components covering the AIC interrupt controller, iBoot/m1n1 boot handoff, UART, 16KiB-granule page tables, PMGR power gating, GPIO, DART per-device IOMMU, I2C, PCIe RC, SPI, and ANS2 NVMe bridge. A parallel PowerPC HAL covers G3/G4/G5. All QEMU PASS. (c0b97be, 0049369, 2adeba4, 705cd17)

Apple Silicon HAL verify on raspi3b test harness
Apple Silicon HAL verify on raspi3b test harness — AIC+DART+MMU PASS

Apple Silicon HAL (M1–M4) — 11 components

FileComponentNotes
apple_aic.sgAIC interrupt controller64-IRQ model, enable/poll/eoi
apple_boot.sgiBoot/m1n1 handoffBootArgs struct: physBase/FB/DT
apple_uart.sgS3C/S5L debug UART256B loopback, putc/getc
apple_mmu.sg16KiB-granule page tablesT0SZ=25, L1×8 + L2×2048
apple_pmgr.sgT8103 PMGR power-state gatingboot_init: AIC+DMA+UART0
apple_gpio.sg212-pin GPIOoutput-enable/data/pull/IRQ edge
apple_dart.sgPer-device IOMMUbypass+translate, SID mapping
apple_i2c.sg9-instance I2C100 kHz model, SMC/PMU/display path
apple_pcie.sgT8103 3-lane PCIe RCECAM model, lane_up/link_up/scan
apple_spi.sg5-instance SPIkbd/Touch ID/NOR/Touch Bar, full-duplex loopback
apple_nvme.sgANS2 NVMe bridgeadmin SQ/CQ (16 entries), Identify ctrl

The MMU uses 16KiB granules (Apple's native page size) with T0SZ=25: L1 holds 8 entries covering the 39-bit VA space; L2 holds 2048 entries per L1 block. The DART provides per-device IOMMU isolation — each peripheral gets a unique SID and an independent address space; bypass mode is available for trusted boot devices.

The SPI controller covers all five Apple SPI instances: keyboard matrix, Touch ID sensor, NOR flash, Touch Bar, and a spare. Full-duplex loopback is verified in the harness. The ANS2 NVMe bridge models the admin submission and completion queues at 16 entries each and verifies the Identify Controller admin command round-trip.


Apple DCP Display Co-Processor

apple_dcp.sg models the DCP display co-processor used in M1 Pro and later. It implements the shared-memory ring between the AP and DCP (AP→DCP command ring, DCP→AP reply ring), and the SETUP / TIMINGS / ENABLE boot sequence. Native resolution verified at 2560×1600@60Hz (M1 Pro). (705cd17)


PowerPC HAL (G3/G4/G5) — 6 components

FileComponentNotes
openpic.sgOpenPIC/MPIC64 sources, IVR/ack/EOI
ppc_timer.sgDecrementer + timebaseG4 33MHz / G5 100MHz
ppc_mmu.sgHTAB MMU256-PTEG model, ppc_map/lookup
machio.sgMac-IO bridge + DBDMA8-channel DMA, G3/G4 Heathrow/KeyLargo
adb.sgADB keyboard+mouseCUDA/PMU event queue model
openfirmware.sgOF device treeFlat model: cpu/timebase/memory/stdout

The OpenPIC interrupt controller models 64 interrupt sources with the standard IVR/ack/EOI cycle. The HTAB MMU uses a 256-PTEG hash table matching the G4/G5 hardware model. Mac-IO covers both the Heathrow (G3) and KeyLargo (G4) variants with an 8-channel DBDMA engine. OpenFirmware device tree is a flat model that exports cpu, timebase, memory, and stdout nodes — enough to boot a Sigil kernel without real OF firmware. (2adeba4, 705cd17)


HAL contract and the 0.6.0 driver target

The five HAL driver-class seams are: CLS_INPUT, CLS_STORAGE, CLS_NET, CLS_POWER, CLS_BUS. Every peripheral in both HALs maps to one of these five classes. With the Apple Silicon HAL complete, all seams have implementations for M1–M4, and the bring-up path to real M1 hardware is the primary 0.6.0 driver target. The DART IOMMU ensures that each driver class operates in an isolated IOMMU domain — no peripheral can DMA into another's address space.