UPDATED:
New solution
Here is another best solution that will work for both pintos run ...
and make grade
add this line to devices / shutdown.c :: shutdown_power_off (void) before the loop.
outw( 0x604, 0x0 | 0x2000 );
Old decision
For new versions of qemu, you need to run it using the option
-device isa-debug-exit
The output from any entry to the I / O port is 0x501 by default
, i.e. in the pintos project in the src / utils directory, you need to add one line in pintos strong> in the run_qemu routine
sub run_qemu { print "warning: qemu doesn't support --terminal\n" if $vga eq 'terminal'; print "warning: qemu doesn't support jitter\n" if defined $jitter; my (@cmd) = ('qemu-system-i386'); push (@cmd, '-device', 'isa-debug-exit');
and in the shutdown.c file in the device directory add this line to the shutdown_power_off function after the for loop
for (p = s; *p != '\0'; p++) outb (0x8900, *p); outb (0x501, 0x31); // <====== add this line
Qemu exit code is doubled plus one, so there is no way to exit it cleanly. Use 0x31, which should result in qemu 0x63 exit code
finally run pintos with the -q option
pintos -q run alarm-multiple
- Note. This solution will not work for
make grade
, see the comment below @ pranav3688 for the solution.
source share