From 34ec7b0a5ab55399653cfef4e50570bda2b9ffb2 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 20 Sep 2009 20:04:06 -0400 Subject: Fix bug in fdpt filling - driveid is not hdid. Make sure driveid is used properly. --- src/block.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') 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 -- cgit v1.1