[SeaBIOS] [PATCH] apm: fix shutdown

Gerd Hoffmann kraxel at redhat.com
Thu Jul 25 10:05:21 CEST 2013


Qemu commit 9ee59f3 removed the bochs bios apm interface emulation at
port 0x8900.  That broke poweroff via APM.  Fix it by powering off the
machine using the acpi pm control register.

Old code is left in, so seabios wil try both poweroff methods.  Cleaning
that eventually up is left for another patch, after checking it isn't
needed.  Qemu never implemented "Standby" and "Suspend", only
"Shutdown", so it looks like there might be non-qemu use cases (bochs
probably).

Easiest way to test this is the syslinux poweroff module; modern linux
distros usually have CONFIG_APM turned off.

Reported-by: Sebastian Herbszt <herbszt at gmx.de>
Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
 src/apm.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/apm.c b/src/apm.c
index b2eac6d..15f37dd 100644
--- a/src/apm.c
+++ b/src/apm.c
@@ -109,6 +109,7 @@ void
 apm_shutdown(void)
 {
     irq_disable();
+    outw(0x2000, PORT_ACPI_PM_BASE + 0x04);
     out_str("Shutdown");
     for (;;)
         hlt();
-- 
1.7.9.7




More information about the SeaBIOS mailing list