1) small error for procedure reserve_cd: (iso9660.inc)
2) reserved controller 1 or 2, because the devices IDE0+IDE1 or IDE2+IDE3 can not work simultaneously.

git-svn-id: svn://kolibrios.org@95 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2006-07-05 16:54:34 +00:00
parent 497393b8cb
commit 548cefab68
3 changed files with 80 additions and 4 deletions

View File

@ -129,8 +129,41 @@ reserve_hd1:
pop eax pop eax
sti sti
ret ret
;********************************************
reserve_hd_channel:
cmp [hdbase], 0x1F0
jne .IDE_Channel_2
.IDE_Channel_1:
cli
cmp [IDE_Channel_1],0
je .reserve_ok_1
sti
call change_task
jmp .IDE_Channel_1
.IDE_Channel_2:
cli
cmp [IDE_Channel_2],0
je .reserve_ok_2
sti
call change_task
jmp .IDE_Channel_1
.reserve_ok_1:
mov [IDE_Channel_1],1
ret
.reserve_ok_2:
mov [IDE_Channel_2],1
ret
free_hd_channel:
cmp [hdbase], 0x1F0
jne .IDE_Channel_2
.IDE_Channel_1:
mov [IDE_Channel_1],0
ret
.IDE_Channel_2:
mov [IDE_Channel_2],0
ret
;********************************************
clear_hd_cache: clear_hd_cache:
push eax ecx edi push eax ecx edi

View File

@ -407,6 +407,7 @@ fs_OnHd3:
mov [hdid], 0x10 mov [hdid], 0x10
push 4 push 4
fs_OnHd: fs_OnHd:
call reserve_hd_channel
pop eax pop eax
mov [hdpos], eax mov [hdpos], eax
cmp ecx, 0x100 cmp ecx, 0x100
@ -414,6 +415,7 @@ fs_OnHd:
cmp cl, [0x40001+eax] cmp cl, [0x40001+eax]
jbe @f jbe @f
.nf: .nf:
call free_hd_channel
and [hd1_status], 0 and [hd1_status], 0
mov dword [esp+36], 5 ; not found mov dword [esp+36], 5 ; not found
ret ret
@ -430,11 +432,13 @@ fs_OnHd:
jae .not_impl jae .not_impl
add ebx, 4 add ebx, 4
call dword [fs_HdServices + eax*4] call dword [fs_HdServices + eax*4]
call free_hd_channel
and [hd1_status], 0 and [hd1_status], 0
mov [esp+36], eax mov [esp+36], eax
mov [esp+24], ebx mov [esp+24], ebx
ret ret
.not_impl: .not_impl:
call free_hd_channel
and [hd1_status], 0 and [hd1_status], 0
mov dword [esp+36], 2 ; not implemented mov dword [esp+36], 2 ; not implemented
ret ret
@ -475,7 +479,7 @@ fs_OnCd3:
mov [DiskNumber],1 mov [DiskNumber],1
push 0 push 0
fs_OnCd: fs_OnCd:
call reserve_cd_channel
pop eax pop eax
mov [hdpos], eax mov [hdpos], eax
cmp ecx, 0x100 cmp ecx, 0x100
@ -489,6 +493,7 @@ fs_OnCd:
jnz @f jnz @f
.nf: .nf:
call free_cd_channel
and [cd_status], 0 and [cd_status], 0
mov dword [esp+36], 5 ; not found mov dword [esp+36], 5 ; not found
ret ret
@ -501,11 +506,13 @@ fs_OnCd:
jae .not_impl jae .not_impl
add ebx, 4 add ebx, 4
call dword [fs_CdServices + eax*4] call dword [fs_CdServices + eax*4]
call free_cd_channel
and [cd_status], 0 and [cd_status], 0
mov [esp+36], eax mov [esp+36], eax
mov [esp+24], ebx mov [esp+24], ebx
ret ret
.not_impl: .not_impl:
call free_cd_channel
and [cd_status], 0 and [cd_status], 0
mov dword [esp+36], 2 ; not implemented mov dword [esp+36], 2 ; not implemented
ret ret

View File

@ -4,6 +4,8 @@ cd_current_pointer_of_input dd 0
cd_current_pointer_of_input_2 dd 0 cd_current_pointer_of_input_2 dd 0
cd_mem_location dd 0 cd_mem_location dd 0
cd_counter_block dd 0 cd_counter_block dd 0
IDE_Channel_1 db 0
IDE_Channel_2 db 0
endg endg
CDDataBuf equ 0x7000 CDDataBuf equ 0x7000
@ -16,7 +18,7 @@ reserve_cd:
sti sti
call change_task call change_task
jmp reserve_hd1 jmp reserve_cd
reserve_ok2: reserve_ok2:
@ -28,6 +30,40 @@ reserve_cd:
pop eax pop eax
sti sti
ret ret
reserve_cd_channel:
cmp [ChannelNumber],1
jne .IDE_Channel_2
.IDE_Channel_1:
cli
cmp [IDE_Channel_1],0
je .reserve_ok_1
sti
call change_task
jmp .IDE_Channel_1
.IDE_Channel_2:
cli
cmp [IDE_Channel_2],0
je .reserve_ok_2
sti
call change_task
jmp .IDE_Channel_1
.reserve_ok_1:
mov [IDE_Channel_1],1
ret
.reserve_ok_2:
mov [IDE_Channel_2],1
ret
free_cd_channel:
cmp [ChannelNumber],1
jne .IDE_Channel_2
.IDE_Channel_1:
mov [IDE_Channel_1],0
ret
.IDE_Channel_2:
mov [IDE_Channel_2],0
ret
cd_status dd 0 cd_status dd 0