projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7891eee
)
Allow disks to come from build/ directory as well as current
author
Ben Pfaff
<blp@cs.stanford.edu>
Wed, 6 Jul 2005 21:49:47 +0000
(21:49 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Wed, 6 Jul 2005 21:49:47 +0000
(21:49 +0000)
directory, by default.
src/utils/pintos
patch
|
blob
|
history
diff --git
a/src/utils/pintos
b/src/utils/pintos
index 348c6abf3a7882e8b1e600c6e2cf2043c5108a6f..c29b6a3c4043b85968fec25de43e0a8d699634b6 100755
(executable)
--- a/
src/utils/pintos
+++ b/
src/utils/pintos
@@
-19,7
+19,7
@@
our (@puts); # Files to copy into the VM.
our (@gets); # Files to copy out of the VM.
our ($as_ref); # Reference to last addition to @gets or @puts.
our (@kernel_args); # Arguments to pass to kernel.
our (@gets); # Files to copy out of the VM.
our ($as_ref); # Reference to last addition to @gets or @puts.
our (@kernel_args); # Arguments to pass to kernel.
-our (%disks) = (OS => {
FILENAME => 'os.dsk'},
# Disks to give VM.
+our (%disks) = (OS => {
DEF_FN => 'os.dsk'},
# Disks to give VM.
FS => {DEF_FN => 'fs.dsk'},
SCRATCH => {DEF_FN => 'scratch.dsk'},
SWAP => {DEF_FN => 'swap.dsk'});
FS => {DEF_FN => 'fs.dsk'},
SCRATCH => {DEF_FN => 'scratch.dsk'},
SWAP => {DEF_FN => 'swap.dsk'});
@@
-193,9
+193,13
@@
sub set_as {
sub find_disks {
for my $disk (values %disks) {
# If there's no assigned file name but the default file exists,
sub find_disks {
for my $disk (values %disks) {
# If there's no assigned file name but the default file exists,
- # assign the default file.
- $disk->{FILENAME} = $disk->{DEF_FN}
- if !defined ($disk->{FILENAME}) && -e $disk->{DEF_FN};
+ # try to assign a default file name.
+ if (!defined ($disk->{FILENAME})) {
+ for my $try_fn ($disk->{DEF_FN}, "build/" . $disk->{DEF_FN}) {
+ $disk->{FILENAME} = $try_fn, last
+ if -e $try_fn;
+ }
+ }
# If there's no file name, we're done.
next if !defined ($disk->{FILENAME});
# If there's no file name, we're done.
next if !defined ($disk->{FILENAME});
@@
-220,6
+224,7
@@
sub find_disks {
}
# Warn about (potentially) missing disks.
}
# Warn about (potentially) missing disks.
+ die "Cannot find OS disk\n" if !defined $disks{OS}{FILENAME};
if (my ($project) = `pwd` =~ /\b(threads|userprog|vm|filesys)\b/) {
if ((grep ($project eq $_, qw (userprog vm filesys)))
&& !defined ($disks{FS}{FILENAME})) {
if (my ($project) = `pwd` =~ /\b(threads|userprog|vm|filesys)\b/) {
if ((grep ($project eq $_, qw (userprog vm filesys)))
&& !defined ($disks{FS}{FILENAME})) {