From 04d039d43164f48f5266d32e783d11f166b6161c Mon Sep 17 00:00:00 2001 From: Harley Travis Date: Sat, 23 May 2026 23:17:07 -0500 Subject: Initial commit (TOSFloppy-2025-04-17.zip) This is taken from the earliest Discord release of the TempleOS floppy disk driver, released on April 17, 2025. --- ReadMe.TXT | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ReadMe.TXT (limited to 'ReadMe.TXT') diff --git a/ReadMe.TXT b/ReadMe.TXT new file mode 100644 index 0000000..9e2970a --- /dev/null +++ b/ReadMe.TXT @@ -0,0 +1,27 @@ +These files contain the code required for the low-level floppy disk driver. +Currently, there is no block device code that implements this driver. + +System source files from my system are included as a reference. + +To install the driver: +1. Copy Floppy.HC and Floppy.HH to the Kernel directory +2. Copy the headers at the bottom of the provided KernelC.HC into *your* KernelC. +3. Add "U8 FDC_DMA[0x4800];" to the bottom of KStart32.HC; This is the DMA buffer for the floppy disk (yeah, I know, DMA = blasphemy, but it's more reliable than PIO while being just as simple). +4. Add Floppy.HC and Floppy.HH to Kernel.PRJ so that they will be compiled into the kernel. + +On startup, you will have to unmask IRQ6 and point its int to the IRQ handler, FDCIrqHandler. +To do this, write 0xB8 to port 0x21, then use IntEntrySet to set the vector for the aforementioned int. +In HolyC, that would be: +OutU8(0x21,0xB8); +IntEntrySet(0x26,&FDCIrqHandler,IDTET_IRQ); + +Use FDCReset to initialize the drive (make sure a disk is inserted; it does not test for one before doing things) + +FDCSeek does what it says. + +FDCRead/FDCReadMulti will read data from the disk. +FDCWrite/FDCWriteMulti will write data to the disk. +Data that has been read or is to be written goes in FDC_DMA. +(The FDC*Multi funs use multi-track mode; data will be read from both heads) + +The result of seeks, recalibrations, and data xfers will be displayed in the Adam Task. -- cgit v1.2.3