From faedf3ab0659cff849034d85d7c58551afb2d5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Str=C3=B6mb=C3=A4ck?= Date: Wed, 18 Apr 2018 16:59:40 +0200 Subject: Fixed compilation issues on the latest GCC and QEMU. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Strömbäck --- src/threads/init.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/threads/init.c') diff --git a/src/threads/init.c b/src/threads/init.c index 16be95d..ee05db1 100644 --- a/src/threads/init.c +++ b/src/threads/init.c @@ -410,10 +410,16 @@ hard_power_off (void) ACPI shutdown should use: outw(PM1a_CNT, SLP_TYPa | SLP_EN ); Gathering of the corect values for the parameters is not easy. - This works for QEMU and Bochs. It's not portable. + This works for QEMU and Bochs. It's not portable (and does not work in the latest QEMU). */ outw(0xB004, 0x2000); + /* Even more recent versions of QEMU needs other measures for shutdown. + * See: https://wiki.osdev.org/Shutdown + * Exit code is the value to outb * 2 + 1, so we can not exit cleanly... + */ + outb(0xF4, 0x30); + /* This is APM Shutdown */ for (p = s; *p != '\0'; p++) outb (0x8900, *p); -- cgit v1.2.1