diff options
author | Kim Mik <kimmik999999@yahoo.co.uk> | 2010-01-10 14:57:40 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-01-10 12:33:16 -0800 |
commit | 91334030e93d5d0a60a178e214140054dfc5d69c (patch) | |
tree | 1de547686cb9a5889a2af86b8840532b87f06c4e | |
parent | 4b96057c4bc297c892bc84c920f1962a37d8e511 (diff) | |
download | syslinux.git-91334030e93d5d0a60a178e214140054dfc5d69c.tar.gz syslinux.git-91334030e93d5d0a60a178e214140054dfc5d69c.tar.xz syslinux.git-91334030e93d5d0a60a178e214140054dfc5d69c.zip |
chain.c32: add grldr= command for Grub4dos
grldr of Grub4dos wants the partition number in DH:
0xff: whole drive
0-3: primary partitions
4-*: logical partitions
Hmmm... there really isn't a huge reason not to do this
unconditionally, at least unless it's known to cause problems. It
would be better, of course, if grldr used the standard DS:SI, but it
doesn't, so oh well.
Some info of a Grub4dos developer (Tinybit):
GRLDR can be loaded at any address with alignment 16(i.e., a possible
segment base address). Generally you want to load it at 0000:7C00, or at
2000:0000. Of course you never load it at 0000:0000 or similar.
Before jumping to the entry point at the very beginning of GRLDR, you
should setup DL=(BIOS drive) and DH=(partition number). For partition
numbers, 0 - 3 are primary, 4 - 0xFE are logical. (DH=0xFF) stands for
whole drive(unpartitioned). DH will later be passed to
install_partition(the third byte, from bit 16 to bit 23).
http://www.boot-land.net/forums/index.php?showtopic=8457&st=20&start=20 post #22
-rw-r--r-- | com32/modules/chain.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/com32/modules/chain.c b/com32/modules/chain.c index da64707f..3d192d73 100644 --- a/com32/modules/chain.c +++ b/com32/modules/chain.c @@ -782,9 +782,20 @@ int main(int argc, char *argv[]) whichpart = 0; /* Default */ - if (partition) + /* 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) { 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"); } |