git clone https://garage44.eu/jeroen/pinnacle.gitcartopolis-agent · 2026-11-30T13:51:22Z
docs: the firmware's AML, the embedded controller, battery, charger and lid
docs/hardware.md | 13 ++++++++----- docs/roadmap.md | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/hardware.md b/docs/hardware.md index aa7abac..b99eb11 100644 --- a/docs/hardware.md +++ b/docs/hardware.md @@ -111,7 +111,10 @@ run on a real machine yet. | Intel Ethernet (`drivers/e1000.rs`) | the e1000e family: the 82574L, 82579, and the chipsets' I217, I218 and I219; one ring each way, its interrupt by MSI | PCI 8086, by ID | | The keyboard controller (`drivers/ps2.rs`, PC only) | a laptop's own keyboard (set 1, translated by the controller) and its touchpad as a PS/2 mouse, with a wheel where it says so; interrupts 1 and 12 through the I/O APIC | ports 0x60, 0x64 | | The firmware's screen (`board::pc`, `drivers::scanout`) | the framebuffer UEFI's GOP left lit, as the loader passes it on: 32-bit RGB either way round, or 16-bit 5-6-5; the boot log drawn on it (`drivers::screen_log`) until the display server takes it | Multiboot2's framebuffer tag | -| ACPI's power (`x86_64/acpi.rs`) | the FADT: ACPI mode on, off by `\_S5` (its sleep types read from the DSDT's package, not by running AML), restart by the reset register, the power button's fixed event on the SCI; every general-purpose event off | the FADT | +| ACPI's power (`x86_64/acpi.rs`) | the FADT: ACPI mode on, off by `\_S5` (its sleep types read from the DSDT's package, not by running AML), restart by the reset register, the power button's fixed event on the SCI; general-purpose events on only for what answers them (the embedded controller's, the firmware's `_Lxx`/`_Exx` methods) | the FADT | +| The firmware's AML (`aml/`, the crate `pinnacle-aml`; `x86_64/power.rs`) | the DSDT and every SSDT loaded and run by an interpreter of Pinnacle's own: devices, names, methods, operation regions and their fields (memory, I/O, PCI configuration, the embedded controller, CMOS), `_INI`, `_REG`, `_STA`, `_CRS` decoded (I/O, memory, interrupts, GPIO, I²C); a loop runs at most a million times, calls nest at most 64 deep, a device whose body fails loses itself only | the DSDT, SSDTs | +| The embedded controller (`x86_64/power.rs`) | its two ports and GPE from AML (`PNP0C09`, `_CRS`, `_GPE`), reads and writes for AML's regions, its events (`_Qxx`) run in a kernel task when its GPE fires | `PNP0C09` | +| Battery, charger, lid (`x86_64/power.rs`) | `_BIX` or `_BIF`, `_BST`, `_PSR`, `_LID` asked live (`power` system call, 71): level, charging, minutes left, capacities, model; the firmware's notifications and a lid or charger change sent to the display server as input events, which draws the battery in the status bar and locks the screen when the lid closes | `PNP0C0A`, `ACPI0003`, `PNP0C0D` | Interrupts are message interrupts on a PC (MSI-X, or MSI for AHCI and Ethernet) and INTx on ARM (routed by the device tree); a PC's wired ones @@ -130,8 +133,8 @@ screen stays at the firmware's mode, uncached, without brightness), recording through HDA, HDMI and DisplayPort audio, a codec's vendor-specific set-up (some laptops' speakers stay silent without Realtek's coefficients), Intel's audio DSP (class 04:01, the "SOF" mode, which some firmware choose -when the laptop has digital microphones), the battery and the lid (they -need AML run, not read). +when the laptop has digital microphones), sleeping (S3, S0ix: the lid closed locks the screen, the machine stays on), the +battery's own warnings (`_BTP`), thermal zones and fans (`_TZ`). `cargo xtask test` (its first boot) and `cargo xtask pc` give QEMU a USB controller with a keyboard, a tablet and a stick, an NVMe disk and a SATA @@ -150,12 +153,12 @@ As a person meets it: the stick installs itself on the NVMe disk and turns the machine off by ACPI; started from the disk, it plays the self-check's 440 Hz tone through HDA (heard in QEMU's WAV file), and asks for the data's password, typed on the PS/2 keyboard; the touchpad moves -the pointer on the home screen; the power button (QEMU's +the pointer on the home screen; the status bar shows a battery, from an SSDT given to QEMU (`-acpitable`, written with `pinnacle_aml::asm`: a battery, a charger, a lid, read through their methods by the same code as a laptop's; QEMU has no embedded controller, so its numbers are the table's own); the power button (QEMU's `system_powerdown`, ACPI's fixed event) turns it off. A screenshot each step, in `target/demo-laptop/`. What that cannot show is what QEMU does not have: an I²C touchpad, Intel's -Wi-Fi and graphics, a battery, a laptop's own HDA codec (QEMU's has one +Wi-Fi and graphics, an embedded controller, a laptop's own HDA codec (QEMU's has one line out and no speaker, headphone jack or EAPD, so the jack's switching is untried), and every firmware's own mistakes. Those wait for a machine. diff --git a/docs/roadmap.md b/docs/roadmap.md index 5561ffd..f50b4c3 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -73,6 +73,7 @@ What is still missing for daily use, and the projects it will take, is in | A PC's and a laptop's own hardware, on PCI (`hardware.md`): USB through an xHCI controller (`drivers/usb`), each device on a root port addressed and configured, plugged in and pulled out at any time, followed by a kernel task; keyboards by the boot protocol (keys as the virtio keyboard's), mice, tablets and touch screens by their report descriptors; sticks and disks by Bulk-Only Transport and SCSI. Disks behind NVMe (`nvme`) and AHCI (`ahci`, SATA), each a `Controller` under the block layer's cache as virtio-blk is; interrupts by MSI-X or MSI on a PC, INTx on ARM, every driver on a shared line asked. `cargo xtask test` and `pc` give QEMU all of them; the self-check writes a block on each disk and puts it back | Done in QEMU on both architectures (no isochronous transfers or USB 3 streams; one NVMe I/O queue; no SD/eMMC, which waits for the first device) | | An Intel laptop without trying one (`hardware.md`, "A laptop, without one"): the firmware's screen (GOP) drawn on, the boot log on it and a panic over it, the machine left on (a laptop has no serial port); x2APIC; the I/O APIC with the MADT's overrides; the keyboard controller's keyboard and touchpad (PS/2), a pointer the display server draws; ACPI's FADT: off by `\_S5`, restart by its reset register, the power button; USB hubs (USB 2 and 3, a translator's route for slower devices); Intel's e1000e Ethernet (82574L to I219); randomness from RDSEED/RDRAND; booted with no virtio device at all. `cargo xtask laptop`: the stick behind a hub installs on NVMe and turns off by ACPI, the disk starts, the password typed on PS/2, the power button turns it off | Done in QEMU (2026-11-29); not tried on a laptop. Not here: I²C-HID touchpads, Intel Wi-Fi and graphics, battery and lid (they need AML run), the I219's PHY waking from ULP | | Intel HDA sound (`drivers/hda.rs`, `hardware.md`): the controller reset, CORB/RIRB (immediate registers as the fallback), codecs from STATESTS, the first with an analog output walked from its speaker pin (else line out) and headphone jack to a converter through mixers and selectors, powered, unmuted at 0 dB, EAPD on; one output stream of eight 10 ms periods fed by the kernel's mixer, as virtio-sound's are, an interrupt a period, the position by LPIB, stopped once nothing plays; the speaker off while headphones are in (unsolicited response); `cargo xtask laptop` hears the self-check's tone through QEMU's `ich9-intel-hda` | Done in QEMU (2026-11-30); not tried on a laptop. Not here: recording, HDMI/DP audio, vendor coefficient set-ups, Intel's DSP (SOF) mode, the jack's switching (QEMU's codec has none) | +| A laptop's battery, charger and lid, from its firmware (`aml/`, `x86_64/power.rs`, `hardware.md`): an AML interpreter of Pinnacle's own (no ACPICA) loads the DSDT and SSDTs and runs their methods, bounded (a million loop rounds, 64 calls deep), a device that fails losing itself only; `_CRS` decoded, GPIO and I²C included; the embedded controller found from AML and driving its regions, its `_Qxx` events and the firmware's `_Lxx`/`_Exx` GPE methods run in a kernel task; `_BIX`/`_BIF`, `_BST`, `_PSR`, `_LID` asked live by the `power` system call (71); a lid or charger change an input event to the display server, which draws the battery in the status bar and locks when the lid closes. `cargo xtask laptop` gives QEMU a battery, charger and lid as an SSDT written with `pinnacle_aml::asm` | Done in QEMU (2026-11-30): QEMU's DSDT loads with no failure; no embedded controller tried (QEMU has none). Not here: sleep (S3, S0ix), battery warnings (`_BTP`), thermal zones and fans | | Disks with partitions (`pinnacle-disk`: GPT and FAT32, shared with `xtask`): Pinnacle's system and data partitions mounted, the system the one the loader names (`root=`), any other disk free; Settings → Disks lists each, what it holds and where Pinnacle can go | Done | | Installing on a disk (`install`, Settings → Disks → Install): from a USB stick (`cargo xtask installer [pc]`), a partition table, a boot partition with the stick's loader and kernel and a command line naming the new system, the system copied file by file, a blank data partition the first start makes a vault; `cargo xtask install-test [pc]` installs on NVMe in QEMU under edk2 and starts from it, `install-demo [pc]` does it in Settings with a USB tablet and keyboard | Done in QEMU on both (no UEFI boot entry written: the disk is found by the path every firmware tries) | | Pinnacle's own UEFI loader (`boot/`): the kernel and its command line read from the boot partition, started as a boot image on ARM (the command line in a copy of the device tree) and by Multiboot2 on a PC (the memory map, GOP's framebuffer, ACPI's root pointer); no GRUB (`cargo xtask pc-efi`) | Done in QEMU (edk2); U-Boot's UEFI untried |