536,6 → 536,7 |
inc edx |
mov al, 30h ; WRITE SECTOR(S) |
out dx, al ; ATACommand регистр команд |
popfd |
jmp .continue |
;-------------------------------------- |
.lba48: |
575,9 → 576,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 |
727,7 → 728,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 |
735,8 → 736,6 |
mov al, 0 |
out dx, al |
popfd |
;-------------------------------------- |
align 4 |
.done: |
pop edx |
pop eax |
757,7 → 756,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 |
766,8 → 765,6 |
mov al, 0 |
out dx, al |
popfd |
;-------------------------------------- |
align 4 |
.done: |
pop edx |
pop eax |
807,21 → 804,14 |
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 |
834,22 → 824,15 |
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 |
862,7 → 845,7 |
pushfd |
cli |
pushad |
; clear Bus Master IDE Command register |
|
xor ebx, ebx |
mov dx, [IDEContrRegsBaseAddr] |
mov eax, IDE_common_irq_param |
876,16 → 859,9 |
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 |
941,11 → 917,15 |
; 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 ; адрес регистра головок |
1079,9 → 1059,8 |
jmp hd_read_dma |
;----------------------------------------------------------------------------- |
cache_write_dma: |
mov eax, [cache_chain_ptr] ; for what? |
mov eax, [cache_chain_ptr] |
push esi |
; set data for PRD Table |
mov eax, IDE_descriptor_table |
mov edx, eax |
pusha |
1095,7 → 1074,6 |
rep movsd |
popa |
sub eax, OS_BASE |
; select controller Primary or Secondary |
mov dx, [IDEContrRegsBaseAddr] |
push eax |
mov eax, [hd_address_table] |
1105,19 → 1083,15 |
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 ; адрес регистра головок |
1206,7 → 1180,6 |
out dx, al ; ATACommand регистр команд |
;-------------------------------------- |
.continue: |
; select controller Primary or Secondary |
mov dx, [IDEContrRegsBaseAddr] |
mov eax, [hd_address_table] |
cmp [hdbase], eax ; 0x1F0 |
1213,7 → 1186,6 |
jz @f |
add dx, 8 |
@@: |
; set write to device and Start Bus Master |
mov al, 1 |
out dx, al |
mov eax, [CURRENT_TASK] |
1230,7 → 1202,6 |
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 |
1246,7 → 1217,6 |
ret |
;----------------------------------------------------------------------------- |
uglobal |
align 4 |
IDE_Interrupt dw ? |
IDEContrRegsBaseAddr dw ? |
IDEContrProgrammingInterface dw ? |