projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Comments.
[pintos-anon]
/
src
/
utils
/
pintos
diff --git
a/src/utils/pintos
b/src/utils/pintos
index c48dc2405f1a92dccf10d954d7c469e0de405efb..920b28dfa80349f46cb7888c5f20a28a23f0f693 100755
(executable)
--- a/
src/utils/pintos
+++ b/
src/utils/pintos
@@
-51,7
+51,7
@@
while (@ARGV) {
copy_pad ($hostfn, "scratch.dsk", 512);
# Do copy.
copy_pad ($hostfn, "scratch.dsk", 512);
# Do copy.
- run_vm ("-ci", $
ho
stfn, $size, "-q");
+ run_vm ("-ci", $
gue
stfn, $size, "-q");
exit 0;
} elsif ($arg eq 'get') {
usage () if @ARGV != 1 && @ARGV != 2;
exit 0;
} elsif ($arg eq 'get') {
usage () if @ARGV != 1 && @ARGV != 2;
@@
-164,6
+164,8
@@
sub run_vm {
print BOCHSRC "vgaromimage: $vgaromimage\n";
print BOCHSRC bochs_disk_line ("ata0-master", $disks[0]);
print BOCHSRC bochs_disk_line ("ata0-slave", $disks[1]);
print BOCHSRC "vgaromimage: $vgaromimage\n";
print BOCHSRC bochs_disk_line ("ata0-master", $disks[0]);
print BOCHSRC bochs_disk_line ("ata0-slave", $disks[1]);
+ print BOCHSRC "ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15\n"
+ if defined ($disks[2]) || defined ($disks[3]);
print BOCHSRC bochs_disk_line ("ata1-master", $disks[2]);
print BOCHSRC bochs_disk_line ("ata1-slave", $disks[3]);
print BOCHSRC "boot: c\n";
print BOCHSRC bochs_disk_line ("ata1-master", $disks[2]);
print BOCHSRC bochs_disk_line ("ata1-slave", $disks[3]);
print BOCHSRC "boot: c\n";
@@
-172,15
+174,15
@@
sub run_vm {
print BOCHSRC "megs: $mem\n";
print BOCHSRC "log: bochsout.txt\n";
if ($vga ne 'terminal') {
print BOCHSRC "megs: $mem\n";
print BOCHSRC "log: bochsout.txt\n";
if ($vga ne 'terminal') {
- print BOCHSRC "com1: enabled=1, dev=/dev/
tty
\n"
- if $serial_
stdio
;
+ print BOCHSRC "com1: enabled=1, dev=/dev/
stdout
\n"
+ if $serial_
out
;
print BOCHSRC "display_library: nogui\n"
if $vga eq 'none';
} else {
print BOCHSRC "display_library: term\n";
}
close (BOCHSRC);
print BOCHSRC "display_library: nogui\n"
if $vga eq 'none';
} else {
print BOCHSRC "display_library: term\n";
}
close (BOCHSRC);
- run_command ($bin, '-q');
+ run_command
_no_die
($bin, '-q');
} elsif ($sim eq 'qemu') {
print "warning: qemu doesn't support --terminal\n"
if $vga eq 'terminal';
} elsif ($sim eq 'qemu') {
print "warning: qemu doesn't support --terminal\n"
if $vga eq 'terminal';
@@
-191,7
+193,7
@@
sub run_vm {
push (@cmd, '-hdd', $disks[3]) if defined $disks[3];
push (@cmd, '-m', $mem);
push (@cmd, '-nographic') if $vga eq 'none';
push (@cmd, '-hdd', $disks[3]) if defined $disks[3];
push (@cmd, '-m', $mem);
push (@cmd, '-nographic') if $vga eq 'none';
- push (@cmd, '-serial', 'stdio') if $serial_
stdio
&& $vga ne 'none';
+ push (@cmd, '-serial', 'stdio') if $serial_
out
&& $vga ne 'none';
push (@cmd, '-S') if $debug eq 'monitor';
push (@cmd, '-s') if $debug eq 'gdb';
run_command (@cmd);
push (@cmd, '-S') if $debug eq 'monitor';
push (@cmd, '-s') if $debug eq 'gdb';
run_command (@cmd);
@@
-271,6
+273,11
@@
sub run_command {
die "command failed\n" if system (@_);
}
die "command failed\n" if system (@_);
}
+sub run_command_no_die {
+ print join (' ', @_), "\n";
+ system (@_);
+}
+
sub search_path {
my ($target) = @_;
for $dir (split (':', $ENV{PATH})) {
sub search_path {
my ($target) = @_;
for $dir (split (':', $ENV{PATH})) {
@@
-284,7
+291,7
@@
sub bochs_disk_line {
return "" if !defined $file;
my (%geom) = disk_geometry ($file);
return "$device: type=disk, path=$file, mode=flat, "
return "" if !defined $file;
my (%geom) = disk_geometry ($file);
return "$device: type=disk, path=$file, mode=flat, "
- . "
cylinders=$geom{C}, heads=$geom{H}, spt=$geom{S}, "
+ . "cylinders=$geom{C}, heads=$geom{H}, spt=$geom{S}, "
. "translation=none\n";
}
. "translation=none\n";
}