[SeaBIOS] FDPT not registered when physical == logical ?!
Kevin O'Connor
kevin at koconnor.net
Mon Jan 4 02:06:12 CET 2010
On Mon, Jan 04, 2010 at 12:58:22AM +0100, Samuel Thibault wrote:
> Hello,
>
> Reading fill_fdpt, I see that when
> nlc == npc && nlh == nph && nlspt == npspt,
> SET_IVT(0x41,etc.) is not done. Shouldn't it be anyway?
Looks like a bug.
Thanks.
-Kevin
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(
More information about the SeaBIOS
mailing list