X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Futils%2Fpintos;h=214e05198a17edd13271b024e601149f3a316c73;hb=8386224782227b5f1d079980a26eda8d2929e631;hp=83954bb951fdabf2a8e7c019e6344fac92bbb7ac;hpb=e9fd665beb814115e19fdbcd33cddd8a299c6960;p=pintos-anon diff --git a/src/utils/pintos b/src/utils/pintos index 83954bb..214e051 100755 --- a/src/utils/pintos +++ b/src/utils/pintos @@ -8,7 +8,7 @@ use Getopt::Long qw(:config bundling); # Command-line options. our ($start_time) = time (); -our ($sim); # Simulator: bochs, qemu, or gsx. +our ($sim) = $ENV{PINTOSSIM}; # Simulator: bochs, qemu, or gsx. our ($debug) = "none"; # Debugger: none, monitor, or gdb. our ($mem) = 4; # Physical RAM in MB. our ($serial_out) = 1; # Send output to serial port? @@ -85,6 +85,9 @@ sub parse_command_line { $sim = "bochs" if !defined $sim; $debug = "none" if !defined $debug; $vga = "window" if !defined $vga; + + print "warning: -T or --timeout should not be used with --$debug\n" + if defined ($timeout) && $debug ne 'none'; } # usage($exitcode). @@ -127,6 +130,8 @@ Disk options: (name an existing FILE or specify SIZE in MB for a temp disk) --swap-disk=FILE|SIZE Set swap disk file (default: swap.dsk) Other options: -h, --help Display this help message. +Environment variables: + PINTOSSIM Select default simulator. EOF exit $exitcode; } @@ -364,27 +369,22 @@ sub run_vm { # Runs Bochs. sub run_bochs { # Select Bochs binary based on the chosen debugger. - my ($bin); - if ($debug eq 'none') { - $bin = 'bochs'; - } elsif ($debug eq 'monitor') { - $bin = 'bochs-dbg'; - } elsif ($debug eq 'gdb') { - $bin = 'bochs-gdb'; - } + my ($bin) = $debug eq 'monitor' ? 'bochs-dbg' : 'bochs'; # Write bochsrc.txt configuration file. open (BOCHSRC, ">", "bochsrc.txt") or die "bochsrc.txt: create: $!\n"; print BOCHSRC <