home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / FAQSYS18.ZIP / FAQS.DAT / DMADOC.TXT < prev    next >
Text File  |  1993-11-11  |  8KB  |  233 lines

  1.       DIRECT MEMORY ACCESS CONTROLLER (Type 1, PS/2 Type)
  2.       ===================================================
  3.       
  4. The Direct Memory Access (DMA) controller allows I/O devices to 
  5. transfer data directly to and from memory. This frees the system 
  6. microprocessor of I/= tasks, resulting in a higher throughput.
  7.  
  8. The functions of the DMA controller can be grouped into two 
  9. categories: program mode and DMA transfer mode.
  10.  
  11. The DMA controller supports the following:
  12.  
  13.     * Register an program compatibility with the IBM Personal 
  14.       Computer AT DMA channels (8237 compatible mode)
  15.     * 16MB 24-bit address capability for memory and 64Kb 16-bit 
  16.       address capability for I/O
  17.     * Eight (AT only 4?) independent DMA channels capable of 
  18.       transferring data between memory and I/O devices
  19.  
  20.       
  21. DMA Controller Operations
  22. -------------------------
  23.  
  24. The DMA controller does two types of operations:
  25.     * Data transfer between memory and I/O devices
  26.     * Read verifications ( not documentet here )
  27.     
  28. DATA TRANSFER BETWEEN MEMORY AND I/O DEVICES
  29.  
  30. The DMA controller performs serial transfer for all read and write 
  31. operations. These transfers can be between memory and I/O on any 
  32. channel. Data is read from a device and latched in the DMA 
  33. controller before it is ritten back to a second device. The memory 
  34. address needs to be specified only for a DMA data transfer. A 
  35. programmable 16-bit address can be provided during the 
  36. I/O portion of the transfer as a programmable option. If the 
  37. programmable 16 bit-bit address is not selected, the 
  38. I/O address is forced to hex 0000 during the I/O transfer.
  39.  
  40. Figure 1. DMA I/O Address Map:
  41. Address    Description            Bit        Byte
  42. (hex)                    Description    Pointer
  43.  
  44. 0000    Channel 0, Memory address reg.    00-15        Used
  45. 0001    Channel 0, Transfer Count reg.    00-15        Used
  46. 0002    Channel 1, Memory address reg.    00-15        Used
  47. 0003    Channel 1, Transfer Count reg.    00-15        Used
  48. 0004    Channel 2, Memory address reg.    00-15        Used
  49. 0005    Channel 2, Transfer Count reg.    00-15        Used
  50. 0006    Channel 3, Memory address reg.    00-15        Used
  51. 0007    Channel 3, Transfer Count reg.    00-15        Used
  52. 0008    Channel 0-3, Status reg.    00-07
  53. 000A    Channel 0-3, Mask reg. (Set/Re) 00-02
  54. 000B    Channel 0-3, Mode reg. (Write)  00-07
  55. 000C    Clear byte pointer (Write)    N/A
  56. 000D    DMA Controller reset (Write)    N/A
  57. 000E    Channel 0-3, Clear Mask reg.(W) N/A
  58. 000F    Channel 0-3, Write Mask reg.    00-03
  59. 0081    Channel 2, Page Table Addr.reg. 00-07 **
  60. 0082    Channel 3, Page Table Addr.reg. 00-07 **
  61. 0083    Channel 1, Page Table Addr.reg. 00-07 **
  62. 0087    Channel 0, Page Table Addr.reg. 00-07 **
  63.  
  64. ** Upper byte of memory address register.
  65. Figure 1. DMA I/O Address Map
  66.  
  67.  
  68. BYTE POINTER
  69. ------------
  70.  
  71. A byte pointer gives 8-bits ports access to consecutive bytes of 
  72. registers grater than 8 bits. For program I/O, the registers which 
  73. use it are the Memmory Address registres (3 byes), the Transfer 
  74. Count registers (2 bytes),and the I/O Address registers (2 bytes). 
  75. Interrupts shuld be masked off when programming DMA controller 
  76. operations.
  77.  
  78. DMA Registers
  79. -------------
  80.  
  81. All system microprocessor access to the DMA controller must be 8-
  82. bit I/O instructions. The following lists the name and size of the 
  83. DMA registers
  84.  
  85. Figure 2. DMA registers
  86.                Size    Quantity of    Allocation
  87. Register    (bits)    registers
  88.  
  89. Memory Address    24    8        1 per channel
  90. I/O Address    16    8        1 per channel
  91. Transfer Count    16    8        1 per channel
  92. Temp. Holding    16    1        All channels
  93. Mask        4    2        1 for channels 3-0
  94. Arbus        4    2        1 for channels 0
  95. Mode        8    8        1 per channel
  96. Status        8    2        1 for channel 3-0
  97. Function    8    1        All channels
  98. Refresh        9    1        independent of DMA
  99.  
  100. Figure 2. DMA Registers
  101.  
  102.  
  103. MEMORY ADDRESS REGISTER
  104. -----------------------
  105.  
  106. Each channel has a 24-bit (AT 16-bit) Memory Address register, 
  107. which is loaded by the system microprocessor. The Mode register 
  108. determines wheter the adress is incremented or decremented. The 
  109. Mode register can be read by the system microprocessor on 
  110. successive I/O byte operations. To read this register, the 
  111. microprocessor must use the extended DMA commands (not documented 
  112. here).
  113.  
  114.  
  115. I/O ADDRESSE REGISTER
  116. ---------------------
  117.  
  118. Each channel has a 16-bit I/O Adress register, which is loadedd by 
  119. the system microprocessor. The bits in this register do not change 
  120. during DMA transfers. This register can be read by the system 
  121. microprocessor in successive I/O byte operations. To read this 
  122. register, the microprocessor must use the extended DMA commands 
  123. (not documented here).
  124.  
  125. Typically, a DMA slave is selected for DMA trasnfers by a decode of 
  126. the arbitration level, status (-S0 exclusively ORed with -S1), and 
  127. M/-IO. In this case, the respective I/O address register must have 
  128. a value of zero.
  129.  
  130. A DMA slave may be selected based on a decode of the address rather 
  131. the arbitration level. In this case, the respective I/O address 
  132. register must have the proper I/O address value.
  133.  
  134.  
  135. TRANSFER COUNT REGISTER
  136. -----------------------
  137.  
  138. Each channel has a16-bit Transfer Coun register, which is loaded by 
  139. the system microprocessor. The transfer count determines how many 
  140. transfers the DMA channel wil execute before reaching the terminal 
  141. count. The number of transfers is always 1 more than the count 
  142. specifies. If the count is 0, DMA controller doen one transfer. 
  143. This register can be read by the microprocessor in successive I/O 
  144. byte operations. To read this register, the system microprocessor 
  145. can use only the extended DMA commands.
  146.  
  147.  
  148. TEMPORARY HOLDING REGISTER
  149. --------------------------
  150.  
  151. This 16-bit register holds the intermediate value for the serial 
  152. DMA transfer taking place. A DMA operation requires the data to 
  153. be held in the register before it is written back. This register is 
  154. not accessible by the system microprocessor.
  155.  
  156.  
  157. MASK REGISTER
  158. -------------
  159.  
  160. Figure 3. Set/Clear single mask bit using 8237 compatible mode:
  161.  
  162.     Bit    Function
  163.     7 - 3    Resered = 0
  164.     2    0 Clear Mask Bit
  165.         1 Set Mask Bit
  166.     1, 0    00 Select channel 0
  167.         01 Select channel 1
  168.         10 Select channel 2
  169.         11 Select channel 3
  170.         
  171. Figure 3. Set/Clear single mask bit using 8237 compatible mode.
  172.  
  173. Figure 4. DMA Mask register write using 8237 compatibel mode:
  174.  
  175.     Bit    Function
  176.     7 - 4    Reserved = 0
  177.     3    0 Clear Channel 3 Mask bit
  178.         1 Set Channel 3 Mask bit
  179.     
  180.     2    0 Clear Channel 2 Mask bit
  181.         1 Set Channel 2 Mask bit
  182.          
  183.     1    0 Clear Channel 1 Mask bit
  184.         1 Set Channel 1 Mask bit
  185.  
  186.     0    0 Clear Channel 0 Mask bit
  187.         1 Set Channel 0 Mask bit
  188.         
  189. Figure 4. DMA Mask register write using 8237 compatibel mode.
  190.  
  191. Each channel has o corresponding mask bit that, when set, disables 
  192. the DMA from servicing the requesting device. Each mask bit can be 
  193. set to 0 or 1 by the system microprocessor. A system reset or DMA 
  194. Controller Reset commands sets all mask bits to 1. A Clear Mask 
  195. Register command sets mask bits 0-3 to 9.
  196.  
  197. When a device requestind DMA cycles wins the arbitration cyce, and 
  198. the mask bit is set to 1 on the corresponding channel, the DMA 
  199. ontroller does not execute any cycles it behalf and allows external 
  200. devices to provide the transfer. If no device responds, the bus 
  201. times out and causes a nonmaskable interrupt (NMI). This register 
  202. can be programmed using the 8237 compatible mode commands (used by 
  203. the IBM Personal Computer AT) or the extended DMA commands (not 
  204. documented here).
  205.  
  206.  
  207. MODE REGISTER
  208. -------------
  209.  
  210. The Mode register for each channel identifies the type of operation 
  211. that takes place when that channel transfers data.
  212.  
  213. Figure 5. 8237 Compatible Mode Register:
  214.  
  215.     Bit    Function
  216.     7, 6    Reserved = 0
  217.     5, 4    Reserved = 0
  218.     3, 2    00 Verify operation
  219.         01 Write operation
  220.         10 Read operation
  221.         11 Reserved
  222.     1, 0    Channel accessed
  223.           00 Select channel 0
  224.           01 Select channel 1
  225.           10 Select channel 2
  226.           11 Select channel 3
  227.           
  228. Figure 5. 8237 Compatible Mode Register.
  229.  
  230. The Mode register is programmed by the system microprocessor, and 
  231. its contents are reformatted and stored internally in the DMA 
  232. controller. In the 8237 compatible mode, this register can only be 
  233. written.