From ba4e8886d6cdfe3e8d8b8303ed8b78010f7d30fa Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 17 Mar 2004 11:18:39 +0000 Subject: - sector2CHS() now gives sector number starting at 0 - CHS2rawCHS() takes care of giving sector number starting at 1 --- perl-install/partition_table/dos.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'perl-install/partition_table') diff --git a/perl-install/partition_table/dos.pm b/perl-install/partition_table/dos.pm index cb687e6b0..acbc821f2 100644 --- a/perl-install/partition_table/dos.pm +++ b/perl-install/partition_table/dos.pm @@ -41,9 +41,9 @@ sub CHS2rawCHS { #- no way to have a #cylinder >= 1024 $c = 1023; $h = $hd->{geom}{heads} - 1; - $s = $hd->{geom}{sectors}; + $s = $hd->{geom}{sectors} - 1; } - ($c & 0xff, $h, $s | (($c >> 2) & 0xc0)); + ($c & 0xff, $h, ($s + 1) | (($c >> 2) & 0xc0)); } # returns (cylinder, head, sector) @@ -52,7 +52,7 @@ sub sector2CHS { my ($s, $h); ($start, $s) = divide($start, $hd->{geom}{sectors}); ($start, $h) = divide($start, $hd->{geom}{heads}); - [ $start, $h, $s + 1 ]; + [ $start, $h, $s ]; } sub read { -- cgit v1.2.1