146,11 → 146,8 |
;----------------------------------------------------------------------------- |
Init_IDE_ATA_controller: |
cmp [ecx+IDE_DATA.ProgrammingInterface], 0 |
jne @f |
je set_interrupts_for_IDE_controllers.continue |
|
ret |
;-------------------------------------- |
@@: |
mov esi, boot_disabling_ide |
call boot_log |
;-------------------------------------- |
176,18 → 173,8 |
|
mov esi, boot_detecthdcd |
call boot_log |
;-------------------------------------- |
include 'dev_hdcd.inc' |
;-------------------------------------- |
ret |
;----------------------------------------------------------------------------- |
Init_IDE_ATA_controller_2: |
cmp [ecx+IDE_DATA.ProgrammingInterface], 0 |
jne @f |
|
ret |
;-------------------------------------- |
@@: |
mov dx, [ecx+IDE_DATA.RegsBaseAddres] |
; test whether it is our interrupt? |
add dx, 2 |
217,26 → 204,26 |
add dx, 0x7 ;0x177 |
in al, dx |
;----------------------------------------------------------------------------- |
; push eax edx |
; mov dx, [ecx+IDE_DATA.RegsBaseAddres] |
; xor eax, eax |
; add dx, 2 |
; in al, dx |
push eax edx |
mov dx, [ecx+IDE_DATA.RegsBaseAddres] |
xor eax, eax |
add dx, 2 |
in al, dx |
; DEBUGF 1, "K : Primary Bus Master IDE Status Register %x\n", eax |
|
; add dx, 8 |
; in al, dx |
add dx, 8 |
in al, dx |
; DEBUGF 1, "K : Secondary Bus Master IDE Status Register %x\n", eax |
; pop edx eax |
pop edx eax |
|
; cmp [ecx+IDE_DATA.RegsBaseAddres], 0 |
; setnz [ecx+IDE_DATA.dma_hdd] |
cmp [ecx+IDE_DATA.RegsBaseAddres], 0 |
setnz [ecx+IDE_DATA.dma_hdd] |
;----------------------------------------------------------------------------- |
; set interrupts for IDE Controller |
;----------------------------------------------------------------------------- |
mov esi, boot_set_int_IDE |
call boot_log |
.set_interrupts_for_IDE_controllers: |
set_interrupts_for_IDE_controllers: |
mov eax, [ecx+IDE_DATA.ProgrammingInterface] |
cmp ax, 0x0180 |
je .pata_ide |
299,8 → 286,6 |
jz @f |
|
DEBUGF 1, "K : IDE CH1 PIO, because ATAPI drive present\n" |
mov [ecx+IDE_DATA.dma_hdd_channel_1], byte 0 |
|
jmp .ch2_check |
;-------------------------------------- |
@@: |
308,7 → 293,6 |
add dx, 2 ;0x3F6 |
out dx, al |
DEBUGF 1, "K : IDE CH1 DMA enabled\n" |
mov [ecx+IDE_DATA.dma_hdd_channel_1], byte 1 |
;-------------------------------------- |
.ch2_check: |
test ah, 1010b |
315,8 → 299,6 |
jz @f |
|
DEBUGF 1, "K : IDE CH2 PIO, because ATAPI drive present\n" |
mov [ecx+IDE_DATA.dma_hdd_channel_2], byte 0 |
|
jmp .end_set_interrupts |
;-------------------------------------- |
@@: |
324,9 → 306,19 |
add dx, 2 ;0x376 |
out dx, al |
DEBUGF 1, "K : IDE CH2 DMA enabled\n" |
mov [ecx+IDE_DATA.dma_hdd_channel_2], byte 1 |
;-------------------------------------- |
.end_set_interrupts: |
;----------------------------------------------------------------------------- |
cmp [ecx+IDE_DATA.dma_hdd], 0 |
je .print_pio |
;-------------------------------------- |
.print_dma: |
DEBUGF 1, "K : IDE DMA mode\n" |
jmp .continue |
;-------------------------------------- |
.print_pio: |
DEBUGF 1, "K : IDE PIO mode\n" |
.continue: |
ret |
;----------------------------------------------------------------------------- |
; END of initialisation IDE ATA code |
350,13 → 342,3 |
call boot_log |
include 'sear_par.inc' |
;----------------------------------------------------------------------------- |
mov ecx, IDE_controller_1 |
mov [IDE_controller_pointer], ecx |
call Init_IDE_ATA_controller_2 |
mov ecx, IDE_controller_2 |
mov [IDE_controller_pointer], ecx |
call Init_IDE_ATA_controller_2 |
mov ecx, IDE_controller_3 |
mov [IDE_controller_pointer], ecx |
call Init_IDE_ATA_controller_2 |
;----------------------------------------------------------------------------- |