X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2Fdevices%2Fshutdown.c;h=da94c5294f339c1d81eb0950f83e53f9f703b1dc;hp=61c76f7b060d2746ae6fa1763feede4f895db200;hb=47747baf50a7db012348a4954b97fc161bcacd19;hpb=bb0485f5561709b2d9a97fdeda9bfa1bd55a20c9 diff --git a/src/devices/shutdown.c b/src/devices/shutdown.c index 61c76f7..da94c52 100644 --- a/src/devices/shutdown.c +++ b/src/devices/shutdown.c @@ -107,6 +107,13 @@ shutdown_power_off (void) for (p = s; *p != '\0'; p++) outb (0x8900, *p); + /* For newer versions of qemu, you must run with -device + * isa-debug-exit, which exits on any write to an IO port (by + * default 0x501). Qemu's exit code is double the value plus one, + * so there is no way to exit cleanly. We use 0x31 which should + * result in a qemu exit code of 0x63. */ + outb (0x501, 0x31); + /* This will power off a VMware VM if "gui.exitOnCLIHLT = TRUE" is set in its configuration file. (The "pintos" script does that automatically.) */