Cannot write using ATA PIO mode.
Posted: Sat Jul 27, 2019 6:02 pm
I've been struggling for more than a week with this issue: I cannot get ATA PIO writing working properly. Most of the time it doesn't work, but sometimes it does, so I thought that it might be a timing issue, but setting more and more delay didn't really help. The only thing that sort of patches this is to write several times before doing the flush, but even this doesn't always work.
I've modified my code according to a lot of different places, from GitHub repositories to YouTube tutorials, but I can't seem to get it working.
I'm using both VirtualBox and Qemu to test it.
The thing is that I know reading works: when a successful write occurs, if I turn off the machine, comment the writing code, and run only the reading, I always get the same output.
Here's my driver: https://github.com/jlxip/jotadOS/blob/m ... _PIO.c#L77
And here's the code I'm running: https://github.com/jlxip/jotadOS/blob/m ... rnel.c#L69
It might be a stupid error but I'd really appreciate some insight. Thanks!
I've modified my code according to a lot of different places, from GitHub repositories to YouTube tutorials, but I can't seem to get it working.
I'm using both VirtualBox and Qemu to test it.
The thing is that I know reading works: when a successful write occurs, if I turn off the machine, comment the writing code, and run only the reading, I always get the same output.
Here's my driver: https://github.com/jlxip/jotadOS/blob/m ... _PIO.c#L77
And here's the code I'm running: https://github.com/jlxip/jotadOS/blob/m ... rnel.c#L69
It might be a stupid error but I'd really appreciate some insight. Thanks!