Hello all.
I am willing to access the hard drive using Bus Mastering DMA.
I have written some test code, that perform a read. If I try it
in Qemu, it works fine, but if I use Bochs, no IRQ is fired.
My code sets up a sample PRDT, initializes and reset the ATA
controller, then load the address of PRDT into the proper BusMaster
register. It resets the BusMaster interrupt flag, gives the read
command to the ATA controller, sets "Read" and "Start" flags in
the DMA. Then waits for an interrupt (IRQ 14 or 15).
PIC masks are clear, hence no interrupt is masked. My test
code runs with flat segmentation and paging disabled.
I presume I did something wrong... Can anyone help me?
In the following link you can find the source code of my test:
http://pastebin.com/RXN70jag
Thank you in advance.
P.S.: Please forgive me for my poor English: I am not a native
speaker.
ATA/DMA Read Test - Working in Qemu and not in Bocks
- Lionel
- Member
- Posts: 117
- Joined: Fri Jul 16, 2010 2:16 pm
- Libera.chat IRC: ryanel
- Location: California
Re: ATA/DMA Read Test - Working in Qemu and not in Bocks
First off, your english is quite good! Some things like comma placement are slightly unnatural, just say it out loud if you have any trouble and put commas where you pause!
Secondly, I noticed there are no return types on the functions (void...), and I believe adding the packed attribute to the struct might help, or at least ensure the compiler is consistent between versions.
And thirdly, would you mind appending the output of the test from qemu and bochs to this thread?
Thanks,
Lionel
Secondly, I noticed there are no return types on the functions (void...), and I believe adding the packed attribute to the struct might help, or at least ensure the compiler is consistent between versions.
And thirdly, would you mind appending the output of the test from qemu and bochs to this thread?
Thanks,
Lionel
Re: ATA/DMA Read Test - Working in Qemu and not in Bocks
Thank you very much! I will follow your advice about commas.First off, your english is quite good! Some things like comma placement are slightly unnatural, just say it out loud if you have any trouble and put commas where you pause!
You are right. The quality of my code is not good indeed: it was meant as a test. However I have now added return types and "#pragma pack", (although the struct is aligned on a 4-byte boundary). The resulting behaviour doesn't change.Secondly, I noticed there are no return types on the functions (void...), and I believe adding the packed attribute to the struct might help, or at least ensure the compiler is consistent between versions.
I have uploaded a tarball with screen dumps of the emulators running the code. The relevant part begins at "ATA BAR".
Before you will see other tests and logs.
- Attachments
-
- pict.tar.gz
- (19.26 KiB) Downloaded 46 times