aboutsummaryrefslogtreecommitdiffstats
path: root/src/threads
diff options
context:
space:
mode:
authorklaar36 <klas.arvidsson@liu.se>2018-04-18 17:15:50 +0200
committerklaar36 <klas.arvidsson@liu.se>2018-04-18 17:15:50 +0200
commitf3e1dd764327c4d5361880c546bfa76baa97d32e (patch)
tree1d275880b18ac812abc3bd15d7b650e092c5eef4 /src/threads
parent4509fc2711408cc7f94fd466fee01b9ed5ec25bc (diff)
parentfaedf3ab0659cff849034d85d7c58551afb2d5eb (diff)
downloadpintos-rs-f3e1dd764327c4d5361880c546bfa76baa97d32e.tar.gz
Merge branch 'new-gcc-qemu-fix' into 'master'
Fixed compilation issues on the latest GCC and QEMU. See merge request !10
Diffstat (limited to 'src/threads')
-rw-r--r--src/threads/init.c8
1 files changed, 7 insertions, 1 deletions
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);