Bus Mastering DMA

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
Isaac
Member
Member
Posts: 66
Joined: Sat Dec 07, 2013 7:08 pm

Bus Mastering DMA

Post by Isaac »

Hi,

I have some questions regarding Bus Mastering Ultra-DMA. First of all, there seems to be a 64KB limitation on the amount of bytes being loaded. That means if I have to load an 128KB file, I have to do it in 2 transfers changing the PRD table in between. Is that correct?

Also, in filesystems where continuous allocation is not used, would I have to load a file one cluster at a time, since each load is continuous?

And finally, where do I load the LBA address of the first block I'd like to transfer?
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: Bus Mastering DMA

Post by SpyderTL »

From what I've read, all transfers in the PRDT table have to be sequential in system memory, not in disk blocks. Also, transfers can not cross a 64K address boundary.

So you should be able to read up to 128 random blocks in a single transfer, but only if your memory address started on a 64K boundary.

Someone correct me if I'm wrong.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: Bus Mastering DMA

Post by SpyderTL »

After reading the Wiki a little more, I think I understand this UDMA stuff a little better.

I think you can set up the PRDT to transfer more than 64K, as long as each entry is less than or equal to 64K, and each entry cannot cross a 64K boundary. But the PRDT only contains the system memory addresses to read from or write to. It does not contain any information about the disk block address at all. So you still have to send a separate ATA or ATAPI command to the drive, itself, to start the transfer. This command will contain the initial LBA that you want to read. You should be able to set up the PRDT one time, and send multiple READ commands with different block addresses until the PRDT table is empty.

Again, someone correct me if I'm wrong...
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Post Reply