OUT=out/
# Source files
-SRCBOTH=output.c util.c ata.c kbd.c pci.c boot.c
-SRC16=$(SRCBOTH) floppy.c disk.c system.c clock.c serial.c mouse.c \
+SRCBOTH=output.c util.c floppy.c ata.c kbd.c pci.c boot.c
+SRC16=$(SRCBOTH) disk.c system.c clock.c serial.c mouse.c \
cdrom.c apm.c pcibios.c
SRC32=$(SRCBOTH) post.c rombios32.c post_menu.c
TABLESRC=font.c cbt.c floppy_dbt.c
// floppy.c
extern struct floppy_ext_dbt_s diskette_param_table2;
+void floppy_drive_setup();
void floppy_13(struct bregs *regs, u8 drive);
void floppy_tick();
.drive_type = 4, // drive type in cmos
};
+void
+floppy_drive_setup()
+{
+ u8 type = inb_cmos(CMOS_FLOPPY_DRIVE_TYPE);
+ u8 out = 0;
+ if (type & 0xf0)
+ out |= 0x07;
+ if (type & 0x0f)
+ out |= 0x70;
+ SET_BDA(floppy_harddisk_info, out);
+ outb(0x02, PORT_DMA1_MASK_REG);
+}
+
// Oddities:
// Return codes vary greatly - AL not cleared consistenlty, BDA return
// status not set consistently, sometimes panics.
#include "cmos.h" // CMOS_*
#include "util.h" // memset
#include "biosvar.h" // struct bios_data_area_s
-#include "ata.h"
-#include "kbd.h"
+#include "ata.h" // ata_detect
+#include "kbd.h" // kbd_setup
+#include "disk.h" // floppy_drive_setup
#define bda ((struct bios_data_area_s *)MAKE_FARPTR(SEG_BDA, 0))
#define ebda ((struct extended_bios_data_area_s *)MAKE_FARPTR(SEG_EBDA, 0))
SET_BDA(ivecs[0x74].offset, OFFSET_entry_74);
SET_BDA(ivecs[0x75].offset, OFFSET_entry_75);
SET_BDA(ivecs[0x10].offset, OFFSET_entry_10);
+
+ SET_BDA(ivecs[0x1E].offset, OFFSET_diskette_param_table2);
}
static void
outb(0x9f, PORT_PIC2_DATA);
}
-static void
-floppy_drive_post()
-{
- u8 type = inb_cmos(CMOS_FLOPPY_DRIVE_TYPE);
- u8 out = 0;
- if (type & 0xf0)
- out |= 0x07;
- if (type & 0x0f)
- out |= 0x70;
- SET_BDA(floppy_harddisk_info, out);
- outb(0x02, PORT_DMA1_MASK_REG);
-
- SET_BDA(ivecs[0x1E].offset, OFFSET_diskette_param_table2);
-}
-
static void
ata_init()
{
rombios32_init();
- floppy_drive_post();
+ floppy_drive_setup();
hard_drive_post();
if (CONFIG_ATA) {
ata_init();