chainloader: patch in BPB's sectors_per_track and num_heads
authorC. Masloch <pushbx@38.de>
Thu, 1 Feb 2018 14:51:55 +0000 (15:51 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 14 Mar 2018 12:23:27 +0000 (13:23 +0100)
commitc225298038f0e7e7ec2d783776fba880d9965f16
tree125968a45c480a43f59dae326c6076564caba550
parenta698240df0c43278b2d1d7259c8e7a6926c63112
chainloader: patch in BPB's sectors_per_track and num_heads

These fields must reflect the ROM-BIOS's geometry for CHS-based
loaders to correctly load their next stage. Most loaders do not
query the ROM-BIOS (Int13.08), relying on the BPB fields to hold
the correct values already.

Tested with lDebug booted in qemu via grub2's
FreeDOS direct loading support, refer to
https://bitbucket.org/ecm/ldosboot + https://bitbucket.org/ecm/ldebug
(For this test, lDebug's iniload.asm must be assembled with
-D_QUERY_GEOMETRY=0 to leave the BPB values provided by grub.)

Signed-off-by: C. Masloch <pushbx@38.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/loader/i386/pc/chainloader.c