From 263374dacdadd2ab0584d2b3907987d22d402f68 Mon Sep 17 00:00:00 2001 From: "SPraid (simba)" Date: Thu, 14 Jun 2007 18:21:03 +0000 Subject: [PATCH] prepare for cd load (bx='m0' set by loader). git-svn-id: svn://kolibrios.org@543 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/blkdev/cd_drv.inc | 8 +++++++- kernel/trunk/data32.inc | 1 + kernel/trunk/fs/parse_fn.inc | 29 ++++++++++++++++++++++++++++- kernel/trunk/kernel.asm | 1 + 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/kernel/trunk/blkdev/cd_drv.inc b/kernel/trunk/blkdev/cd_drv.inc index aeef9eb34f..d3b2f78a74 100644 --- a/kernel/trunk/blkdev/cd_drv.inc +++ b/kernel/trunk/blkdev/cd_drv.inc @@ -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 diff --git a/kernel/trunk/data32.inc b/kernel/trunk/data32.inc index 79eae8708a..acc8044a63 100644 --- a/kernel/trunk/data32.inc +++ b/kernel/trunk/data32.inc @@ -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 diff --git a/kernel/trunk/fs/parse_fn.inc b/kernel/trunk/fs/parse_fn.inc index 4d006aad10..5b5a8eb309 100644 --- a/kernel/trunk/fs/parse_fn.inc +++ b/kernel/trunk/fs/parse_fn.inc @@ -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 diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index d07fa98d78..03b19fe4c0 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -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