summaryrefslogtreecommitdiff
path: root/Kernel/BlkDev/Patches
diff options
context:
space:
mode:
authorHarley Travis <harleytravis123@outlook.com>2026-06-20 20:00:32 -0500
committerHarley Travis <harleytravis123@outlook.com>2026-06-20 20:00:32 -0500
commitedd15150f34b040d5ab68a1b418705c0de895a1e (patch)
tree0f0c7fc7d4440b76607169cf33dd3e3267b6e44a /Kernel/BlkDev/Patches
parent26fd4c3343fb5a55ac8b305a6adea3212e3d7fdd (diff)
downloadtempleos-floppy-driver-edd15150f34b040d5ab68a1b418705c0de895a1e.tar.gz
Re-arrange patch files
Some of the patches are applied to files in subdirectories of ::/Kernel and ::/Adam. The directory tree has been re-arranged in such a way as to allow them to be #included without having the compiler backtrack to their parent directory.
Diffstat (limited to 'Kernel/BlkDev/Patches')
-rw-r--r--Kernel/BlkDev/Patches/BlkDevAddFDC.HC28
-rw-r--r--Kernel/BlkDev/Patches/BlkDevInitFDC.HC8
-rw-r--r--Kernel/BlkDev/Patches/Let2BlkDevTypeFDC.HC22
3 files changed, 58 insertions, 0 deletions
diff --git a/Kernel/BlkDev/Patches/BlkDevAddFDC.HC b/Kernel/BlkDev/Patches/BlkDevAddFDC.HC
new file mode 100644
index 0000000..1f9e75a
--- /dev/null
+++ b/Kernel/BlkDev/Patches/BlkDevAddFDC.HC
@@ -0,0 +1,28 @@
+// PATCH: Add the ability to create floppy drvs
+// FILE: ::/Kernel/BlkDev/DskAddDev.HC
+// TO INSTALL: #include this file at the end of the switch statement.
+
+case BDT_FLOPPY:
+ dv->dv_signature=DRV_SIGNATURE_VAL;
+ if (!BlkDevInit(bd))
+ dv->dv_signature=0;
+ else {
+ dv->dv_signature=0;
+ if (make_free)
+ dv=DrvMakeFreeSlot(bd->first_drive_let);
+ else
+ dv=DrvMakeFreeSlot(DrvNextFreeLet(bd->first_drive_let))
+ if (bd->heads!=FDCChk(bd))
+ dv->fs_type=FSt_UNKNOWN;
+ else {
+ FDCReadBlks(bd,&br,0,1);
+ if (br.signature==MBR_PT_REDSEA && br.signature2==0xAA55) {
+ dv->dv_signature=DRV_SIGNATURE_VAL;
+ dv->bd=bd;
+ dv->fs_type=FSt_REDSEA;
+ RedSeaInit(dv);
+ } else
+ dv->fs_type=FSt_UNKNOWN;
+ }
+ }
+ break; \ No newline at end of file
diff --git a/Kernel/BlkDev/Patches/BlkDevInitFDC.HC b/Kernel/BlkDev/Patches/BlkDevInitFDC.HC
new file mode 100644
index 0000000..630bad8
--- /dev/null
+++ b/Kernel/BlkDev/Patches/BlkDevInitFDC.HC
@@ -0,0 +1,8 @@
+// PATCH: Add the ability to init floppy BlkDevs
+// FILE: ::/Kernel/BlkDev/DskBlkDev.HC
+// TO INSTALL: #include this file at the end of the switch statement.
+
+case BDT_FLOPPY:
+ bd->max_writes=bd->max_reads=bd->spt;
+ res=FDCInit(bd);
+ break; \ No newline at end of file
diff --git a/Kernel/BlkDev/Patches/Let2BlkDevTypeFDC.HC b/Kernel/BlkDev/Patches/Let2BlkDevTypeFDC.HC
new file mode 100644
index 0000000..be31e7f
--- /dev/null
+++ b/Kernel/BlkDev/Patches/Let2BlkDevTypeFDC.HC
@@ -0,0 +1,22 @@
+// PATCH: Remaps ltrs W-Z for floppy drives
+// FILE: ::/Kernel/BlkDev/DskDrv.HC
+// TO INSTALL: Comment out the original function.
+// THEN: #include this file after it.
+
+I64 Let2BlkDevType(U8 drv_let)
+{//Drv letter to BlkDev Type. drv_let=0 not allowed. See BDT_NULL.
+ drv_let=Let2Let(drv_let);
+ if ('A'<=drv_let<='B')
+ return BDT_RAM;
+ if ('C'<=drv_let<='L')
+ return BDT_ATA;
+ if ('M'<=drv_let<='P')
+ return BDT_ISO_FILE_READ;
+ if ('Q'<=drv_let<='S')
+ return BDT_ISO_FILE_WRITE;
+ if ('T'<=drv_let<='V')
+ return BDT_ATAPI;
+ if ('W'<=drv_let<='Z')
+ return BDT_FLOPPY;
+ return BDT_NULL;
+} \ No newline at end of file