Implement ATA DMA driver in JOS

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
eladna
Posts: 1
Joined: Sat May 27, 2017 8:14 pm
Libera.chat IRC: eladna

Implement ATA DMA driver in JOS

Post 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
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Implement ATA DMA driver in JOS

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
mallard
Member
Member
Posts: 280
Joined: Tue May 13, 2014 3:02 am
Location: Private, UK

Re: Implement ATA DMA driver in JOS

Post 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.
Image
Post Reply