I've finished my basic ACPI code, all the table scanning, enable/disable, global lock acquisition for the FACS and i've started writing an AML interpreter (but that is a big job and going to take me some time).
In the meantime however I would like to have working shutdown and reboot.
SHUTDOWN:
For shutdown I followed the guide on the wiki and the details in the ACPI spec about parsing the _S5_ object, getting the SLPTypa/b values and writing them out to the PM1a/b control register blocks.
I've verified that the PM1a/b values coming back in BOCHS and VirtualBox and on real hardware are valid as well as the slp_typ (I've seen 0 and 7 and ports 0xb004, 0x0404).
The shutdown works in Bochs but seems to have no effect in VirtualBox or on real hardware.
I would have assumed the ACPI implementations between Bochs/Qemu and VirtualBox would be the same or at least very similar but it appears not.
I've had a look through some extracted ASL from my real machines for the _PTS and _GTS methods and I cannot see anything in there specifically which would prevent the shutdown if they weren't called.
Not sure if anyone has encountered this as the article seems to indicate that it works on all machines tested thus-far (albeit not ideal by not calling the respective acpi methods).
REBOOT:
On VirtualBox (which has XSDT/ACPI2+) and my real machines I have access to RESET register in ACPI->FADT which seems to work perfectly to perform a reboot (writing ResetValue to it).
This however is not available in Bochs ACPI or on one of my real machines. Temporarily I added in a second call to the 8042 keyboard controller to perform the cpu reset if the acpi call fails or isn't available.
This seems to work in Bochs, but not on the real machine (assuming it's emulation of 8042 doesn't go that far if at all).
What is the suggested method(s) to perform a reboot/restart?
ACPI Shutdown and reboot
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: ACPI Shutdown and reboot
The KBC might be nonexistent on newer systems. Causing a triple fault guarantees a reset on real hardware, but tends to make VMs complain about the system having crashed instead.What is the suggested method(s) to perform a reboot/restart?
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: ACPI Shutdown and reboot
Not all systems reset on triple.Combuster wrote:The KBC might be nonexistent on newer systems. Causing a triple fault guarantees a reset on real hardware, but tends to make VMs complain about the system having crashed instead.What is the suggested method(s) to perform a reboot/restart?