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 @@
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;
+ 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;
+ // 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));
+ // Checksum structure.
+ fdpt->checksum -= checksum(fdpt, sizeof(*fdpt));
+ }
if (hdid == 0)
SET_IVT(0x41, SEGOFF(get_ebda_seg(), offsetof(