summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Travis <harleytravis123@outlook.com>2026-05-29 16:58:12 -0500
committerHarley Travis <harleytravis123@outlook.com>2026-05-29 16:58:12 -0500
commit5c1cd605a1ad2b5428576078bf812f4d9b65f4b7 (patch)
treeaa0bad8be2ac62b3c3fa85512f6d3a01ca6dcfa6
parent32673d5872a2c77c2cc70a14a1e50cd440bc0180 (diff)
downloadtempleos-floppy-driver-5c1cd605a1ad2b5428576078bf812f4d9b65f4b7.tar.gz
Update KFloppy.HC
I fixed the read and write functions so that they correctly check the status of the controller before performing the write (hopefully).
-rw-r--r--Kernel/KFloppy.HC4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/KFloppy.HC b/Kernel/KFloppy.HC
index 16b6bd3..059e821 100644
--- a/Kernel/KFloppy.HC
+++ b/Kernel/KFloppy.HC
@@ -95,7 +95,7 @@ U0 FDCSendCmd(U16 base, U8 cmd)
U64 i;
for (i = 0; i < 600; i++) {
Sleep(10);
- if (0x80 & InU8(base + FDC_MSR_DSR)) {
+ if (InU8(base + FDC_MSR_DSR) >> 6 == 2) {
OutU8(base + FDC_DATA, cmd);
Sleep(1);
return;
@@ -112,7 +112,7 @@ U8 FDCReadData(U16 base)
U64 i;
for (i=0;i<600;i++) {
Sleep(10);
- if (0x80 & InU8(base + FDC_MSR_DSR)) {
+ if (InU8(base + FDC_MSR_DSR) >> 6 == 3) {
return InU8(base + FDC_DATA);
}
}