X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Futils%2Fpintos;h=bcfe85a28a75a450ce4f1f5d7b77ac63c71981e9;hb=07ee003af55dc3aab779e95ef2a4f095f6b65964;hp=124269848c0926063935cd0e4a7d897b162a310d;hpb=2b285747143381620ebf4fb37df37d90fbf25705;p=pintos-anon diff --git a/src/utils/pintos b/src/utils/pintos index 1242698..bcfe85a 100755 --- a/src/utils/pintos +++ b/src/utils/pintos @@ -110,7 +110,13 @@ if ($cmd eq 'run') { # Create scratch disk from file. die "$hostfn: $!\n" if ! -e $hostfn; my ($size) = -s _; - copy_pad ($hostfn, "scratch.dsk", 512); + if ($size) { + copy_pad ($hostfn, "scratch.dsk", 512); + } else { + open (SCRATCH, ">scratch.dsk") or die "scratch.dsk: create: $!\n"; + syswrite (SCRATCH, "\0" x 512); + close (SCRATCH); + } # Do copy. my (@cmd) = ("-ci", $guestfn, $size, "-q"); @@ -210,6 +216,17 @@ sub run_vm { undef $disks[$i] if ! -e $disks[$i]; } + my ($project) = `pwd` =~ /\b(threads|userprog|vm|filesys)\b/; + if (($project eq 'userprog' || $project eq 'vm' || $project eq 'filesys') + && !defined $disks[1]) { + print STDERR "warning: it looks like you're running the $project project, " + . "but no file system disk is present\n"; + } + if ($project eq 'vm' && !defined $disks[3]) { + print STDERR "warning: it looks like you're running the $project project, " + . "but no swap disk is present\n"; + } + write_cmd_line ($disks[0], @_); if ($sim eq 'bochs') {