prepare for cd load (bx='m0' set by loader).

git-svn-id: svn://kolibrios.org@543 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
SPraid (simba) 2007-06-14 18:21:03 +00:00
parent 6a21548368
commit 263374dacd
4 changed files with 37 additions and 2 deletions

View File

@ -18,7 +18,7 @@ $Revision$
; Максимальное количество повторений операции чтения
MaxRetr equ 3
MaxRetr equ 10
; Предельное время ожидания готовности к приему команды
; (в тиках)
BSYWaitTime equ 1000 ;2
@ -69,6 +69,7 @@ ReadCD:
;********************************************
ReadCDWRetr:
pushad
; Цикл, пока команда не выполнена успешно или не
; исчерпано количество попыток
mov ECX,MaxRetr
@ -77,6 +78,11 @@ ReadCDWRetr:
call ReadCD
cmp [DevErrorCode],0
je @@End_4
or ecx,ecx ;{SPraid.simba} (for cd load)
jz @@End_4
dec ecx
cmp [timer_ticks_enable],0
jne @f
mov eax,NoTickWaitTime

View File

@ -82,6 +82,7 @@ szSTART db 'START',0
szEXPORTS db 'EXPORTS',0
szIMPORTS db 'IMPORTS',0
read_firstapp db '/sys/'
firstapp db 'LAUNCHER',0
char db '/sys/FONTS/CHAR.MT',0

View File

@ -27,7 +27,10 @@ tmp_file_name_table dd ?
endg
; use bx_from_load and init system directory /sys
Parser_params:
proc Parser_params
locals
buff db 4 dup(?) ; for test cd
endl
mov eax,[OS_BASE+0x10000+bx_from_load]
mov ecx,sysdir_path
mov [ecx-64],dword 'sys'
@ -37,6 +40,27 @@ Parser_params:
mov [ecx+3],byte ah
mov [ecx+4],byte 0
ret
@@:
cmp al,'m' ; if ram disk
jnz @f
mov [ecx],dword 'CD?/' ; if cd disk {m}
mov [ecx+4],byte '1'
mov [ecx+5],dword '/KOL'
mov [ecx+9],dword 'IBRI'
mov [ecx+13],byte 0
.next_cd:
mov [ecx+2],byte ah
inc ah
cmp ah,'5'
je .not_found_cd
lea edx,[buff]
pushad
stdcall read_file,read_firstapp,edx,0,4
popad
cmp [edx],dword 'MENU'
jne .next_cd
jmp .ok
@@:
sub al,49
mov [ecx],dword 'HD?/' ; if hard disk
@ -45,7 +69,10 @@ Parser_params:
mov [ecx+5],dword '/KOL'
mov [ecx+9],dword 'IBRI'
mov [ecx+13],byte 0
.ok:
.not_found_cd:
ret
endp
proc load_file_parse_table
stdcall kernel_alloc,0x1000

View File

@ -16,6 +16,7 @@
;; Iliya Mihailov (Ghost)
;; Sergey Semyonov (Serge)
;; Johnny_B
;; SPraid (simba)
;;
;; Data in this file was originally part of MenuetOS project which is
;; distributed under the terms of GNU GPL. It is modified and redistributed as