diff options
| -rw-r--r-- | ChangeLog.TXT | 20 | ||||
| -rw-r--r-- | DskImg.HC | 9 | ||||
| -rw-r--r-- | KFloppy.HC | 11 | ||||
| -rw-r--r-- | KFloppyA.HH | 60 | ||||
| -rw-r--r-- | KFloppyB.HH | 7 | ||||
| -rw-r--r-- | KFloppyDMA.HC | 7 | ||||
| -rw-r--r-- | ReadMe.TXT | 14 |
7 files changed, 99 insertions, 29 deletions
diff --git a/ChangeLog.TXT b/ChangeLog.TXT index 1059101..3e12b81 100644 --- a/ChangeLog.TXT +++ b/ChangeLog.TXT @@ -1,9 +1,21 @@ +2026-05-24:
+I updated the copyright statements to match those on the WTFPL FAQ, completed
+the flags for the ST2 and ST3 in KFloppyA.HH, updating the copyright notice
+accordingly, and adjusted it (and this changelog) to fit in 80 columns.
+
+2026-05-23:
+I placed the driver into version control on a Git server I set up.
+
2025-04-18:
-I had a brain fart and forgot to revert the hard-coded DMA buffer address, as pointed out by TheTinkerer on the TOS Discord.
-I went ahead and uncommented the stuff for splitting up the address, and fixed the base address I/O writes.
-If you have installed the driver, just replace NewFloppy.HC and recompile the kernel; you should be good after that.
+I had a brain fart and forgot to revert the hard-coded DMA buffer address, as
+pointed out by TheTinkerer on the TOS Discord. I went ahead and uncommented the
+stuff for splitting up the address, and fixed the base address I/O writes. If
+you have installed the driver, just replace NewFloppy.HC and recompile the
+kernel; you should be good after that.
+
Whoops!
2025-04-20 (hah! weed.):
Moved some stuff out of the system files to make things a bit less of a mess.
-Also I added a copyright notice to the readme (you can still do what the fuck you want to; see Copying.TXT).
\ No newline at end of file +Also I added a copyright notice to the readme (you can still do what the fuck
+you want to; see Copying.TXT).
@@ -4,6 +4,13 @@ #define IMG_SIZE 1474560 /* + Copyright (C) 2025 Harley Travis <yoshi128k@gmail.com>. + This work is free. You can redistribute it and/or modify it under the + terms of the Do What The Fuck You Want To Public License, Version 2, + as published by Sam Hocevar. See the Copying.TXT file for more details. +*/ + +/* Make sure IRQ6 is on and pointed to the correct handler! @@ -64,4 +71,4 @@ U8 DskImg() return 0; } -DskImg;
\ No newline at end of file +DskImg; @@ -1,8 +1,9 @@ /* - New, (hopefully) Less Messy Floppy Driver - Copyright (C) 2025 Yoshi128k. - Licensed under version 2 of the Do What The Fuck You Want To Public License - See COPYING for details. + New, (hopefully) Less Messy Floppy Driver + Copyright (C) 2025 Harley Travis <yoshi128k@gmail.com>. + This work is free. You can redistribute it and/or modify it under the + terms of the Do What The Fuck You Want To Public License, Version 2, + as published by Sam Hocevar. See the Copying.TXT file for more details. */ Bool FDCIrq = FALSE; @@ -474,4 +475,4 @@ U0 FDCWriteMulti(U16 base, U8 cyl, U8 head, U8 sect, U8 trklen) AdamLog("Read Results:\nST0: %d\nST1: %d\nST2: %d\nCyl: %d\nHead: %d\nSect: %d\nSect Size: %d\n",st0,st1,st2,rcyl,rhd,rsect,rsectsize); FDCMotorCtrl(base, FDC_MOTOR_OFF); -}
\ No newline at end of file +} diff --git a/KFloppyA.HH b/KFloppyA.HH index 4e5cfdb..6eb4321 100644 --- a/KFloppyA.HH +++ b/KFloppyA.HH @@ -1,3 +1,10 @@ +/* + Copyright (C) 2026 Harley Travis <yoshi128k@gmail.com>. + This work is free. You can redistribute it and/or modify it under the + terms of the Do What The Fuck You Want To Public License, Version 2, + as published by Sam Hocevar. See the Copying.TXT file for more details. +*/ + // FDC uses IRQ6 = int 26h #define I_FDC 0x26 #define IRQ_FDC 6 @@ -53,7 +60,8 @@ // other DOR flags #define FDC_DOR_DMA 0x08 // DMA2/IRQ6 On/Off -#define FDC_DOR_REST 0x04 // Controller Reset: this is active low; 1 = normal, 0 = reset +#define FDC_DOR_REST 0x04 // Controller Reset: this is active low; + // 1 = normal, 0 = reset // DOR drive select (DOR & 0x03): selects drive 0-3 @@ -79,20 +87,52 @@ */ #define FDC_ST0_SEEK_END 0x20 // Seek End: seek/calibration completed -#define FDC_ST0_UNIT_CHK 0x10 // Unit Check: drive encountered a fault or recalibration failed +#define FDC_ST0_UNIT_CHK 0x10 // Unit Check: drive encountered a fault + // or recalibration failed #define FDC_ST0_NOT_RDY 0x08 // Not Ready: self-explanatory #define FDC_ST0_HEAD 0x04 // Active Head // ST0 unit select (ST0 & 0x03): same fmt as DOR drive select // Status Register 1 (ST1) flags -#define FDC_ST1_END_CYL 0x80 // End of Cylinder: set when sector count > sectors on track +#define FDC_ST1_END_CYL 0x80 // End of Cylinder: + // set when sector count > sectors on track // 0x40 is unused -#define FDC_ST1_DATA_ERR 0x20 // Data Error: set when an error is detected in a sector's data or ID fields -#define FDC_ST1_TIMEOUT 0x10 // Timeout: set when a data overrun occurs (i.e. the system is not reading data fast enough) +#define FDC_ST1_DATA_ERR 0x20 // Data Error: set when an error is + // detected in a sector's data or ID fields +#define FDC_ST1_TIMEOUT 0x10 // Timeout: set when a data overrun or + // underrun occurs (i.e. the system is not + // reading data fast enough) // 0x08 is unused -#define FDC_ST1_NO_DATA 0x04 // No Data: set when either a sector cannot be read, or an ID cannot be successfully read, or if the sector sequence cannot be determined -#define FDC_ST1_NO_WRITE 0x02 // Not Writable: set when attempting to write to a write-protected disk -#define FDC_ST1_NO_ID 0x01 // No Addr. Mark: set when an ID/(deleted) data address mark cannot be found. - -// Status Register 2 (ST2) flags
\ No newline at end of file +#define FDC_ST1_NO_DATA 0x04 // No Data: set when either a sector cannot + // be read, or an ID cannot be successfully + // read, or if the sector sequence cannot + // be determined +#define FDC_ST1_NO_WRITE 0x02 // Not Writable: set when attempting to + // write to a write-protected disk +#define FDC_ST1_NO_ID 0x01 // No Addr. Mark: set when an ID/(deleted) + // data address mark cannot be found. + +// Status Register 2 (ST2) flags +// 0x80 is unused +#define FDC_ST2_DEL_ADDR_MRK 0x40 // Deleted Addr. Mark: set when a deleted + // DAM or valid DAM is detected during RS + // or RDS, respectively +#define FDC_ST2_CRC_ERR 0x20 // CRC Error: self explanatory +#define FDC_ST2_WRONG_CYL 0x10 // Wrong cyl.: set when the ctrlr cyl does + // not match that in the ID addr mrk +// 0x08 and 0x04 are unused +#define FDC_ST2_BAD_CYL 0x02 // Bad Cylinder: set when track addr in + // sector does not match that on the ctrlr + // and equals 0xFF (meaning it is bad) +#define FDC_ST2_MISSING_DATA 0x01 // Missing Data: set when no DAM or DDAM + // can be found + +// Status Register 3 (ST3) flags +// 0x80 is unused +#define FDC_ST3_W_PROT 0x40 // Write Protected: self explanatory +// 0x20 is unused +#define FDC_ST3_TRK_0 0x10 // Track 0: ditto +// 0x08 is unused +#define FDC_ST3_HEAD_ADDR 0x04 // Head Address: ditto +// 0x02 and 0x01 are drive select diff --git a/KFloppyB.HH b/KFloppyB.HH index 7fb9e36..f046126 100644 --- a/KFloppyB.HH +++ b/KFloppyB.HH @@ -1,3 +1,10 @@ +/*
+ Copyright (C) 2025 Harley Travis <yoshi128k@gmail.com>.
+ This work is free. You can redistribute it and/or modify it under the
+ terms of the Do What The Fuck You Want To Public License, Version 2,
+ as published by Sam Hocevar. See the Copying.TXT file for more details.
+*/
+
// headers for floppy driver
public extern Bool FDCIrq;
public extern U16 fdc_base;
diff --git a/KFloppyDMA.HC b/KFloppyDMA.HC index bde62ff..9b2e963 100644 --- a/KFloppyDMA.HC +++ b/KFloppyDMA.HC @@ -1 +1,8 @@ +/*
+ Copyright (C) 2025 Harley Travis <yoshi128k@gmail.com>.
+ This work is free. You can redistribute it and/or modify it under the
+ terms of the Do What The Fuck You Want To Public License, Version 2,
+ as published by Sam Hocevar. See the Copying.TXT file for more details.
+*/
+
U8 FDC_DMA[0x4800]; // Floppy DMA buffer
@@ -1,11 +1,7 @@ -Copyright (c) 2025 Yoshi128k. -The source code included in this package is licensed under Version 2 -of the Do What The Fuck You Want To Public License; the exact distribution -terms are described in Copying.TXT. -The driver and all demonstration software included with this software package comes -with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. - - +Copyright (C) 2025 Harley Travis <yoshi128k@gmail.com>. +This work is free. You can redistribute it and/or modify it under the +terms of the Do What The Fuck You Want To Public License, Version 2, +as published by Sam Hocevar. See the Copying.TXT file for more details. These files contain the code required for the low-level floppy disk driver. Currently, there is no block device code that implements this driver as I @@ -51,4 +47,4 @@ This is a bit ambiguous, as there are two principle forms of DMA in the PC world 2. PCI Busmastering, which is used by modern hardware and is very different from ISA DMA. TheTinkerer on the TOS Discord suggested that Terry *may* have been fine ISA DMA, but I would still -consider my usage of it to be at least a little blasphemous (though it is not mentioned in the Charter).
\ No newline at end of file +consider my usage of it to be at least a little blasphemous (though it is not mentioned in the Charter). |
