summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorHarley Travis <harleytravis123@outlook.com>2026-06-27 12:03:57 -0500
committerHarley Travis <harleytravis123@outlook.com>2026-06-27 12:03:57 -0500
commitb7534feecbd2a4d25eaaaaf2a6249392408adfae (patch)
tree30a4b1981f0b5d4e9981138db2df735ae8dc5c5a /Kernel
parente09e93fdb3ba8895be3a5a2764d48bd31d404275 (diff)
downloadtempleos-floppy-driver-b7534feecbd2a4d25eaaaaf2a6249392408adfae.tar.gz
Update FDCReadData and FDCWriteData
FDCReadData and FDCWriteData were patched to use 64-bit variables, and to send the read/write commands in the correct format.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/BlkDev/DskFDC.HC10
1 files changed, 6 insertions, 4 deletions
diff --git a/Kernel/BlkDev/DskFDC.HC b/Kernel/BlkDev/DskFDC.HC
index 39aca31..564f0c7 100644
--- a/Kernel/BlkDev/DskFDC.HC
+++ b/Kernel/BlkDev/DskFDC.HC
@@ -251,14 +251,15 @@ Bool FDCInit(CBlkDev *bd)
U8 FDCWriteData(CBlkDev *bd,U8 cyl,Bool head,U8 start,U8 end)
{
U16 length=(end-start+1)*bd->blk_size;
- U8 st0,st1,st2,pcn,hd,sect,size
+ U64 st0,st1,st2,pcn,hd,sect,size
fdc_int_semaphore=FALSE;
FDCDMAInit(length);
FDCDMAPrepWrite();
- FDCSendByte(bd,FDC_WRITE_DATA|(bd->heads>1<<7)|mfm<<6|);
+ FDCSendByte(bd,FDC_WRITE_DATA|bd->mfm<<6);
+ FDCSendByte(bd,head<<2|bd->unit);
FDCSendByte(bd,cyl);
FDCSendByte(bd,head);
FDCSendByte(bd,start);
@@ -283,14 +284,15 @@ U8 FDCWriteData(CBlkDev *bd,U8 cyl,Bool head,U8 start,U8 end)
U8 FDCReadData(CBlkDev *bd,U8 cyl,Bool head,U8 start,U8 end)
{
U16 length=(end-start+1)*bd->blk_size;
- U8 st0,st1,st2,pcn,hd,sect,size
+ U64 st0,st1,st2,pcn,hd,sect,size
fdc_int_semaphore=FALSE;
FDCDMAInit(length);
FDCDMAPrepRead();
- FDCSendByte(bd,FDC_READ_DATA|mfm<<6|);
+ FDCSendByte(bd,FDC_READ_DATA|bd->mfm<<6);
+ FDCSendByte(bd,head<<2|bd->unit);
FDCSendByte(bd,cyl);
FDCSendByte(bd,head);
FDCSendByte(bd,start); // sector is ignored