diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-01-10 12:36:30 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-01-10 12:36:30 -0800 |
commit | 58e9e6510952e7c558b68e6d90e9fbd30156ba83 (patch) | |
tree | c4f72b4170d7af878521f573660364c4709d8169 | |
parent | 91334030e93d5d0a60a178e214140054dfc5d69c (diff) | |
download | syslinux.git-58e9e6510952e7c558b68e6d90e9fbd30156ba83.tar.gz syslinux.git-58e9e6510952e7c558b68e6d90e9fbd30156ba83.tar.xz syslinux.git-58e9e6510952e7c558b68e6d90e9fbd30156ba83.zip |
chain.c32: simplify the grub4dos support
Grub4dos (like Grub in general) uses the same partition numbers as
Linux (and chain.c32), minus one.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | com32/modules/chain.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/com32/modules/chain.c b/com32/modules/chain.c index 3d192d73..2dd80746 100644 --- a/com32/modules/chain.c +++ b/com32/modules/chain.c @@ -781,25 +781,21 @@ int main(int argc, char *argv[]) regs.ebx.b[0] = regs.edx.b[0] = drive; whichpart = 0; /* Default */ - - /* grldr of Grub4dos wants the partition number in DH: - 0xff: whole drive (default) - 0-3: primary partitions - 4-*: logical partitions - */ - regs.edx.b[1] = 0xff; - - if (partition) { + if (partition) whichpart = strtoul(partition, NULL, 0); - /* grldr of Grub4dos wants the partiton number in DH. */ - regs.edx.b[1] = whichpart -1; - } - if (!(drive & 0x80) && whichpart) { error("Warning: Partitions of floppy devices may not work\n"); } + /* + * grldr of Grub4dos wants the partition number in DH: + * -1: whole drive (default) + * 0-3: primary partitions + * 4-*: logical partitions + */ + regs.edx.b[1] = whichpart-1; + /* Get the disk geometry and disk access setup */ if (get_disk_params(drive)) { error("Cannot get disk parameters\n"); |