solo5 icon indicating copy to clipboard operation
solo5 copied to clipboard

[WIP] virtio: detect PIIX4 and attempt to power off via ACPI hack (broken)

Open mbacarella opened this issue 4 years ago • 0 comments
trafficstars

This is attempt 2 of 2 to solve #499 (attempt 1 was #500)

Summary:

This is my failed attempt to resolve #499 . It will detect the PIIX4 on GCE and attempt to power off if you exit the mirage unikernel (e.g. raise an uncaught exception right after you start), but it hangs instead of powering off because it's not a correct implementation.

Discussion:

Detecting the PIIX4 on the PCI bus works; it requires a simple change to the pci_enumerate function to list "functions" of PCI devices. Then it attempts to parse just enough of ACPI to learn parameters needed to power off. This approach is probably not generally feasible, but may work on GCE.

This adapts the method from C code here https://forum.osdev.org/viewtopic.php?t=16990 though it fails.

More information at #499.

mbacarella avatar Nov 17 '21 18:11 mbacarella