退出qemu_进程结束后如何自动关闭`qemu`的执行?

bd96500e110b49cbb3cd949968f18be7.png

I want that the qemu window after opening and showing the output automatically closes after running pintOS

Like when i run the command pintos -- run alarm-multiple in tcsh shell, qemu displays that process begins ,then some alarm-notifications and then the process ends, but after that the qemu window won't close

I want to exit the window after successful completion of my system call.

解决方案

UPDATED:

The new solution

Here is another better 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 );

The old Solution

For the newer versions of qemu you need to run it with the option

-device isa-debug-exit

Which exits on any write to an IO port, by default it's 0x501

i.e in your pintos project under the src/utils directory you will need to add one line to the pintos file in the run_qemu subroutine

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'); # <====== add this line

..

..

push (@cmd, '-monitor', 'null') if $vga eq 'none' && $debug eq 'none';

run_command (@cmd);

}

and in shutdown.c file under the devices directory

add this line in 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's exit code is double the value plus one, so there is no way to exit cleanly. Use 0x31 which should result in a qemu exit code of 0x63

finally run pintos with -q option

pintos -q run alarm-multiple

Note: this solution will not work for make grade see the comment below by @pranav3688 for a solution.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值