]>
wirehaze git hosting - BOS.git/blob - kernel/fdc/dma.asm
1 ;----------------------------------------------------------;
2 ; BOS kernel Christoffer Bubach, 2004-2005. ;
3 ;----------------------------------------------------------;
7 ;----------------------------------------------------------;
10 ;------------------------------------------;
11 ; Lookup table for DMA controller ports ;
12 ;------------------------------------------;
13 dma_mask_reg dw 0x0A, 0x0A, 0x0A, 0x0A, 0xD4, 0xD4, 0xD4, 0xD4
14 dma_mode_reg dw 0x0B, 0x0B, 0x0B, 0x0B, 0xD6, 0xD6, 0xD6, 0xD6
15 dma_clear_reg dw 0x0C, 0x0C, 0x0C, 0x0C, 0xD8, 0xD8, 0xD8, 0xD8
16 dma_page_port dw 0x87, 0x83, 0x81, 0x82, 0x8F, 0x8B, 0x89, 0x8A
17 dma_addr_port dw 0x00, 0x02, 0x04, 0x06, 0xC0, 0xC4, 0xC8, 0xCC
18 dma_count_port dw 0x01, 0x03, 0x05, 0x07, 0xC2, 0xC6, 0xCA, 0xCE
21 ;-----------------------------------;
24 ; in: ecx = page:offset ;
26 ; bh = 1=read, 0=write ;
30 ;-----------------------------------;
49 mov dx, word [(eax*2)+dma_mask_reg
]
52 out dx, al ; disable the channel
55 mov dx, word [(eax*2)+dma_clear_reg
]
57 out dx, al ; initialize flip-flop
60 mov dx, word [(eax*2)+dma_mode_reg
]
62 out dx, al ; set DMA mode
65 mov dx, word [(eax*2)+dma_addr_port
]
67 out dx, al ; write low offset part
69 out dx, al ; and high offset part
72 mov dx, word [(eax*2)+dma_page_port
]
75 out dx, al ; write page.
78 mov dx, word [(eax*2)+dma_count_port
]
80 out dx, al ; low count
82 out dx, al ; high count
85 mov dx, word [(eax*2)+dma_mask_reg
]
87 out dx, al ; enable channel