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?
$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);
}
$disk{DISK} = $make_disk;
$disk{HANDLE} = $handle;
$disk{ALIGN} = $align;
- $disk{GEOMETRY} = %geometry;
+ $disk{GEOMETRY} = \%geometry;
$disk{FORMAT} = 'partitioned';
$disk{LOADER} = read_loader ($loader_fn);
$disk{ARGS} = \@args;
$disk{DISK} = $disk_fn;
$disk{HANDLE} = $disk_handle;
$disk{ALIGN} = $align;
-$disk{GEOMETRY} = %geometry;
+$disk{GEOMETRY} = \%geometry;
$disk{FORMAT} = $format;
$disk{LOADER} = $loader;
$disk{ARGS} = \@kernel_args;