1

actually there is a same question before,

How to automatically close the execution of the `qemu` after end of process?

but I'm asking this issue again because no one has answered it yet.

enter image description here

I'm trying to simulate pintos on qemu. And when I invoke a command "pintos run alarm-multiple", a new QEMU window appears like above, and it doesn't close itself after it's powered off. I guess, however, this cause a problem when I try "make check", because each test doesn't end automatically. So "-T 60" option finally terminates the tests, just like below.

enter image description here

How can I make QEMU automatically quit itself when it ends its process??

phraust
  • 123
  • 1
  • 9

3 Answers3

1

QEMU will (by default, unless passed the -no-shutdown option) automatically exit when the guest OS performs whatever the "power off" operation is for the hardware being emulated. (For a Linux guest this typically happens when the guest does "shutdown -h now", for instance.)

If this is not happening then the problem is likely to be one of:

  1. you're running QEMU emulating a board model which doesn't implement power-off functionality (eg some embedded ARM board models)
  2. your guest OS doesn't know how to do a hardware-power-off
  3. your test code/harness is not telling the guest OS to do hardware-power-off when it's done
Peter Maydell
  • 9,707
  • 1
  • 19
  • 25
1

The default Pintos code outputs the string "Shutdown" to the port 0x8900. This was a power-off sequence for Bochs and Qemu. But this was removed from Qemu recently. Try this.

topology
  • 11
  • 1
0

Try removing "-T 60" from the command line arguments, I remember playing with -T for the same issue.

pranav3688
  • 694
  • 1
  • 11
  • 20
  • Then 'make check' never ends, since qemu can't stop itself! – phraust Jul 13 '17 at 06:00
  • this probably has to do with the qemu version you have, I will check my setup and reply here. I remember facing this issue, then my prof or TA helped me out, but this was long back. you should use 'bochs' to run all the tests, since it is lightweight it runs a lot faster than qemu. [Here](http://bochs.sourceforge.net/) is the link. After installing, change the "--qemu" flag to "--bochs" in one of the config files at 'src' level. – pranav3688 Jul 13 '17 at 20:37