Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3880 → Rev 3881

/kernel/trunk/blkdev/hd_drv.inc
536,7 → 536,6
inc edx
mov al, 30h ; WRITE SECTOR(S)
out dx, al ; ATACommand регистр команд
popfd
jmp .continue
;--------------------------------------
.lba48:
576,9 → 575,9
inc edx
mov al, 34h ; WRITE SECTOR(S) EXT
out dx, al ; ATACommand регистр команд
popfd
;--------------------------------------
.continue:
popfd
call wait_for_sector_buffer
 
cmp [hd_error], 0
728,7 → 727,7
call check_hd_wait_timeout
cmp [hd_error], 0
jz .wait
 
; clear Bus Master IDE Command register
pushfd
cli
mov [IDE_common_irq_param], 0
736,6 → 735,8
mov al, 0
out dx, al
popfd
;--------------------------------------
align 4
.done:
pop edx
pop eax
756,7 → 757,7
call check_hd_wait_timeout
cmp [hd_error], 0
jz .wait
 
; clear Bus Master IDE Command register
pushfd
cli
mov [IDE_common_irq_param], 0
765,6 → 766,8
mov al, 0
out dx, al
popfd
;--------------------------------------
align 4
.done:
pop edx
pop eax
804,14 → 807,21
pushfd
cli
pushad
 
; clear Bus Master IDE Command register
mov [IDE_common_irq_param], 0
mov dx, [IDEContrRegsBaseAddr]
mov al, 0
out dx, al
; clear Bus Master IDE Status register
; clear Interrupt bit
add edx, 2
mov al, 4 ; 100b
out dx, al
 
popad
popfd
;--------------------------------------
align 4
.exit:
mov al, 1
ret
824,15 → 834,22
pushfd
cli
pushad
 
; clear Bus Master IDE Command register
mov [IDE_common_irq_param], 0
mov dx, [IDEContrRegsBaseAddr]
add dx, 8
mov al, 0
out dx, al
; clear Bus Master IDE Status register
; clear Interrupt bit
add edx, 2
mov al, 4 ; 100b
out dx, al
 
popad
popfd
;--------------------------------------
align 4
.exit:
mov al, 1
ret
845,7 → 862,7
pushfd
cli
pushad
 
; clear Bus Master IDE Command register
xor ebx, ebx
mov dx, [IDEContrRegsBaseAddr]
mov eax, IDE_common_irq_param
859,9 → 876,16
align 4
@@:
out dx, al
; clear Bus Master IDE Status register
; clear Interrupt bit
add edx, 2
mov al, 4 ; 100b
out dx, al
 
popad
popfd
;--------------------------------------
align 4
.exit:
mov al, 1
ret
917,15 → 941,11
; clear Bus Master IDE Command register
mov al, 0
out dx, al
; set write to memory
; mov al, 8 ; 1000b
; out dx, al
; clear Bus Master IDE Status register
; clear Error bit and Interrupt bit
add edx, 2
mov al, 6 ; 110b
out dx, al
 
; Select the desired drive
mov edx, [hdbase]
add edx, 6 ; адрес регистра головок
1059,8 → 1079,9
jmp hd_read_dma
;-----------------------------------------------------------------------------
cache_write_dma:
mov eax, [cache_chain_ptr]
mov eax, [cache_chain_ptr] ; for what?
push esi
; set data for PRD Table
mov eax, IDE_descriptor_table
mov edx, eax
pusha
1074,6 → 1095,7
rep movsd
popa
sub eax, OS_BASE
; select controller Primary or Secondary
mov dx, [IDEContrRegsBaseAddr]
push eax
mov eax, [hd_address_table]
1083,15 → 1105,19
add edx, 8
@@:
push edx
; Bus Master IDE PRD Table Address
add edx, 4
; save IDE_descriptor_table
out dx, eax
pop edx
; clear Bus Master IDE Command register
mov al, 0
out dx, al
; clear Bus Master IDE Status register
; clear Error bit and Interrupt bit
add edx, 2
mov al, 6
out dx, al
 
; Select the desired drive
mov edx, [hdbase]
add edx, 6 ; адрес регистра головок
1180,6 → 1206,7
out dx, al ; ATACommand регистр команд
;--------------------------------------
.continue:
; select controller Primary or Secondary
mov dx, [IDEContrRegsBaseAddr]
mov eax, [hd_address_table]
cmp [hdbase], eax ; 0x1F0
1186,6 → 1213,7
jz @f
add dx, 8
@@:
; set write to device and Start Bus Master
mov al, 1
out dx, al
mov eax, [CURRENT_TASK]
1202,6 → 1230,7
mov [IDE_common_irq_param], irq15_num
@@:
popfd
; wait for interrupt
mov [dma_cur_sector], not 0x40
mov eax, [hd_address_table]
cmp [hdbase], eax ; 0x1F0
1217,6 → 1246,7
ret
;-----------------------------------------------------------------------------
uglobal
align 4
IDE_Interrupt dw ?
IDEContrRegsBaseAddr dw ?
IDEContrProgrammingInterface dw ?