Page 1 of 1

Implement ATA DMA driver in JOS

Posted: Sat May 27, 2017 8:24 pm
by eladna
Hi

I would like to implement an ATA driver using DMA for JOS.
I encountered the following examples, but non of them worked for me:
https://github.com/mallardtheduck/osdev ... ta/dma.cpp
https://github.com/ichaos/jos/blob/mast ... /dev/ide.c
I'm getting an error when I'm reading the status register of the device during the read procedure.
I'm working with QEMU.

I would be glad to have a simple working example.

Thanks a lot!
Elad

Re: Implement ATA DMA driver in JOS

Posted: Sat May 27, 2017 10:12 pm
by Brendan
Hi,
eladna wrote:I would like to implement an ATA driver using DMA for JOS.
I encountered the following examples, but non of them worked for me:
https://github.com/mallardtheduck/osdev ... ta/dma.cpp
https://github.com/ichaos/jos/blob/mast ... /dev/ide.c
I'm getting an error when I'm reading the status register of the device during the read procedure.
I'm working with QEMU.

I would be glad to have a simple working example.
You'd have to assume that both of these worked for their original authors (and that you did have 2 simple working examples). In that case I'd recommend focusing on finding out why it doesn't work for you (maybe something else is different in your OS, or in your copy of Qemu).

Finding out what the error was might be a good next step (if the status register says there's an error, then a flag in the error register probably says what the problem was).


Cheers,

Brendan

Re: Implement ATA DMA driver in JOS

Posted: Tue May 30, 2017 2:15 am
by mallard
I notice that you've linked to my code...

Unfortunately, my ATA DMA code doesn't actually work and has been disabled (note the "return false;" at the top of "init_dma()"...) pending my getting around to having another go at it. Sorry about that.