Manawyrm / pata-gpio

Linux kernel driver for PATA bit-banging over GPIOs
GNU General Public License v2.0
168 stars 15 forks source link

Feature Request - IDE Host #4

Open hsiboy opened 3 years ago

hsiboy commented 3 years ago

Hi,

i'm interested in this project, so that the raspberry PI could appear as several IDE devices, specifically ATAPI devices. Following the same functionality as RaSCSI the raspberry pi could be used to mount and present disc images. ATAPI devices for vintage computers and keyboards/samplers are failing (due to their age) and being able to upload CD, Zip (100mb, 250mb and 750mb) disk images and present them as a device would be super useful.

Happy to throw some beer/coffee tokens into the hat to help motivate/support.

Best.

Manawyrm commented 3 years ago

Hi,

yep, I agree, this would be very useful. Unfortunately, due to the strict timing requirements for IDE, this isn't easily possible.

Maybe with a bare metal firmware this could be done, but a regular tool on Linux can't reply on the ATA bus in realtime.

So: Either FPGA help is needed or some very clever bare metal magic.

hsiboy commented 3 years ago

Hi @Manawyrm you make a good point! Interestingly, the RaSCSI project has a "bare metal" version, i wonder then how difficult it is to implement 🤔

Manawyrm commented 3 years ago

Yes, but SCSI is much simpler timing-wise. With SCSI, you get commands and replies. With IDE you need to reply to memory-mapped registers in a very short timeframe. If you dedicate a whole core of the quad core processor to just polling the bus at all times, then it would probably work.

lanmower commented 1 year ago

@Manawyrm but can it possibly do packet based ATAPI? stuff like PIO mode 4? that's non dma right?

There is two communities specifically (apart from arcade communities who want to use cdrom and dvd roms) that are dying to get their hands on a virtual PIO/ATAPI?, the one is the Roland device owners since the SP808 and various other devices had ATAPI (presumably PIO mode 4) zip drives, and the MC2000 community

there used to be a very expensive device a few years ago that does the job, I think it was 200 buckeroos, but it's no longer happening.

This is in the domain of ground breaking stuff that will change emulation forever, there are probably 50 important devices that need atapi to sd, and the pi could probably deliver that in spades, even read/write

Manawyrm commented 1 year ago

@Manawyrm but can it possibly do packet based ATAPI? stuff like PIO mode 4? that's non dma right? Sadly not easily. You still need to reply to those registers within the very strict timing requirements, which is going to be very hard on a Pi.

Also: The Pi 3/4 are now "deprecated" and the new Pi 5 won't allow for any of this sort of thing to happen.

On the other hand, there's been rumours about the Pi 5 having the same PIO peripherals as the RP2040/Pi Pico. If that really turns out to be true and we get proper tooling for it, I'm hopeful that there's something that could be done.

Generally, to pull this off properly, you want an FPGA.