关于硬盘DMA传送
;本人硬盘的总线号 0,设备号31,FUNTION 2(SLAVE),主设备为0,31,5但不能作为DMA主控设备(PCI CMD REG=3,BIT2不能置位);硬盘DMA基地址REG=0E091H(OFFSET 20H),即CONTROL REG=0E090H,STATUS REG=0E092H,PRD REG=0E094H
;base address reg=0e0d0h
;本人的问题在于:为什么按照INTEL 82801AA(ICH0)的资料无法用DMA读去硬盘缓冲区?本论坛藏龙卧虎,请进到此贴的大牛一定留下个一言半语点化下小弟,不胜感激!!!
;程序如下:
.model small
.386
.code
start:
cli
mov al,0ffh
out 0a1h,al
mov dx,0e090h
mov al,0
out dx,al
mov dx,0e092h
mov al,6
out dx,al
mov ax,4000h
mov es,ax
mov di,0
mov eax,40000h
mov dx,0e094h
out dx,eax
mov eax,20000h
stosd
mov eax,80000200h
stosd
mov eax,0
call readsector
mov al,1
mov dx,0e090h
out dx,al
mov dx,0e092h
l1:
in al,dx
test al,4
jz l1
mov al,6
out dx,al
mov ah,4ch
int 21h
readsector proc near
push eax
push dx
mov dx,0e0d3h
out dx,al
inc dx
shr eax,8
out dx,al
inc dx
shr eax,8
out dx,al
inc dx
shr eax,8
add al,0e0h
out dx,al
mov dx,0e0d2h
mov al,1
out dx,al
mov dx,0e0d7h
mov al,20h
out dx,al
l0:
in al,dx
cmp al,58h
jnz l0
pop dx
pop eax
retn
end start