projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
thread_join() the -ex process if THREAD_JOIN_IMPLEMENTED.
[pintos-anon]
/
src
/
utils
/
pintos
diff --git
a/src/utils/pintos
b/src/utils/pintos
index 9206629c0c801fe53249345de01bd12d66857528..261b7b2825bca6ecb621ac258386a8f27cb839fe 100755
(executable)
--- a/
src/utils/pintos
+++ b/
src/utils/pintos
@@
-15,6
+15,12
@@
while (@ARGV) {
exit 0;
} elsif ($arg =~ /^mem(?:ory)?=(\d+)/) {
$mem = $1;
exit 0;
} elsif ($arg =~ /^mem(?:ory)?=(\d+)/) {
$mem = $1;
+ } elsif ($arg eq '-j') {
+ die "-j need random seed argument\n" if !@ARGV;
+ die "-j need integer argument\n" if $ARGV[0] !~ /^-?\d+$/;
+ $jitter = shift (@ARGV);
+ } elsif ($arg =~ /--jitter=(-?\d+)$/) {
+ $jitter = $1;
} elsif ($arg eq '--no-vga' || $arg eq '-nv') {
print "warning: --no-vga conflicts with --terminal\n"
if $vga eq 'terminal';
} elsif ($arg eq '--no-vga' || $arg eq '-nv') {
print "warning: --no-vga conflicts with --terminal\n"
if $vga eq 'terminal';
@@
-117,6
+123,7
@@
sub usage {
print " -ns, --no-serial No serial output\n";
print " -t, --terminal Display VGA in terminal (Bochs only)\n";
print "VM options:\n";
print " -ns, --no-serial No serial output\n";
print " -t, --terminal Display VGA in terminal (Bochs only)\n";
print "VM options:\n";
+ print " -j SEED Randomize timer interrupts (Bochs only)\n";
print " --mem=MB Run VM with MB megabytes of physical memory\n";
exit $exitcode;
}
print " --mem=MB Run VM with MB megabytes of physical memory\n";
exit $exitcode;
}
@@
-164,6
+171,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";
@@
-180,10
+189,14
@@
sub run_vm {
print BOCHSRC "display_library: term\n";
}
close (BOCHSRC);
print BOCHSRC "display_library: term\n";
}
close (BOCHSRC);
- run_command ($bin, '-q');
+ @cmd = ($bin, '-q');
+ push (@cmd, '-j', $jitter) if defined $jitter;
+ run_command_no_die (@cmd);
} 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';
+ print "warning: qemu doesn't support jitter\n"
+ if defined $jitter;
my (@cmd) = ('qemu');
push (@cmd, '-hda', $disks[0]) if defined $disks[0];
push (@cmd, '-hdb', $disks[1]) if defined $disks[1];
my (@cmd) = ('qemu');
push (@cmd, '-hda', $disks[0]) if defined $disks[0];
push (@cmd, '-hdb', $disks[1]) if defined $disks[1];
@@
-202,6
+215,8
@@
sub run_vm {
if $vga eq 'none';
print "warning: VMware GSX Server doesn't support --terminal\n"
if $vga eq 'terminal';
if $vga eq 'none';
print "warning: VMware GSX Server doesn't support --terminal\n"
if $vga eq 'terminal';
+ print "warning: VMware GSX Server doesn't support jitter\n"
+ if defined $jitter;
open (VMX, ">pintos.vmx") or die "pintos.vmx: create: $!\n";
chmod 0777 & ~umask, "pintos.vmx";
open (VMX, ">pintos.vmx") or die "pintos.vmx: create: $!\n";
chmod 0777 & ~umask, "pintos.vmx";
@@
-271,6
+286,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})) {