From: Kim Mik Date: Sun, 10 Jan 2010 14:57:40 +0000 (+0000) Subject: chain.c32: add grldr= command for Grub4dos X-Git-Tag: syslinux-3.85-pre2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91334030e93d5d0a60a178e214140054dfc5d69c;p=platform%2Fupstream%2Fsyslinux.git 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 --- diff --git a/com32/modules/chain.c b/com32/modules/chain.c index da64707..3d192d7 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"); }