Fix 58 functions LBA read, was earlier read only IDE0 the hard disk, now are read all.

git-svn-id: svn://kolibrios.org@64 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2006-03-25 18:49:24 +00:00
parent 5db3c3adc1
commit f08ff6ca70

View File

@ -63,7 +63,7 @@ file_system:
; \begin{diamond}[18.03.2006] ; \begin{diamond}[18.03.2006]
; for subfunction 16 (start application) error codes must be negative ; for subfunction 16 (start application) error codes must be negative
; because positive values are valid PIDs ; because positive values are valid PIDs
; so possible return values are: ; so possible return values are:
; eax > 0 : process created, eax=PID ; eax > 0 : process created, eax=PID
@ -85,7 +85,7 @@ file_system:
; \end{diamond}[18.03.2006] ; \end{diamond}[18.03.2006]
; Extract parameters ; Extract parameters
add eax, std_application_base_address ; abs start of info block add eax, std_application_base_address ; abs start of info block
cmp dword [eax+0],12 ; Get file size cmp dword [eax+0],12 ; Get file size
je fs_read je fs_read
@ -163,14 +163,14 @@ endg
; root - only read is allowed ; root - only read is allowed
; other operations return "access denied", eax=10 ; other operations return "access denied", eax=10
; (execute operation returns eax=-10) ; (execute operation returns eax=-10)
cmp dword [eax], 0 cmp dword [eax], 0
jz .read_root jz .read_root
mov ecx, 10 mov ecx, 10
cmp dword [eax], 16 cmp dword [eax], 16
jnz @f jnz @f
neg ecx neg ecx
@@: mov [esp+36], ecx @@: mov [esp+36], ecx
ret ret
.read_root: .read_root:
; \end{diamond}[18.03.2006] ; \end{diamond}[18.03.2006]
mov esi,dir0 mov esi,dir0
@ -178,7 +178,7 @@ endg
add edi,std_application_base_address add edi,std_application_base_address
mov ecx,11 mov ecx,11
push ecx push ecx
; cld ; already is ; cld ; already is
rep movsb rep movsb
mov al,0x10 mov al,0x10
stosb stosb
@ -234,7 +234,7 @@ endg
lea esi,[eax+20] ; abs start of dir + filename lea esi,[eax+20] ; abs start of dir + filename
mov edi,[eax+16] mov edi,[eax+16]
add edi,std_application_base_address ; abs start of work area add edi,std_application_base_address ; abs start of work area
call expand_pathz call expand_pathz
@ -319,7 +319,7 @@ endg
mov ebx, [esp+12] mov ebx, [esp+12]
add ebx, std_application_base_address add ebx, std_application_base_address
no_fl_start_param: no_fl_start_param:
mov edx,[esp+16] ; flags mov edx,[esp+16] ; flags
call start_application_fl call start_application_fl
@ -439,12 +439,12 @@ endg
add ebx,[esp+12] add ebx,[esp+12]
no_flp_start_param: no_flp_start_param:
mov edx,[esp+16] ; flags mov edx,[esp+16] ; flags
call start_application_floppy call start_application_floppy
file_system_startapp_return: file_system_startapp_return:
mov ebx, [esp+24+24] ; do not modify ebx in application mov ebx, [esp+24+24] ; do not modify ebx in application
jmp file_system_return jmp file_system_return
fs_noflpdisk_start_application: fs_noflpdisk_start_application:
@ -541,10 +541,10 @@ choice_necessity_partition_1:
fs_yesharddisk_all: fs_yesharddisk_all:
mov eax,1 mov eax,1
cmp dword [esp+20], 16 cmp dword [esp+20], 16
jnz @f jnz @f
neg eax neg eax
@@: mov ebx, [esp+24+24] @@: mov ebx, [esp+24+24]
cmp [hdpos],0 ; is hd base set? cmp [hdpos],0 ; is hd base set?
jz hd_err_return jz hd_err_return
cmp [fat32part],0 ; is partition set? cmp [fat32part],0 ; is partition set?
@ -783,7 +783,7 @@ hd_err_return:
mov ebp, [esp+12] mov ebp, [esp+12]
add ebp, std_application_base_address add ebp, std_application_base_address
no_hd_start_param: no_hd_start_param:
mov edx,[esp+16] ; flags mov edx,[esp+16] ; flags
call start_application_hd call start_application_hd
@ -793,12 +793,12 @@ hd_err_return:
fs_noharddisk: fs_noharddisk:
; \begin{diamond}[18.03.2006] ; \begin{diamond}[18.03.2006]
mov eax, 5 ; file not found mov eax, 5 ; file not found
; à ìîæåò áûòü, âîçâðàùàòü äðóãîé êîä îøèáêè? ; à ìîæåò áûòü, âîçâðàùàòü äðóãîé êîä îøèáêè?
cmp dword [esp+20], 16 cmp dword [esp+20], 16
jnz @f jnz @f
neg eax neg eax
@@: mov ebx, [esp+24+24] ; do not change ebx in application @@: mov ebx, [esp+24+24] ; do not change ebx in application
; \end{diamond}[18.03.2006] ; \end{diamond}[18.03.2006]
file_system_return: file_system_return:
@ -816,16 +816,16 @@ hd_err_return:
; /RD,/FD,/HD - only read is allowed ; /RD,/FD,/HD - only read is allowed
; other operations return "access denied", eax=10 ; other operations return "access denied", eax=10
; (execute operation returns eax=-10) ; (execute operation returns eax=-10)
cmp dword [esp+20], 0 cmp dword [esp+20], 0
jz .read jz .read
add esp, 20 add esp, 20
pop ecx pop ecx
mov eax, 10 mov eax, 10
cmp ecx, 16 cmp ecx, 16
jnz @f jnz @f
neg eax neg eax
@@: mov [esp+36], eax @@: mov [esp+36], eax
ret ret
.read: .read:
; \end{diamond}[18.03.2006] ; \end{diamond}[18.03.2006]
mov al,0x10 mov al,0x10
@ -931,6 +931,9 @@ LBA_read:
mov eax,[edi+0] mov eax,[edi+0]
mov ebx,[edi+4] mov ebx,[edi+4]
mov [hdbase],eax
mov [hdid],ebx
call wait_for_hd_idle call wait_for_hd_idle
; eax = hd port ; eax = hd port