forked from KolibriOS/kolibrios
Added: Function 70/7 for ISO9660 - start application
Fix: 1) small error - for function 70/1 2) now function 18/6 used procedure call reserve_hd1 git-svn-id: svn://kolibrios.org@94 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
e44a4705bc
commit
497393b8cb
@ -15,6 +15,7 @@ sysfn_saveramdisk: ; 18.6 = SAVE FLOPPY IMAGE (HD version only)
|
|||||||
mov edx,[edx+10h]
|
mov edx,[edx+10h]
|
||||||
add edx,ecx
|
add edx,ecx
|
||||||
img_save_hd_3:
|
img_save_hd_3:
|
||||||
|
call reserve_hd1
|
||||||
call restorefatchain ; restore FAT !!!
|
call restorefatchain ; restore FAT !!!
|
||||||
mov eax,image_save
|
mov eax,image_save
|
||||||
mov ebx,1440*1024 ; size 1440 Kb
|
mov ebx,1440*1024 ; size 1440 Kb
|
||||||
|
@ -518,6 +518,7 @@ fs_CdServices:
|
|||||||
dd fs_NotImplemented
|
dd fs_NotImplemented
|
||||||
dd fs_CdGetFileInfo
|
dd fs_CdGetFileInfo
|
||||||
dd fs_NotImplemented
|
dd fs_NotImplemented
|
||||||
|
dd fs_CdExecute
|
||||||
fs_NumCdServices = ($ - fs_CdServices)/4
|
fs_NumCdServices = ($ - fs_CdServices)/4
|
||||||
|
|
||||||
;*******************************************************
|
;*******************************************************
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
uglobal
|
uglobal
|
||||||
cd_current_pointer_of_input dd 0
|
cd_current_pointer_of_input dd 0
|
||||||
cd_current_pointer_of_input_2 dd 0
|
cd_current_pointer_of_input_2 dd 0
|
||||||
@ -442,6 +443,126 @@ fs_CdGetFileInfo:
|
|||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
;----------------------------------------------------------------
|
||||||
|
;
|
||||||
|
; fs_CdExecute - LFN variant for executing from CD
|
||||||
|
;
|
||||||
|
; esi points to hd filename (e.g. 'dir1/name')
|
||||||
|
; ebp points to full filename (e.g. '/hd0/1/dir1/name')
|
||||||
|
; dword [ebx] = flags
|
||||||
|
; dword [ebx+4] = cmdline
|
||||||
|
;
|
||||||
|
; ret ebx,edx destroyed
|
||||||
|
; eax > 0 - PID, < 0 - error
|
||||||
|
;
|
||||||
|
;--------------------------------------------------------------
|
||||||
|
fs_CdExecute:
|
||||||
|
mov edx, [ebx]
|
||||||
|
mov ebx, [ebx+4]
|
||||||
|
test ebx, ebx
|
||||||
|
jz @f
|
||||||
|
add ebx, std_application_base_address
|
||||||
|
@@:
|
||||||
|
|
||||||
|
;----------------------------------------------------------------
|
||||||
|
;
|
||||||
|
; fs_CdExecute.flags - second entry
|
||||||
|
;
|
||||||
|
; esi points to floppy filename (kernel address)
|
||||||
|
; ebp points to full filename
|
||||||
|
; edx flags
|
||||||
|
; ebx cmdline (kernel address)
|
||||||
|
;
|
||||||
|
; ret eax > 0 - PID, < 0 - error
|
||||||
|
;
|
||||||
|
;--------------------------------------------------------------
|
||||||
|
|
||||||
|
.flags:
|
||||||
|
cmp byte [esi], 0
|
||||||
|
jnz @f
|
||||||
|
; cannot execute root!
|
||||||
|
mov eax, -ERROR_ACCESS_DENIED
|
||||||
|
ret
|
||||||
|
@@:
|
||||||
|
push edi
|
||||||
|
call cd_find_lfn
|
||||||
|
jnc .found
|
||||||
|
pop edi
|
||||||
|
mov eax, -ERROR_FILE_NOT_FOUND
|
||||||
|
cmp [DevErrorCode], 0
|
||||||
|
jz @f
|
||||||
|
mov al, -11
|
||||||
|
@@:
|
||||||
|
ret
|
||||||
|
.found:
|
||||||
|
mov edi,[cd_current_pointer_of_input]
|
||||||
|
mov eax,[edi+2]
|
||||||
|
push 0
|
||||||
|
push eax
|
||||||
|
push dword [edi+10] ; size
|
||||||
|
push .DoRead
|
||||||
|
call fs_execute
|
||||||
|
add esp, 16
|
||||||
|
pop edi
|
||||||
|
ret
|
||||||
|
|
||||||
|
.DoRead:
|
||||||
|
; read next block
|
||||||
|
; in: eax->parameters, edi->buffer
|
||||||
|
; out: eax = error code
|
||||||
|
pushad
|
||||||
|
cmp dword [eax], 0 ; file size
|
||||||
|
jz .eof
|
||||||
|
cmp [eax+8],dword 0
|
||||||
|
jne @f
|
||||||
|
mov ecx,[eax+4]
|
||||||
|
inc dword [eax+4]
|
||||||
|
mov [CDSectorAddress],ecx
|
||||||
|
mov [CDDataBuf_pointer],CDDataBuf ;edi
|
||||||
|
call ReadCDWRetr
|
||||||
|
cmp [DevErrorCode], 0
|
||||||
|
jnz .err
|
||||||
|
@@:
|
||||||
|
push esi edi ecx
|
||||||
|
mov esi,512
|
||||||
|
imul esi,[eax+8]
|
||||||
|
add esi,CDDataBuf
|
||||||
|
mov ecx,512/4
|
||||||
|
cld
|
||||||
|
rep movsd
|
||||||
|
pop ecx edi esi
|
||||||
|
|
||||||
|
mov eax, [esp+28]
|
||||||
|
mov ecx, [eax]
|
||||||
|
sub ecx, 512
|
||||||
|
jae @f
|
||||||
|
lea edi, [edi+ecx+512]
|
||||||
|
neg ecx
|
||||||
|
push eax
|
||||||
|
xor eax, eax
|
||||||
|
rep stosb
|
||||||
|
pop eax
|
||||||
|
@@:
|
||||||
|
mov [eax], ecx
|
||||||
|
mov edx, [eax+8]
|
||||||
|
inc edx
|
||||||
|
cmp edx, 4 ; 2048/512=4
|
||||||
|
jb @f
|
||||||
|
xor edx, edx
|
||||||
|
@@:
|
||||||
|
mov [eax+8], edx
|
||||||
|
popad
|
||||||
|
xor eax, eax
|
||||||
|
ret
|
||||||
|
.eof:
|
||||||
|
popad
|
||||||
|
mov eax, 6
|
||||||
|
ret
|
||||||
|
.err:
|
||||||
|
popad
|
||||||
|
mov eax, 11
|
||||||
|
ret
|
||||||
|
|
||||||
cd_find_lfn:
|
cd_find_lfn:
|
||||||
; in: esi->name
|
; in: esi->name
|
||||||
; out: CF=1 - file not found
|
; out: CF=1 - file not found
|
||||||
@ -501,7 +622,7 @@ cd_find_lfn:
|
|||||||
; èñêîìûé ýëåìåíò öåïî÷êè íàéäåí
|
; èñêîìûé ýëåìåíò öåïî÷êè íàéäåí
|
||||||
.found:
|
.found:
|
||||||
; êîíåö ïóòè ôàéëà
|
; êîíåö ïóòè ôàéëà
|
||||||
cmp byte [esi], 0
|
cmp byte [esi-1], 0
|
||||||
jz .done
|
jz .done
|
||||||
mov eax,[cd_current_pointer_of_input]
|
mov eax,[cd_current_pointer_of_input]
|
||||||
add eax,2
|
add eax,2
|
||||||
|
Loading…
Reference in New Issue
Block a user