chain.c32: add grldr= command for Grub4dos
authorKim Mik <kimmik999999@yahoo.co.uk>
Sun, 10 Jan 2010 14:57:40 +0000 (14:57 +0000)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 10 Jan 2010 20:33:16 +0000 (12:33 -0800)
commit91334030e93d5d0a60a178e214140054dfc5d69c
tree1de547686cb9a5889a2af86b8840532b87f06c4e
parent4b96057c4bc297c892bc84c920f1962a37d8e511
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
com32/modules/chain.c