We can access each sector’s raw data on Commodore disk drives with direct block access commands. Supported drives include the 1541, 1571, the VICE emulator as well as the SD2IEC card reader (for the most part).
Each single sided floppy contains 35 sectors, while a double sided 1571 formatted disk contains 70 sectors. Each track contains between 17 and 21 sectors depending on how far inside or outside they are. Each sector contains 255 bytes we can read or write.
Sectors are the same as blocks: only the directory refers to them as “blocks” and shows us how many we have available.
We’ll need to open two channels to our disk drives: a command channel and a data channel. Here’s how to do it: