From: Ben Pfaff Date: Tue, 22 Feb 2005 20:55:13 +0000 (+0000) Subject: Don't consider zero-size disks to exist. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9962360269ff252e7d9cd42ed9b1246da3a7df94;p=pintos-anon Don't consider zero-size disks to exist. (Crossport from win0405.) --- diff --git a/src/utils/pintos b/src/utils/pintos index a86e8de..40a240c 100755 --- a/src/utils/pintos +++ b/src/utils/pintos @@ -23,17 +23,17 @@ GetOptions ("sim=s" => sub { set_sim (@_) }, "no-debug" => sub { set_debug ("no-debug") }, "monitor" => sub { set_debug ("monitor") }, "gdb" => sub { set_debug ("gdb") }, - + "run|get|put|make-disk" => \&cmd_option, - + "m|memory=i" => \$mem, "j|jitter=i" => sub { set_jitter (@_) }, "r|realtime" => sub { set_realtime () }, - + "v|no-vga" => sub { set_vga ('none'); }, "s|no-serial" => sub { $serial_out = 0; }, "t|terminal" => sub { set_vga ('terminal'); }, - + "h|help" => sub { usage (0); }, "0|os-disk|disk-0|hda=s" => \$disks[0], @@ -113,7 +113,7 @@ if ($cmd eq 'run') { # Create scratch disk from file. die "$hostfn: $!\n" if ! -e $hostfn; my ($size) = -s _; - if ($size) { + if ($size) { copy_pad ($hostfn, "scratch.dsk", 512); } else { open (SCRATCH, ">scratch.dsk") or die "scratch.dsk: create: $!\n"; @@ -214,8 +214,9 @@ sub run_vm { our (@disks); die "$disks[0]: can't find OS disk\n" if ! -e $disks[0]; + die "$disks[0]: OS disk cannot have zero size\n" if ! -s $disks[0]; for my $i (1...3) { - undef $disks[$i] if ! -e $disks[$i]; + undef $disks[$i] if ! -s $disks[$i]; } if (my ($project) = `pwd` =~ /\b(threads|userprog|vm|filesys)\b/) {