Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
operating-systems
ws21
assignments
Commits
95da70e5
Commit
95da70e5
authored
Oct 24, 2017
by
John Ousterhout
Committed by
Darshit Shah
Oct 25, 2017
Browse files
Updates for new version of Qemu
Use new isa-debug-exit device for shutdown, switch name to qemu-system-i386.
parent
d63ee3e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/devices/shutdown.c
View file @
95da70e5
...
...
@@ -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.) */
...
...
src/utils/pintos
View file @
95da70e5
...
...
@@ -619,19 +619,9 @@ sub run_qemu {
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
');
# on newer systems (e.g. Ubuntu 14.04) there are
# various versions of qemu for different platforms available.
# if there are multiple versions, we should select the
# complete system emulator for i386 platforms.
my
(
$qemu
)
=
find_in_path
("
qemu
");
if
(
!
defined
$qemu
)
{
$qemu
=
find_in_path
("
qemu-system-i386
");
die
"
unable to autodetect qemu. please check if it is installed
\n
"
if
!
defined
$qemu
;
}
my
(
@cmd
)
=
(
$qemu
);
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
];
...
...
@@ -870,7 +860,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) && $?;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment