From e73fb1f303dadca98c89e07b5cd512d05eb878cf Mon Sep 17 00:00:00 2001 From: Tyler McGurrin Date: Fri, 30 May 2025 07:04:03 -0400 Subject: [PATCH] More Floppy Stuff --- src/kernel/dri/disk/floppy.c | 24 ++++++++++++++++++++++++ src/kernel/dri/disk/floppy.h | 3 ++- src/kernel/main.c | 12 +++++++++++- src/libs/version.h | 2 +- 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/kernel/dri/disk/floppy.c b/src/kernel/dri/disk/floppy.c index 07369ca..cbb2150 100644 --- a/src/kernel/dri/disk/floppy.c +++ b/src/kernel/dri/disk/floppy.c @@ -34,4 +34,28 @@ int Master_FDD_Detect() i++; } return FDDType; +} + +int Slave_FDD_Detect() +{ + int Buffer; + int FDDType; + /* FDD Drive Values + Value: Drive Type: + 00h no drive + 01h 360 KB 5.25 Drive + 02h 1.2 MB 5.25 Drive + 03h 720 KB 3.5 Drive + 04h 1.44 MB 3.5 Drive + 05h 2.88 MB 3.5 drive*/ + Buffer = i686_inb(PORT_FLOPPY_TYPE); + + int bit = Byte_Parse(Buffer, 4); + int i = 5; + while(i < 8) { + FDDType = bit & bit; + bit = Byte_Parse(Buffer, i); + i++; + } + return FDDType; } \ No newline at end of file diff --git a/src/kernel/dri/disk/floppy.h b/src/kernel/dri/disk/floppy.h index cda5ab4..019ef93 100644 --- a/src/kernel/dri/disk/floppy.h +++ b/src/kernel/dri/disk/floppy.h @@ -5,4 +5,5 @@ \*----------------*/ #pragma once -int Master_FDD_Detect(); \ No newline at end of file +int Master_FDD_Detect(); +int Slave_FDD_Detect(); \ No newline at end of file diff --git a/src/kernel/main.c b/src/kernel/main.c index a8e6c4c..a442920 100644 --- a/src/kernel/main.c +++ b/src/kernel/main.c @@ -25,6 +25,7 @@ extern uint8_t __bss_start; extern uint8_t __end; int masterFDDType; +int slaveFDDType; int uptime; void timer(Registers* regs) @@ -65,8 +66,17 @@ void __attribute__((section(".entry"))) start(BootParams* bootParams) { printf("Load Basic Storage Drivers..."); masterFDDType = Master_FDD_Detect(); + slaveFDDType = Slave_FDD_Detect(); printf("Done!\n"); - printf("Master FDD Type: %d", masterFDDType); + // Nightmare to print the Storage Types. + // Im gonna Make a Full Function For Showing ATA and FDD Types in Util.h later on, + // this IS temporary. + if (masterFDDType == 0) printf("No Master Floppy Drive Detected!\n"); + if (masterFDDType == 1) printf("Master Floppy Drive Detected!\nType: 360 KB 5.25 Inch Drive\n"); + if (masterFDDType == 2) printf("Master Floppy Drive Detected!\nType: 1.2 MB 5.25 Inch Drive\n"); + if (masterFDDType == 3) printf("Master Floppy Drive Detected!\nType: 720 KB 3.5 Inch Drive\n"); + if (masterFDDType == 4) printf("Master Floppy Drive Detected!\nType: 1.44 MB 3.5 Inch Drive\n"); + if (masterFDDType == 5) printf("Master Floppy Drive Detected!\nType: 2.88 MB 3.5 Inch Drive\n"); // Debug Info for Memory :3 i REALLY need to make a like serial debug output thingy diff --git a/src/libs/version.h b/src/libs/version.h index e14ea7c..714dd03 100644 --- a/src/libs/version.h +++ b/src/libs/version.h @@ -6,5 +6,5 @@ #pragma once // Version Info MUST stay on line 9! (it gets incremented on build!) #define LOGO " _ _____ _ __________________\n / | / / | / | / / _/_ __/ ____/\n / |/ / /| | / |/ // / / / / __/ \n / /| / ___ |/ /| // / / / / /___ \n/_/ |_/_/ |_/_/ |_/___/ /_/ /_____/ \n" -#define VERSION "RD-00008" +#define VERSION "RD-00010" #define BOOTLOGO " _ ______ ____ ____ ______\n / | / / __ )/ __ \\/ __ /_ __/\n / |/ / __ / / / / / / // / \n / /| / /_/ / /_/ / /_/ // / \n/_/ |_/_____/\\____/\\____//_/ \n"