forked from KolibriOS/kolibrios
IDE: more debug output
git-svn-id: svn://kolibrios.org@6650 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
85139c507e
commit
595fd9817d
@ -75,7 +75,6 @@ ide_read:
|
|||||||
|
|
||||||
ide_write:
|
ide_write:
|
||||||
mov al, 35h ; WRITE DMA EXT
|
mov al, 35h ; WRITE DMA EXT
|
||||||
|
|
||||||
proc ide_read_write stdcall uses esi edi ebx, \
|
proc ide_read_write stdcall uses esi edi ebx, \
|
||||||
hd_data, buffer, startsector:qword, numsectors
|
hd_data, buffer, startsector:qword, numsectors
|
||||||
; hd_data = pointer to hd*_data
|
; hd_data = pointer to hd*_data
|
||||||
@ -153,6 +152,7 @@ endl
|
|||||||
add [sector], ecx
|
add [sector], ecx
|
||||||
adc word [sector+4], 0
|
adc word [sector+4], 0
|
||||||
jmp .next
|
jmp .next
|
||||||
|
|
||||||
.LBA28:
|
.LBA28:
|
||||||
add eax, [sectors_todo]
|
add eax, [sectors_todo]
|
||||||
add eax, 0xF0000000
|
add eax, 0xF0000000
|
||||||
@ -177,6 +177,7 @@ endl
|
|||||||
jz .out
|
jz .out
|
||||||
add [sector], ecx
|
add [sector], ecx
|
||||||
jmp .next28
|
jmp .next28
|
||||||
|
|
||||||
; loop is done, either due to error or because everything is done
|
; loop is done, either due to error or because everything is done
|
||||||
; release the global lock and return the corresponding status
|
; release the global lock and return the corresponding status
|
||||||
.out:
|
.out:
|
||||||
@ -314,6 +315,7 @@ IDE_transfer:
|
|||||||
jnz .aligned
|
jnz .aligned
|
||||||
sub edi, 8
|
sub edi, 8
|
||||||
jmp @f
|
jmp @f
|
||||||
|
|
||||||
.end:
|
.end:
|
||||||
mov ecx, [blockSize]
|
mov ecx, [blockSize]
|
||||||
mov [edi+4], ecx
|
mov [edi+4], ecx
|
||||||
@ -372,6 +374,7 @@ IDE_transfer:
|
|||||||
call wait_event_timeout
|
call wait_event_timeout
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jnz @f
|
jnz @f
|
||||||
|
dbgstr 'IDE DMA IRQ timeout'
|
||||||
mov [IDE_common_irq_param], 0
|
mov [IDE_common_irq_param], 0
|
||||||
mov eax, [eventPointer]
|
mov eax, [eventPointer]
|
||||||
mov ebx, [eventID]
|
mov ebx, [eventID]
|
||||||
@ -439,7 +442,7 @@ IDE_transfer:
|
|||||||
cmp [hd_setup], 1 ; do not mark error for setup request
|
cmp [hd_setup], 1 ; do not mark error for setup request
|
||||||
jz @f
|
jz @f
|
||||||
test al, 1 ; previous command ended up with an error
|
test al, 1 ; previous command ended up with an error
|
||||||
jnz .hd_error
|
jnz .pio_error
|
||||||
@@:
|
@@:
|
||||||
pushfd
|
pushfd
|
||||||
cli
|
cli
|
||||||
@ -450,6 +453,7 @@ IDE_transfer:
|
|||||||
jnc .write
|
jnc .write
|
||||||
rep insw
|
rep insw
|
||||||
jmp @f
|
jmp @f
|
||||||
|
|
||||||
.write:
|
.write:
|
||||||
rep outsw
|
rep outsw
|
||||||
@@:
|
@@:
|
||||||
@ -458,25 +462,20 @@ IDE_transfer:
|
|||||||
dec dword [blockSize]
|
dec dword [blockSize]
|
||||||
jnz .sectorTransfer
|
jnz .sectorTransfer
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
.pio_error:
|
||||||
|
dbgstr 'IDE PIO transfer error'
|
||||||
.hd_error:
|
.hd_error:
|
||||||
cmp bl, 30h
|
cmp bl, 30h
|
||||||
jnc hd_write_error
|
jnc hd_write_error
|
||||||
;-----------------------------------------------------------------
|
;-----------------------------------------------------------------
|
||||||
hd_read_error:
|
hd_read_error:
|
||||||
if lang eq sp
|
dbgstr 'HD read error'
|
||||||
DEBUGF 1,"K : FS - HD error de lectura\n"
|
|
||||||
else
|
|
||||||
DEBUGF 1,"K : FS - HD read error\n"
|
|
||||||
end if
|
|
||||||
stc
|
stc
|
||||||
ret
|
ret
|
||||||
;-----------------------------------------------------------------
|
;-----------------------------------------------------------------
|
||||||
hd_write_error:
|
hd_write_error:
|
||||||
if lang eq sp
|
dbgstr 'HD write error'
|
||||||
DEBUGF 1,"K : FS - HD error de escritura\n"
|
|
||||||
else
|
|
||||||
DEBUGF 1,"K : FS - HD write error\n"
|
|
||||||
end if
|
|
||||||
stc
|
stc
|
||||||
ret
|
ret
|
||||||
;-----------------------------------------------------------------
|
;-----------------------------------------------------------------
|
||||||
@ -491,12 +490,9 @@ check_hd_wait_timeout:
|
|||||||
cmp [hd_wait_timeout], eax
|
cmp [hd_wait_timeout], eax
|
||||||
jc @f
|
jc @f
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
if lang eq sp
|
dbgstr 'IDE device timeout'
|
||||||
DEBUGF 1,"K : FS - HD tiempo de espera agotado\n"
|
|
||||||
else
|
|
||||||
DEBUGF 1,"K : FS - HD timeout\n"
|
|
||||||
end if
|
|
||||||
stc
|
stc
|
||||||
ret
|
ret
|
||||||
;-----------------------------------------------------------------
|
;-----------------------------------------------------------------
|
||||||
@ -517,7 +513,7 @@ IDE_common_irq_handler:
|
|||||||
; remove the interrupt request and raise the event for the waiting code.
|
; remove the interrupt request and raise the event for the waiting code.
|
||||||
; In the case a), just return zero - not our interrupt.
|
; In the case a), just return zero - not our interrupt.
|
||||||
; In the case b), remove the interrupt request and hope for the best.
|
; In the case b), remove the interrupt request and hope for the best.
|
||||||
; DEBUGF 1, 'K : IDE_irq_handler %x\n', [IDE_common_irq_param]:2
|
; DEBUGF 1, 'K : IDE_irq_handler %x\n', [IDE_common_irq_param]:2
|
||||||
mov ecx, [esp+4]
|
mov ecx, [esp+4]
|
||||||
mov dx, [ecx+IDE_DATA.RegsBaseAddres]
|
mov dx, [ecx+IDE_DATA.RegsBaseAddres]
|
||||||
add edx, 2 ; Bus Master IDE Status register
|
add edx, 2 ; Bus Master IDE Status register
|
||||||
@ -528,9 +524,9 @@ IDE_common_irq_handler:
|
|||||||
in al, dx
|
in al, dx
|
||||||
test al, 4
|
test al, 4
|
||||||
jnz .interrupt_from_secondary
|
jnz .interrupt_from_secondary
|
||||||
.exit_notour:
|
|
||||||
xor eax, eax ; not our interrupt
|
xor eax, eax ; not our interrupt
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.interrupt_from_primary:
|
.interrupt_from_primary:
|
||||||
out dx, al ; clear Interrupt bit
|
out dx, al ; clear Interrupt bit
|
||||||
sub edx, 2
|
sub edx, 2
|
||||||
@ -538,12 +534,13 @@ IDE_common_irq_handler:
|
|||||||
out dx, al ; clear Bus Master IDE Command register
|
out dx, al ; clear Bus Master IDE Command register
|
||||||
mov dx, [ecx+IDE_DATA.BAR0_val]
|
mov dx, [ecx+IDE_DATA.BAR0_val]
|
||||||
add edx, 7
|
add edx, 7
|
||||||
in al, dx ; read status register
|
in al, dx ; read status register
|
||||||
cmp [IDE_common_irq_param], 14
|
cmp [IDE_common_irq_param], 14
|
||||||
jz .raise
|
jz .raise
|
||||||
.exit_our:
|
.exit_our:
|
||||||
mov al, 1
|
mov al, 1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.interrupt_from_secondary:
|
.interrupt_from_secondary:
|
||||||
out dx, al ; clear Interrupt bit
|
out dx, al ; clear Interrupt bit
|
||||||
sub edx, 2
|
sub edx, 2
|
||||||
@ -551,7 +548,7 @@ IDE_common_irq_handler:
|
|||||||
out dx, al ; clear Bus Master IDE Command register
|
out dx, al ; clear Bus Master IDE Command register
|
||||||
mov dx, [ecx+IDE_DATA.BAR2_val]
|
mov dx, [ecx+IDE_DATA.BAR2_val]
|
||||||
add edx, 7
|
add edx, 7
|
||||||
in al, dx ; read status register
|
in al, dx ; read status register
|
||||||
cmp [IDE_common_irq_param], 15
|
cmp [IDE_common_irq_param], 15
|
||||||
jnz .exit_our
|
jnz .exit_our
|
||||||
.raise:
|
.raise:
|
||||||
@ -566,4 +563,3 @@ IDE_common_irq_handler:
|
|||||||
popad
|
popad
|
||||||
mov al, 1 ; remove the interrupt request
|
mov al, 1 ; remove the interrupt request
|
||||||
ret
|
ret
|
||||||
;-----------------------------------------------------------------
|
|
||||||
|
Loading…
Reference in New Issue
Block a user