Reverse engineering a forgotten 1970s Intel dual core beast: 8271 (2020)
scarybeastsecurity.blogspot.com
scarybeastsecurity.blogspot.com
The chip accepts commands like "seek to track xyz", "format track", "read track", or "read or write a range of sectors", and the chip would go ahead and do its thing (with data transfers optionally via DMA - but this isn't supported in the CPC) and a couple of seconds later it would tell you "ok I'm done", or "oops I encountered this error".
One would rather expect this sort of functionality implemented in a high level operating system function or in some sort of software driver instead of baked into hardware. This also explains the chip's complexity I guess (e.g. 22k transistors, 6x more than a 6502 and 2.5x more than a Z80) - because it actually is a fullblown CPU with a microcode ROM and some floppy controller bits tacked on the side ;)
Commodore had these complicated chips too - for example the 1541 disk drive had the same 6502 CPU as the C64! They were able to compete on the price in the 80s by the virtue of owning their chief chip supplier, MOS Techonology.
http://www.amoretro.de/2012/05/386sxa-ver-4-0-motherboard-mi...
https://theretroweb.com/motherboards/s/ampro-little-board-48...
Commodore disk drives on the other hand were more high level. They operated at a level closer to that of a file server, and would field commands such as "list the directory". The DOS ran on the drive itself.
Almost counterintuitively, floppy drives were actually very fast compared to the CPUs early on. The DMA transfers were more to bypass the CPU than anything. For the CHS addressing some formats would implement interleave of the sectors (ie: 1,6,2,7,3,8,4,9,5). This would purposefully space sequential data apart so the CPU would have time to process it while passing over out of sequence data before encountering the next section of it. Putting more load on the CPU compounds this and was why dedicated FDC chips never went away.
Also fun fact,the usage of the ISA DMA interface is why you can't have full featured native floppy controllers on modern motherboards, that doesn't exist any more.
DMA and FDC controller functionality got taken over by chipsets. ISA became the LPC bus, which still exists - and I believe will keep existing, because TPMs use it. But not sure if modern PCHs include the ISA DMA functionality any more. The floppy was really the only thing that used it.
PC floppies don't have to use DMA, they can use PIO.
So ...
- you need to create a PIO floppy driver for your OS
- you need something that takes floppy controller signals and converts them to LPC (signaling is not the same) and something like that doesn't exist (FPGA hobby project to the rescue)
- you need to wiire that into a modern PC's LPC bus, meaning you need to physically connect those LPC pins to an LPC debug header on your motherboard (if it has one-and if it does, you probably have to add header pins)
- then you need to do something to convert SATA power from the PSU to the floppy's four-pin mini-Molex. I think there's big Molex (IDE hard drives) to double-mini-Molex so with a SATA-to-Molex adapter you can "frakenstein" that.
>ISA became the LPC bus, which still exists - and I believe will keep existing, because TPMs
already superseded by almost 10 year old eSPI. eSPI dropped DMA support.
Can only speak for the more common TMS2793 as used in many MSX floppy systems. Operations like "seek" were basically the FDC pulsing a "head step" signal a # of times, and (optionally) attempting to read a sector mark on the disk to verify r/w head arrived at the correct track.
Operations like "read sector" or "format track" etc weren't performed by that FDC stand-alone, but only served as command to start the process. CPU (Z80 here) would poll some FDC status bits, pass contents of track to format to the FDC, all in byte-for-byte tightly programmed loops. Think ~10 us or so per loop iteration (no DMA).
For some portions of the data a CRC was calculated, and that was done by the FDC in hardware iirc.
So all in all the 'smarts' included in that FDC wasn't that much. I'd think that was true for most FDCs of the day, and the 8271 described here is kind of an outlier there. Of course things may be very different for more advanced/later FDCs like those included in Pentium-era & later PC chipsets.
Some discussion then: https://news.ycombinator.com/item?id=25115916