-sub grade_mlfqs_off {
- my (@output) = @_;
- verify_common (@output);
- our (@mlfqs_off_stats) = mlfqs_stats (@output);
-}
-
-sub grade_mlfqs_speedup {
- our (@mlfqs_off_stats);
- our (@mlfqs_on_stats);
- eval {
- check_mlfqs ();
- my ($off_ticks) = $mlfqs_off_stats[1];
- my ($on_ticks) = $mlfqs_on_stats[1];
- die "$off_ticks ticks without MLFQS, $on_ticks with MLFQS\n"
- if $on_ticks >= $off_ticks;
- die "ok\n";
- };
- chomp $@;
- $result{'mlfqs-speedup'} = $@;
-}
-
-sub grade_mlfqs_priority {
- our (@mlfqs_off_stats);
- our (@mlfqs_on_stats);
- eval {
- check_mlfqs () if !defined (@mlfqs_on_stats);
- for my $cat qw (CPU IO MIX) {
- die "Priority changed away from PRI_DEFAULT (29) without MLFQS\n"
- if $mlfqs_off_stats[0]{$cat}{MIN} != 29
- || $mlfqs_off_stats[0]{$cat}{MAX} != 29;
- die "Minimum priority never changed from PRI_DEFAULT (29) "
- . "with MLFQS\n"
- if $mlfqs_on_stats[0]{$cat}{MIN} == 29;
- die "Maximum priority never changed from PRI_DEFAULT (29) "
- . "with MLFQS\n"
- if $mlfqs_on_stats[0]{$cat}{MAX} == 29;
- }
- die "ok\n";
- };
- chomp $@;
- $result{'mlfqs-priority'} = $@;
-}
-
-sub check_mlfqs {
- our (@mlfqs_off_stats);
- our (@mlfqs_on_stats);
- die "p1-4 didn't finish with MLFQS on or off\n"
- if !defined (@mlfqs_off_stats) && !defined (@mlfqs_on_stats);
- die "p1-4 didn't finish with MLFQS on\n"
- if !defined (@mlfqs_on_stats);
- die "p1-4 didn't finish with MLFQS off\n"
- if !defined (@mlfqs_off_stats);
+sub get_file {
+ my ($guest_fn, $host_fn) = @_;
+ xsystem ("pintos "
+ . "--os-disk=pintos/src/userprog/build/os.dsk "
+ . "--fs-disk=output/$test/fs.dsk "
+ . "-v get $guest_fn $host_fn",
+ LOG => "$test/get-$guest_fn",
+ TIMEOUT => 10)
+ or die "get $guest_fn failed\n";