Disk emulator

5 posts / 0 new
Last post
Offline
Last seen: 6 months 1 week ago
Joined: Feb 14 2021 - 19:22
Posts: 31
Disk emulator

Would it be dificult to emulate a disk image in software on a Teensy/Arduino which held a disk image in .DSK format contained in a C array?  

The Teensy/Arduino woould responded in the same way as the Apple II disk controller card and "access" the emulated diskette just by indexing into this array.

The disk .DSK image could be downloaded via the JTAG-UART or simply compiled into the C code.  

I'm guessing it would just take a small amount of code in the Arduino/Teensy to translate the BIOS firmware disk accesses into reads and writes indexed into the array.  

Or maybe it is more difficult that this?

Offline
Last seen: 1 month 3 days ago
Joined: Aug 4 2015 - 14:30
Posts: 150
It is much more complicated

A .DSK file simply contains the data bytes from a DOS3.3 disk. It has 35 tracks * 16 sectors * 256 bytes = 143360 bytes.

But on a real physical 5 1/4 disk there are a lot more bits and bytes which the system reads and writes.

Each sector consists of 1. Prologue, 2. sector data (342 bytes), 3. checksum, 4. Epilogue.

Note the sector data is 342 bytes, not 256. This is because the data physically is stored in a 6-and-2 encoded format, because the disk controller can not handle all the 256 byte values, so bytes has to be encoded when written and decoded when read. This is done by 1. the disk controller when booting from a disk, and 2. by DOS when reading/writing.

And there is a lot more to it.

Google for "Beneath Apple DOS" pdf (by Don Worth and Pieter Lechner), which you can find online. This pdf explains it all in great detail.

Offline
Last seen: 7 hours 6 min ago
Joined: Jul 5 2018 - 09:44
Posts: 2573
Someone made a storage device

Someone made a storage device using an Arduino that plugs into the 16 pin Apple II game port.  I think it basically drives a bit-banger serial interface that way and the Arduino drives an SD card interface module.

 

retro_bill's picture
Offline
Last seen: 5 months 2 weeks ago
Joined: Aug 5 2020 - 11:56
Posts: 124
Just get a FloppyEMU

Just get a FloppyEMU

Offline
Last seen: 6 months 1 week ago
Joined: Feb 14 2021 - 19:22
Posts: 31
ok
ok
Log in or register to post comments