X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Futils%2Fpintos;h=eca4708516e41f3c715d2145e761ba775036ed6a;hb=47747baf50a7db012348a4954b97fc161bcacd19;hp=1abd2edc6a9055ae37788867dc022110d8310ea2;hpb=12d423a1973d59006cd7ffbf8b71cd7409d04703;p=pintos-anon diff --git a/src/utils/pintos b/src/utils/pintos index 1abd2ed..eca4708 100755 --- a/src/utils/pintos +++ b/src/utils/pintos @@ -618,7 +618,9 @@ sub run_qemu { if $vga eq 'terminal'; print "warning: qemu doesn't support jitter\n" if defined $jitter; - my (@cmd) = ('qemu'); + my (@cmd) = ('qemu-system-i386'); + push (@cmd, '-device', 'isa-debug-exit'); + push (@cmd, '-hda', $disks[0]) if defined $disks[0]; push (@cmd, '-hdb', $disks[1]) if defined $disks[1]; push (@cmd, '-hdc', $disks[2]) if defined $disks[2]; @@ -819,7 +821,7 @@ sub xsystem { for (;;) { if (waitpid ($pid, WNOHANG) != 0) { # Subprocess died. Pass through any remaining data. - print $buf while sysread ($in, $buf, 4096) > 0; + do { print $buf } while sysread ($in, $buf, 4096) > 0; last; } @@ -857,7 +859,11 @@ sub xsystem { exit 0; } - return $?; + # Kind of a gross hack, because qemu's isa-debug-exit device + # only allows odd-numbered exit values, so we can't exit + # cleanly with 0. We use exit status 0x63 as an alternate + # "clean" exit status. + return ($? != 0x6300) && $?; } }