1) SATA IDE support for HDD and ATAPI
2) PIO LBA48 read for HDD git-svn-id: svn://kolibrios.org@3702 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -358,8 +358,40 @@ high_code:
|
||||
call mutex_init
|
||||
|
||||
; SAVE REAL MODE VARIABLES
|
||||
xor eax,eax
|
||||
mov ax, [BOOT_VAR + BOOT_IDE_PI_16]
|
||||
mov [IDEContrProgrammingInterface], ax
|
||||
mov ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR]
|
||||
mov [IDEContrRegsBaseAddr], ax
|
||||
mov ax, [BOOT_VAR + BOOT_IDE_BAR0_16]
|
||||
mov [IDE_BAR0_val], ax
|
||||
|
||||
cmp ax,0
|
||||
je @f
|
||||
cmp ax,1
|
||||
je @f
|
||||
and ax,0xfff0
|
||||
mov [StandardATABases],ax
|
||||
mov [hd_address_table],eax
|
||||
mov [hd_address_table+8],eax
|
||||
@@:
|
||||
mov ax, [BOOT_VAR + BOOT_IDE_BAR1_16]
|
||||
mov [IDE_BAR1_val], ax
|
||||
mov ax, [BOOT_VAR + BOOT_IDE_BAR2_16]
|
||||
mov [IDE_BAR2_val], ax
|
||||
|
||||
cmp ax,0
|
||||
je @f
|
||||
cmp ax,1
|
||||
je @f
|
||||
and ax,0xfff0
|
||||
mov [StandardATABases+2],ax
|
||||
mov [hd_address_table+16],eax
|
||||
mov [hd_address_table+24],eax
|
||||
@@:
|
||||
mov ax, [BOOT_VAR + BOOT_IDE_BAR3_16]
|
||||
mov [IDE_BAR3_val], ax
|
||||
|
||||
; --------------- APM ---------------------
|
||||
|
||||
; init selectors
|
||||
@@ -1014,6 +1046,18 @@ end if
|
||||
@@:
|
||||
DEBUGF 1, "K : %d CPU detected\n", eax
|
||||
|
||||
movzx eax,[IDE_BAR0_val]
|
||||
DEBUGF 1, "K : BAR0 %x \n", eax
|
||||
movzx eax,[IDE_BAR1_val]
|
||||
DEBUGF 1, "K : BAR1 %x \n", eax
|
||||
movzx eax,[IDE_BAR2_val]
|
||||
DEBUGF 1, "K : BAR2 %x \n", eax
|
||||
movzx eax,[IDE_BAR3_val]
|
||||
DEBUGF 1, "K : BAR3 %x \n", eax
|
||||
movzx eax,[IDEContrRegsBaseAddr]
|
||||
DEBUGF 1, "K : BAR4 %x \n", eax
|
||||
movzx eax,[IDEContrProgrammingInterface]
|
||||
DEBUGF 1, "K : IDEContrProgrammingInterface %x \n", eax
|
||||
; START MULTITASKING
|
||||
|
||||
; A 'All set - press ESC to start' messages if need
|
||||
@@ -1028,6 +1072,17 @@ end if
|
||||
|
||||
cmp [IDEContrRegsBaseAddr], 0
|
||||
setnz [dma_hdd]
|
||||
|
||||
cmp [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:
|
||||
|
||||
mov [timer_ticks_enable], 1 ; for cd driver
|
||||
|
||||
sti
|
||||
@@ -1585,23 +1640,27 @@ endg
|
||||
|
||||
dec ecx
|
||||
jnz noprma
|
||||
mov [cdbase], 0x1f0
|
||||
mov eax,[hd_address_table]
|
||||
mov [cdbase], eax ;0x1f0
|
||||
mov [cdid], 0xa0
|
||||
noprma:
|
||||
|
||||
dec ecx
|
||||
jnz noprsl
|
||||
mov [cdbase], 0x1f0
|
||||
mov eax,[hd_address_table]
|
||||
mov [cdbase], eax ;0x1f0
|
||||
mov [cdid], 0xb0
|
||||
noprsl:
|
||||
dec ecx
|
||||
jnz nosema
|
||||
mov [cdbase], 0x170
|
||||
mov eax,[hd_address_table+16]
|
||||
mov [cdbase], eax ;0x170
|
||||
mov [cdid], 0xa0
|
||||
nosema:
|
||||
dec ecx
|
||||
jnz nosesl
|
||||
mov [cdbase], 0x170
|
||||
mov eax,[hd_address_table+16]
|
||||
mov [cdbase], eax ;0x170
|
||||
mov [cdid], 0xb0
|
||||
nosesl:
|
||||
ret
|
||||
@@ -1630,7 +1689,8 @@ endg
|
||||
|
||||
cmp ecx, 1
|
||||
jnz noprmahd
|
||||
mov [hdbase], 0x1f0
|
||||
mov eax,[hd_address_table]
|
||||
mov [hdbase], eax ;0x1f0
|
||||
and dword [hdid], 0x0
|
||||
mov dword [hdpos], ecx
|
||||
; call set_FAT32_variables
|
||||
@@ -1638,7 +1698,8 @@ endg
|
||||
|
||||
cmp ecx, 2
|
||||
jnz noprslhd
|
||||
mov [hdbase], 0x1f0
|
||||
mov eax,[hd_address_table]
|
||||
mov [hdbase], eax ;0x1f0
|
||||
mov [hdid], 0x10
|
||||
mov dword [hdpos], ecx
|
||||
; call set_FAT32_variables
|
||||
@@ -1646,7 +1707,8 @@ endg
|
||||
|
||||
cmp ecx, 3
|
||||
jnz nosemahd
|
||||
mov [hdbase], 0x170
|
||||
mov eax,[hd_address_table+16]
|
||||
mov [hdbase], eax ;0x170
|
||||
and dword [hdid], 0x0
|
||||
mov dword [hdpos], ecx
|
||||
; call set_FAT32_variables
|
||||
@@ -1654,7 +1716,8 @@ endg
|
||||
|
||||
cmp ecx, 4
|
||||
jnz noseslhd
|
||||
mov [hdbase], 0x170
|
||||
mov eax,[hd_address_table+16]
|
||||
mov [hdbase], eax ;0x170
|
||||
mov [hdid], 0x10
|
||||
mov dword [hdpos], ecx
|
||||
; call set_FAT32_variables
|
||||
|
Reference in New Issue
Block a user