From: Kevin O'Connor Date: Mon, 4 Jan 2010 03:24:18 +0000 (-0500) Subject: Set FDPT in irq table even for small drives. X-Git-Tag: rel-0.5.1~5 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=085debd93f52d36381ea13ef27e7f72e87fe62f5;p=seabios.git Set FDPT in irq table even for small drives. Fix bug due to fill_fdpt exiting early in non-logical drive case. --- diff --git a/src/block.c b/src/block.c index c6787e2..01aa84a 100644 --- a/src/block.c +++ b/src/block.c @@ -180,20 +180,19 @@ fill_fdpt(struct drive_s *drive_g, int hdid) fdpt->heads = nlh; fdpt->sectors = nlspt; - if (nlc == npc && nlh == nph && nlspt == npspt) - // no logical CHS mapping used, just physical CHS - // use Standard Fixed Disk Parameter Table (FDPT) - return; - - // complies with Phoenix style Translated Fixed Disk Parameter - // Table (FDPT) - fdpt->phys_cylinders = npc; - fdpt->phys_heads = nph; - fdpt->phys_sectors = npspt; - fdpt->a0h_signature = 0xa0; - - // Checksum structure. - fdpt->checksum -= checksum(fdpt, sizeof(*fdpt)); + if (nlc != npc || nlh != nph || nlspt != npspt) { + // Logical mapping present - use extended structure. + + // complies with Phoenix style Translated Fixed Disk Parameter + // Table (FDPT) + fdpt->phys_cylinders = npc; + fdpt->phys_heads = nph; + fdpt->phys_sectors = npspt; + fdpt->a0h_signature = 0xa0; + + // Checksum structure. + fdpt->checksum -= checksum(fdpt, sizeof(*fdpt)); + } if (hdid == 0) SET_IVT(0x41, SEGOFF(get_ebda_seg(), offsetof(