From df69f7479cc77f49f252b9c307af9383431f161d Mon Sep 17 00:00:00 2001 From: Tyler McGurrin Date: Fri, 30 May 2025 20:30:37 -0400 Subject: [PATCH] More Floppy Driver Stuff, Can Confirm That the Standard is infact Ugly --- src/kernel/dri/cmos.h | 2 -- src/kernel/dri/disk/floppy.c | 21 ++++++--------------- src/kernel/dri/disk/floppy.h | 4 +++- src/kernel/main.c | 1 + src/kernel/util/binary.h | 1 + src/libs/version.h | 2 +- 6 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/kernel/dri/cmos.h b/src/kernel/dri/cmos.h index ed5f65e..e02ad26 100644 --- a/src/kernel/dri/cmos.h +++ b/src/kernel/dri/cmos.h @@ -7,8 +7,6 @@ #include -#define BCD2BIN(bcd) ((((bcd)&15) + ((bcd)>>4)*10)) - void CMOS_RTC_Handler(); int Master_FDD_Detect(); int Slave_FDD_Detect(); diff --git a/src/kernel/dri/disk/floppy.c b/src/kernel/dri/disk/floppy.c index eea6bf4..fd54665 100644 --- a/src/kernel/dri/disk/floppy.c +++ b/src/kernel/dri/disk/floppy.c @@ -10,23 +10,14 @@ #include #include -#define PORT_FLOPPY_TYPE 0x10 - void Floppy_Handler() { printf("IRQ 6 Called"); } - - - - -// I cannot get this to work for the life of me, -// OSDEV Wiki says its meant to be CMOS Register 0x10, which seems to be 0xFF for me... -// 0xFF, is NOT a vaild value at all... -// Basically Gonna hard-code the driver for 1.44MB Drives -// Since Nanite is only capable of running off one without modifications to the bootloader, -// this is not an issue... but its sure as shit annoying -// Correction im stupid... - -// Moved to CMOS Driver. \ No newline at end of file +void Floppy_Drive_Start(uint8_t drive) +{ + uint8_t Buffer; + if (drive == 1) Buffer = 0 && DOR_DSEL1 && DOR_RESET && DOR_MOTA && 0 && 0 && 0; + if (drive == 2) Buffer = 0 && DOR_DSEL1 && DOR_RESET && 0 && DOR_MOTB && 0 && 0; +} \ No newline at end of file diff --git a/src/kernel/dri/disk/floppy.h b/src/kernel/dri/disk/floppy.h index 26e1a9b..52ce644 100644 --- a/src/kernel/dri/disk/floppy.h +++ b/src/kernel/dri/disk/floppy.h @@ -5,8 +5,10 @@ \*----------------*/ #pragma once -void Floppy_Handler(); +#include +void Floppy_Handler(); +void Floppy_Drive_Start(uint8_t drive); /* DOR Command Table diff --git a/src/kernel/main.c b/src/kernel/main.c index a916dcc..70f6a45 100644 --- a/src/kernel/main.c +++ b/src/kernel/main.c @@ -70,6 +70,7 @@ void __attribute__((section(".entry"))) start(BootParams* bootParams) { printf("Done!\n"); masterFDDType = Master_FDD_Detect(); slaveFDDType = Slave_FDD_Detect(); + Floppy_Drive_Start(1); Print_Storage_Types(masterFDDType, slaveFDDType); diff --git a/src/kernel/util/binary.h b/src/kernel/util/binary.h index 778024f..e08812d 100644 --- a/src/kernel/util/binary.h +++ b/src/kernel/util/binary.h @@ -7,6 +7,7 @@ #define FLAG_SET(x, flag) x |= (flag) #define FLAG_UNSET(x, flag) x &= ~(flag) +#define BCD2BIN(bcd) ((((bcd)&15) + ((bcd)>>4)*10)) uint8_t Get_Bit(uint8_t bits, uint8_t pos); diff --git a/src/libs/version.h b/src/libs/version.h index def3e67..86d9a11 100644 --- a/src/libs/version.h +++ b/src/libs/version.h @@ -6,5 +6,5 @@ #pragma once #define LOGO " _ _____ _ __________________\n / | / / | / | / / _/_ __/ ____/\n / |/ / /| | / |/ // / / / / __/ \n / /| / ___ |/ /| // / / / / /___ \n/_/ |_/_/ |_/_/ |_/___/ /_/ /_____/ \n" -#define VERSION "RD-00014" +#define VERSION "RD-00015" #define BOOTLOGO " _ ______ ____ ____ ______\n / | / / __ )/ __ \\/ __ /_ __/\n / |/ / __ / / / / / / // / \n / /| / /_/ / /_/ / /_/ // / \n/_/ |_/_____/\\____/\\____//_/ \n"