diff --git a/bochs/bios/BIOS-bochs-2-processors b/bochs/bios/BIOS-bochs-2-processors index c9693c6db..b5fdf55f6 100644 Binary files a/bochs/bios/BIOS-bochs-2-processors and b/bochs/bios/BIOS-bochs-2-processors differ diff --git a/bochs/bios/BIOS-bochs-4-processors b/bochs/bios/BIOS-bochs-4-processors index 43d4bc441..b96fb11b0 100644 Binary files a/bochs/bios/BIOS-bochs-4-processors and b/bochs/bios/BIOS-bochs-4-processors differ diff --git a/bochs/bios/BIOS-bochs-8-processors b/bochs/bios/BIOS-bochs-8-processors index 0d206bd23..83eb51cba 100644 Binary files a/bochs/bios/BIOS-bochs-8-processors and b/bochs/bios/BIOS-bochs-8-processors differ diff --git a/bochs/bios/BIOS-bochs-latest b/bochs/bios/BIOS-bochs-latest index 7a7ec209d..1ff6eb814 100644 Binary files a/bochs/bios/BIOS-bochs-latest and b/bochs/bios/BIOS-bochs-latest differ diff --git a/bochs/bios/rombios.c b/bochs/bios/rombios.c index 375d7521a..c76a6179c 100644 --- a/bochs/bios/rombios.c +++ b/bochs/bios/rombios.c @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: rombios.c,v 1.154 2005-09-24 08:09:38 vruppert Exp $ +// $Id: rombios.c,v 1.155 2005-10-27 07:37:46 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -939,7 +939,7 @@ Bit16u cdrom_boot(); #endif // BX_ELTORITO_BOOT -static char bios_cvs_version_string[] = "$Revision: 1.154 $ $Date: 2005-09-24 08:09:38 $"; +static char bios_cvs_version_string[] = "$Revision: 1.155 $ $Date: 2005-10-27 07:37:46 $"; #define BIOS_COPYRIGHT_STRING "(c) 2002 MandrakeSoft S.A. Written by Kevin Lawton & the Bochs team." @@ -6806,7 +6806,7 @@ BX_INFO("floppy: drive>1 || head>1 ...\n"); outb(0x03f5, head); outb(0x03f5, sector); outb(0x03f5, 2); // 512 byte sector size - outb(0x03f5, 0); // last sector number possible on track + outb(0x03f5, sector + num_sectors - 1); // last sector to read on track outb(0x03f5, 0); // Gap length outb(0x03f5, 0xff); // Gap length @@ -6940,7 +6940,7 @@ BX_INFO("floppy: drive>1 || head>1 ...\n"); outb(0x03f5, head); outb(0x03f5, sector); outb(0x03f5, 2); // 512 byte sector size - outb(0x03f5, 0); // last sector number possible on track + outb(0x03f5, sector + num_sectors - 1); // last sector to write on track outb(0x03f5, 0); // Gap length outb(0x03f5, 0xff); // Gap length diff --git a/bochs/iodev/floppy.cc b/bochs/iodev/floppy.cc index 616e0c0c8..0e49505f9 100644 --- a/bochs/iodev/floppy.cc +++ b/bochs/iodev/floppy.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: floppy.cc,v 1.83 2005-10-09 17:58:37 vruppert Exp $ +// $Id: floppy.cc,v 1.84 2005-10-27 07:37:46 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -132,7 +132,7 @@ bx_floppy_ctrl_c::init(void) { Bit8u i; - BX_DEBUG(("Init $Id: floppy.cc,v 1.83 2005-10-09 17:58:37 vruppert Exp $")); + BX_DEBUG(("Init $Id: floppy.cc,v 1.84 2005-10-27 07:37:46 vruppert Exp $")); DEV_dma_register_8bit_channel(2, dma_read, dma_write, "Floppy Drive"); DEV_register_irq(6, "Floppy Drive"); for (unsigned addr=0x03F2; addr<=0x03F7; addr++) { @@ -941,22 +941,26 @@ bx_floppy_ctrl_c::floppy_command(void) BX_FD_THIS s.status_reg2 = 0x00; enter_result_phase(); return; - } + } if (cylinder != BX_FD_THIS s.cylinder[drive]) BX_DEBUG(("io: cylinder request != current cylinder")); - logical_sector = (cylinder * BX_FD_THIS s.media[drive].heads * BX_FD_THIS s.media[drive].sectors_per_track) + + logical_sector = (cylinder * BX_FD_THIS s.media[drive].heads * BX_FD_THIS s.media[drive].sectors_per_track) + (head * BX_FD_THIS s.media[drive].sectors_per_track) + (sector - 1); if (logical_sector >= BX_FD_THIS s.media[drive].sectors) { BX_PANIC(("io: logical sector out of bounds")); - } - + } + // This hack makes older versions of the Bochs BIOS work + if (eot == 0) { + eot = BX_FD_THIS s.media[drive].sectors_per_track; + } BX_FD_THIS s.cylinder[drive] = cylinder; BX_FD_THIS s.head[drive] = head; BX_FD_THIS s.sector[drive] = sector; + BX_FD_THIS s.eot[drive] = eot; if ((BX_FD_THIS s.command[0] & 0x4f) == 0x46) { // read floppy_xfer(drive, logical_sector*512, BX_FD_THIS s.floppy_buffer, @@ -1334,25 +1338,25 @@ bx_floppy_ctrl_c::increment_sector(void) // values after completion of data xfer // ??? calculation depends on base_count being multiple of 512 BX_FD_THIS s.sector[drive] ++; - if (BX_FD_THIS s.sector[drive] > BX_FD_THIS s.media[drive].sectors_per_track) { + if ((BX_FD_THIS s.sector[drive] > BX_FD_THIS s.eot[drive]) || + (BX_FD_THIS s.sector[drive] > BX_FD_THIS s.media[drive].sectors_per_track)) { BX_FD_THIS s.sector[drive] = 1; if (BX_FD_THIS s.multi_track) { BX_FD_THIS s.head[drive] ++; if (BX_FD_THIS s.head[drive] > 1) { BX_FD_THIS s.head[drive] = 0; BX_FD_THIS s.cylinder[drive] ++; - } } - else { + } else { BX_FD_THIS s.cylinder[drive] ++; - } + } if (BX_FD_THIS s.cylinder[drive] >= BX_FD_THIS s.media[drive].tracks) { // Set to 1 past last possible cylinder value. // I notice if I set it to tracks-1, prama linux won't boot. BX_FD_THIS s.cylinder[drive] = BX_FD_THIS s.media[drive].tracks; BX_INFO(("increment_sector: clamping cylinder to max")); - } } + } } unsigned diff --git a/bochs/iodev/floppy.h b/bochs/iodev/floppy.h index 4886773a0..43941143f 100644 --- a/bochs/iodev/floppy.h +++ b/bochs/iodev/floppy.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: floppy.h,v 1.20 2005-08-24 20:44:55 vruppert Exp $ +// $Id: floppy.h,v 1.21 2005-10-27 07:37:46 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -87,6 +87,7 @@ private: Bit8u cylinder[4]; // really only using 2 drives Bit8u head[4]; // really only using 2 drives Bit8u sector[4]; // really only using 2 drives + Bit8u eot[4]; // really only using 2 drives /* MAIN STATUS REGISTER * b7: MRQ: main request 1=data register ready 0=data register not ready