X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Futils%2FPintos.pm;fp=src%2Futils%2FPintos.pm;h=9e722326d25a819aa1b705ef8fd53f5b3d37ce2f;hb=8a9fd0a7429887b4807a6416e6aa1e306182932e;hp=70df40d2309d234bd989667aa0f11647ba696969;hpb=474dd860a3b9911e790eb4a199a50bbac525dd1e;p=pintos-anon diff --git a/src/utils/Pintos.pm b/src/utils/Pintos.pm index 70df40d..9e72232 100644 --- a/src/utils/Pintos.pm +++ b/src/utils/Pintos.pm @@ -148,7 +148,9 @@ sub set_align { sub assemble_disk { my (%args) = @_; - my (%geometry) = $args{GEOMETRY} || (H => 16, S => 63); + my (%geometry) = %{$args{GEOMETRY}}; + $geometry{H} = 16 if !defined $geometry{H}; + $geometry{S} = 63 if !defined $geometry{S}; my ($align); # Align partition start, end to cylinder boundary? my ($pad); # Pad end of disk out to cylinder boundary? @@ -258,6 +260,7 @@ sub make_partition_table { $table .= pack ("V", $p->{SECTORS}); # Length in sectors die if length ($table) % 16; } + $table = "\0" x 16 . $table while length ($table) < 64; return pack ("a64", $table); }