From 0a43073688370125a378d85776d2966fda310650 Mon Sep 17 00:00:00 2001 From: Greg Haerr Date: Mon, 11 Sep 2023 17:08:42 -0700 Subject: [PATCH] More fixups --- elks/arch/i86/drivers/block/bios.c | 36 ++++++++++------------------ elks/arch/i86/drivers/block/bioshd.c | 2 +- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/elks/arch/i86/drivers/block/bios.c b/elks/arch/i86/drivers/block/bios.c index 7af960e65..030114688 100644 --- a/elks/arch/i86/drivers/block/bios.c +++ b/elks/arch/i86/drivers/block/bios.c @@ -225,50 +225,40 @@ int INITPROC bios_gethdinfo(struct drive_infot *drivep) { #endif #ifdef CONFIG_BLK_DEV_BFD_HARD -/* hard-coded floppy configuration*/ int INITPROC bios_getfdinfo(struct drive_infot *drivep) { -/* Set this to match your system. Currently it's set to a two drive system: +/* + * Hard-coded floppy configuration + * Set below to match your system. For IBM PC, it's set to a two drive system: * * 720KB as /dev/fd0 * and 720KB as /dev/fd1 * - * ndrives is number of drives in your system (either 0, 1 or 2) - */ - - int ndrives = FD_DRIVES; - -/* drive_info[] should be set *only* for existing drives; - * comment out drive_info lines if you don't need them - * (e.g. you have less than 2 drives) - * - * Use floppy drive type table below: - * - * Type Format - * ~~~~ ~~~~~~ + * Drive Type Format + * ~~~~~ ~~~~~~ * 0 360 KB * 1 1.2 MB * 2 720 KB * 3 1.44 MB - * 4 1.232 MB (PC/98 1K sectors) - * 5 2.88 MB - * - * Warning: drive will be reported as 2880 KB at bootup if you've set it - * as unknown (4). Floppy probe will detect correct floppy format at each - * change so don't bother with that + * 4 2.88 MB (QEMU) + * 5 2.88 MB (Dosbox) + * 6 1.232 MB (PC/98 1K sectors) + * ndrives is number of drives in your system (either 0, 1 or 2) */ + int ndrives = FD_DRIVES; + #ifdef CONFIG_ARCH_PC98 #if defined(CONFIG_IMG_FD1232) drivep[0] = fd_types[FD1232]; drivep[1] = fd_types[FD1232]; drivep[2] = fd_types[FD1232]; drivep[3] = fd_types[FD1232]; -#elif defined(CONFIG_IMG_FD1440) +#else drivep[0] = fd_types[FD1440]; drivep[1] = fd_types[FD1440]; drivep[2] = fd_types[FD1440]; - drivep[FD1440] = fd_types[FD1440]; + drivep[3] = fd_types[FD1440]; #endif #endif diff --git a/elks/arch/i86/drivers/block/bioshd.c b/elks/arch/i86/drivers/block/bioshd.c index d8150725c..49f470a7d 100644 --- a/elks/arch/i86/drivers/block/bioshd.c +++ b/elks/arch/i86/drivers/block/bioshd.c @@ -364,7 +364,7 @@ void INITPROC bioshd_init(void) /* FIXME perhaps remove for speed on floppy boot*/ outb_p(0x0C, FDC_DOR); /* FD motors off, enable IRQ and DMA*/ -#ifdef CONFIG_BLK_DEV_BFD +#if defined(CONFIG_BLK_DEV_BFD) || defined(CONFIG_BLK_DEV_BFD_HARD) fd_count = bios_getfdinfo(&drive_info[DRIVE_FD0]); #endif #ifdef CONFIG_BLK_DEV_BHD