aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-09-20 20:04:06 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-09-20 20:04:06 -0400
commit34ec7b0a5ab55399653cfef4e50570bda2b9ffb2 (patch)
tree8a38b842e8f4ba74168ed960ad1304f3574a7b06 /src
parent5b8f80992019371e640b9957f3e5d1a2fb570776 (diff)
downloadseabios-34ec7b0a5ab55399653cfef4e50570bda2b9ffb2.zip
seabios-34ec7b0a5ab55399653cfef4e50570bda2b9ffb2.tar.gz
seabios-34ec7b0a5ab55399653cfef4e50570bda2b9ffb2.tar.bz2
Fix bug in fdpt filling - driveid is not hdid.
Make sure driveid is used properly.
Diffstat (limited to 'src')
-rw-r--r--src/block.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/block.c b/src/block.c
index 10ddcfc..d581b79 100644
--- a/src/block.c
+++ b/src/block.c
@@ -126,9 +126,9 @@ setup_translation(int driveid)
// Fill in Fixed Disk Parameter Table (located in ebda).
static void
-fill_fdpt(int driveid)
+fill_fdpt(int driveid, int hdid)
{
- if (driveid > 1)
+ if (hdid > 1)
return;
u16 nlc = GET_GLOBAL(Drives.drives[driveid].lchs.cylinders);
@@ -139,7 +139,7 @@ fill_fdpt(int driveid)
u16 nph = GET_GLOBAL(Drives.drives[driveid].pchs.heads);
u16 npspt = GET_GLOBAL(Drives.drives[driveid].pchs.spt);
- struct fdpt_s *fdpt = &get_ebda_ptr()->fdpt[driveid];
+ struct fdpt_s *fdpt = &get_ebda_ptr()->fdpt[hdid];
fdpt->precompensation = 0xffff;
fdpt->drive_control_byte = 0xc0 | ((nph > 8) << 3);
fdpt->landing_zone = npc;
@@ -162,7 +162,7 @@ fill_fdpt(int driveid)
// Checksum structure.
fdpt->checksum -= checksum(fdpt, sizeof(*fdpt));
- if (driveid == 0)
+ if (hdid == 0)
SET_IVT(0x41, SEGOFF(get_ebda_seg(), offsetof(
struct extended_bios_data_area_s, fdpt[0])));
else
@@ -183,7 +183,7 @@ map_hd_drive(int driveid)
SET_BDA(hdcount, hdcount + 1);
// Fill "fdpt" structure.
- fill_fdpt(hdcount);
+ fill_fdpt(driveid, hdcount);
}
// Map a cd