LAUNCHER changes:

1) Dynamic memory allocation for AUTORUN.DAT.
2) Added additional diagnostic messages for BOARD.

git-svn-id: svn://kolibrios.org@4613 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2014-03-05 23:37:48 +00:00
parent f6f7a854c7
commit f53c34a758

View File

@ -5,6 +5,11 @@
; Compile with FASM 1.52 or newer ; Compile with FASM 1.52 or newer
; ;
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; last update: 06/03/2014
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Dynamic memory allocation for AUTORUN.DAT.
; Added additional diagnostic messages for BOARD.
;-----------------------------------------------------------------------------
; last update: 02/03/2014 ; last update: 02/03/2014
; changed by: Marat Zakiyanov aka Mario79, aka Mario ; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Reducing the consumption of RAM, 4 KB instead of 32 KB. ; changes: Reducing the consumption of RAM, 4 KB instead of 32 KB.
@ -30,8 +35,32 @@ define __DEBUG_LEVEL__ 1
include "../../../debug-fdo.inc" include "../../../debug-fdo.inc"
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
START: ; start of execution START: ; start of execution
mcall 70,autorun_dat_info ; load AUTORUN.DAT mcall 68,11
add ebx,file_data mcall 70,autorun_dat_info ;get information AUTORUN.DAT
test eax,eax
jnz .read_error
mov ecx,[processinfo+32]
test ecx,ecx
jnz @f
inc ecx ; if file size zero
;--------------------------------------
@@:
mov [autorun_dat_info.size],ecx
mcall 68,12
mov [autorun_dat_info.address],eax
mov ebp,eax
mov [autorun_dat_info.mode],dword 0
mcall 70,autorun_dat_info ;load AUTORUN.DAT
test eax,eax
jz @f
.read_error:
DEBUGF 1, "L: AUTORUN.DAT read error\n"
jmp exit
;--------------------------------------
@@:
add ebx,ebp
mov [fileend],ebx mov [fileend],ebx
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; this cycle does not contain an obvious exit condition, ; this cycle does not contain an obvious exit condition,
@ -53,12 +82,14 @@ skip_this_string:
call next_line call next_line
jmp start_program jmp start_program
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
exit_1:
DEBUGF 1, "L: AUTORUN.DAT processed\n"
exit: exit:
or eax,-1 or eax,-1
mcall mcall
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
run_program: ; time to delay in eax run_program: ; time to delay in eax
DEBUGF 1, "Launch: %s Parameter: %s\n",program,parameters DEBUGF 1, "L: %s Param: %s\n",program,parameters
push eax push eax
mcall 70,start_info mcall 70,start_info
pop ebx pop ebx
@ -110,7 +141,7 @@ get_string: ; pointer to destination buffer in edi
pushad pushad
call skip_spaces call skip_spaces
mov esi,[position] mov esi,[position]
add esi,file_data add esi,ebp
cmp [esi],byte '"' cmp [esi],byte '"'
jz .quoted jz .quoted
;-------------------------------------- ;--------------------------------------
@ -150,7 +181,7 @@ get_number:
push ebx esi push ebx esi
call skip_spaces call skip_spaces
mov esi,[position] mov esi,[position]
add esi,file_data add esi,ebp
xor eax,eax xor eax,eax
cmp [esi],byte '-' cmp [esi],byte '-'
jnz @f jnz @f
@ -194,7 +225,7 @@ skip_spaces:
push esi push esi
xor eax,eax xor eax,eax
mov esi,[position] mov esi,[position]
add esi,file_data add esi,ebp
;-------------------------------------- ;--------------------------------------
.start: .start:
cmp esi,[fileend] cmp esi,[fileend]
@ -213,11 +244,11 @@ skip_spaces:
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
next_line: next_line:
mov esi,[position] mov esi,[position]
add esi,file_data add esi,ebp
;-------------------------------------- ;--------------------------------------
.start: .start:
cmp esi,[fileend] cmp esi,[fileend]
jae exit jae exit_1
lodsb lodsb
cmp al,13 cmp al,13
@ -232,7 +263,7 @@ next_line:
.finish: .finish:
inc dword [position] inc dword [position]
cmp esi,[fileend] cmp esi,[fileend]
jae exit jae exit_1
lodsb lodsb
cmp al,13 cmp al,13
@ -248,20 +279,21 @@ next_line:
include_debug_strings include_debug_strings
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
autorun_dat_info: ; AUTORUN.DAT autorun_dat_info: ; AUTORUN.DAT
.mode dd 0 ; read file .mode dd 5 ; get information or read file
.start_block dd 0 ; block to read .start dd 0
dd 0 .params dd 0
.blocks dd 4*512 ; 2 Kb max for AUTORUN.DAT .size dd 0
.address dd file_data .address dd processinfo
db "/SYS/SETTINGS/AUTORUN.DAT",0 db "/SYS/SETTINGS/AUTORUN.DAT",0
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
start_info: start_info:
.mode dd 7 .mode dd 7
dd 0 .flags dd 0
.params dd parameters .params dd parameters
dd 0 dd 0
dd 0 dd 0
.path: db 0
.path dd program
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
IM_END: IM_END:
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
@ -282,10 +314,6 @@ position:
fileend: fileend:
rd 1 rd 1
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4
file_data:
rb 4*512 ; 2 Kb for AUTORUN.DAT
;-----------------------------------------------------------------------------
align 4 align 4
rb 256 rb 256
stack_top: stack_top: