From 8abc33c70bd507bdb3193323be306914c4b804b7 Mon Sep 17 00:00:00 2001 From: Gregory Bowne Date: Fri, 19 Dec 2025 15:29:08 -0800 Subject: [PATCH] Create floppy.h floppy driver that works with the fat12 implementation --- kernel/floppy.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 kernel/floppy.h diff --git a/kernel/floppy.h b/kernel/floppy.h new file mode 100644 index 0000000..2483819 --- /dev/null +++ b/kernel/floppy.h @@ -0,0 +1,19 @@ +#ifndef FLOPPY_H +#define FLOPPY_H + +#include + +#define FDC_DOR 0x3F2 +#define FDC_MSR 0x3F4 +#define FDC_FIFO 0x3F5 +#define FDC_CCR 0x3F7 + +// Geometry for 1.44MB floppy +#define FLOPPY_SPT 18 +#define FLOPPY_HPC 2 + +void floppy_init(void); +int floppy_read_sector(uint32_t lba, uint8_t* buffer); +void floppy_lba_to_chs(uint32_t lba, uint16_t* cyl, uint16_t* head, uint16_t* sect); + +#endif