Anonymous user
ATA/ATAPI using DMA: Difference between revisions
m
s/dword/uint32_t/g
[unchecked revision] | [unchecked revision] |
mNo edit summary |
m (s/dword/uint32_t/g) |
||
Line 17:
===Verifying CRC errors===
Read the PCI Configuration Space
==The PRD Table==
You must set up at least one Physical Region Descriptor Table (PRDT) in memory per ATA bus, which contains some number of Physical Region Descriptors (PRDs).
(The PRDT must be
Then you need to store the physical address of the current PRDT in the Bus Master Register, of the Bus Mastering ATA Disk Controller on the PCI bus (see below).
===PRD setup===
Half of each DMA transfer is encoded in one
(Why is it only half of a DMA transfer? Because the PRD does not contain any information about which LBAs to read from/write to the disk.
That information is sent in an entirely separate way to the proper disk -- see below.)
The low
The next
A byte count of 0 means 64K. The next
The data buffers cannot cross a 64K boundary, and must be contiguous in physical memory (ie. they can't be "virtual" data buffers).
The byte count on the data buffers must match the number of sectors transferred by the disk. If not, the controller will error out in various ways.
Line 47:
0x0 Command (byte)
0x2 Status (byte)
0x4-0x7 PRDT Address (
(Secondary ATA bus)
0x8 Command (byte)
0xA Status (byte)
0xC-0xF PRDT Address (
</pre>
|