aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-09-05 15:21:40 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-09-05 15:21:40 -0700
commitc4410d5977e8cb2cfe468faeed6e60e72b58ccac (patch)
tree1b4ea06b5f13550fbbb2e1cf699cc456c90f593a /utils
parent669c4e56aa4e672cd651b316075440a9f639be7e (diff)
downloadsyslinux.git-c4410d5977e8cb2cfe468faeed6e60e72b58ccac.tar.gz
syslinux.git-c4410d5977e8cb2cfe468faeed6e60e72b58ccac.tar.xz
syslinux.git-c4410d5977e8cb2cfe468faeed6e60e72b58ccac.zip
isohybrid: fix partition table generation, documentsyslinux-3.72-pre3
Fix the generation of the partition table in isohybrid; also document the operation of the partition table. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/isohybrid.in14
1 files changed, 4 insertions, 10 deletions
diff --git a/utils/isohybrid.in b/utils/isohybrid.in
index a0487ca0..5e3f785a 100644
--- a/utils/isohybrid.in
+++ b/utils/isohybrid.in
@@ -124,7 +124,7 @@ $mbr .= pack("V", $id); # Offset 440: MBR ID
$mbr .= "\0\0"; # Offset 446: actual partition table
# Print partition table
-$psize = $c*$h*$s-$s;
+$psize = $c*$h*$s;
$bhead = 0;
$bsect = 1;
$bcyl = 0;
@@ -132,18 +132,12 @@ $ehead = $h-1;
$esect = $s + ((($cc-1) & 0x300) >> 2);
$ecyl = ($cc-1) & 0xff;
$fstype = 0x83; # Linux (any better ideas?)
-$pentry = 1;
-if ( $c > 1024 ) {
- $fstype = 0x0e;
-} elsif ( $psize > 65536 ) {
- $fstype = 0x06;
-} else {
- $fstype = 0x04;
-}
+$pentry = 1; # First partition slot
+
for ( $i = 1 ; $i <= 4 ; $i++ ) {
if ( $i == $pentry ) {
$mbr .= pack("CCCCCCCCVV", 0x80, $bhead, $bsect, $bcyl, $fstype,
- $ehead, $esect, $ecyl, $s, $psize);
+ $ehead, $esect, $ecyl, 0, $psize);
} else {
$mbr .= "\0" x 16;
}