From fabd313f2a0e77dad97ab01d8a86b02d52fc918b Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 27 Mar 2002 22:26:25 +0000 Subject: [PATCH] Added support for .lst files. Thanks to Art Yerkes. svn path=/trunk/; revision=2788 --- reactos/boot.bat | 2 +- reactos/bootc.lst | 8 ++ reactos/install.bat | 1 + reactos/loaders/dos/loadros.asm | 130 +++++++++++++++++++++++--------- 4 files changed, 104 insertions(+), 37 deletions(-) create mode 100644 reactos/bootc.lst diff --git a/reactos/boot.bat b/reactos/boot.bat index af7e22e2850..e9946e01153 100644 --- a/reactos/boot.bat +++ b/reactos/boot.bat @@ -1 +1 @@ -loadros system32\ntoskrnl.exe system32\hal.dll system32\drivers\ide.sys system32\drivers\vfatfs.sys system32\config\system.hiv \ No newline at end of file +loadros system32\ntoskrnl.exe system32\hal.dll bootc.lst \ No newline at end of file diff --git a/reactos/bootc.lst b/reactos/bootc.lst new file mode 100644 index 00000000000..811fa1a95ff --- /dev/null +++ b/reactos/bootc.lst @@ -0,0 +1,8 @@ +system32\drivers\scsiport.sys +system32\drivers\atapi.sys +system32\drivers\class2.sys +system32\drivers\disk.sys +system32\drivers\cdrom.sys +system32\drivers\vfatfs.sys +system32\config\system.hiv +* diff --git a/reactos/install.bat b/reactos/install.bat index 090696fb4eb..5855c6c2f07 100644 --- a/reactos/install.bat +++ b/reactos/install.bat @@ -18,6 +18,7 @@ md %ROS_INSTALL%\system32\drivers md %ROS_INSTALL%\media md %ROS_INSTALL%\media\fonts copy boot.bat %ROS_INSTALL% +copy bootc.lst %ROS_INSTALL% copy aboot.bat %ROS_INSTALL% copy system.hiv %ROS_INSTALL%\system32\config copy loaders\dos\loadros.com %ROS_INSTALL% diff --git a/reactos/loaders/dos/loadros.asm b/reactos/loaders/dos/loadros.asm index b0ccd2b2835..eb05d6df1a4 100644 --- a/reactos/loaders/dos/loadros.asm +++ b/reactos/loaders/dos/loadros.asm @@ -249,17 +249,72 @@ entry: .checkForHive: ; Check if it is a symbol file cmp byte [bx-5],'.' - jne .pe_copy + jne .lst_copy cmp byte [bx-4],'h' - jne .pe_copy + jne .lst_copy cmp byte [bx-3],'i' - jne .pe_copy + jne .lst_copy cmp byte [bx-2],'v' - jne .pe_copy + jne .lst_copy call sym_load_module jmp .after_copy +.lst_copy: + ;; Check for a module list file + cmp byte [bx-5],'.' + jne .pe_copy + cmp byte [bx-4],'l' + jne .pe_copy + cmp byte [bx-3],'s' + jne .pe_copy + cmp byte [bx-2],'t' + jne .pe_copy + + call sym_load_module + + push es + mov bx,0x9000 + push bx + pop es + xor edi,edi + +.lst_copy_bytes: + mov bx,_lst_name_local + +.lst_byte: + mov al,[es:di] + inc di + cmp al,' ' + jg .lst_not_space + mov byte [bx],0 + inc bx +.lst_space: + mov al,[es:di] + inc di + cmp al,' ' + jle .lst_space +.lst_not_space: + cmp al,'*' + je .lst_end + mov [bx],al + inc bx + jmp .lst_byte + +.lst_end: + ;; We are here because the terminator was encountered + mov byte [bx],0 ; Zero terminate + inc bx + mov byte [bx],0 + mov [end_cmd_line],bx ; Put in cmd_line_length + mov dx,_lst_name_local; Put this address in di + mov di,dx ; This, too, at the start of the + ; string + + pop es + + jmp .start_loading + .pe_copy: call pe_load_module @@ -291,7 +346,7 @@ entry: mov dx, di jmp .start_loading -.done_loading: +.done_loading ;; ;; Initialize the multiboot information @@ -376,40 +431,40 @@ entry: .done_mem: - ;; - ;; Retrieve BIOS memory map if available - ;; - xor ebx,ebx - mov edi, _multiboot_address_ranges + ;; + ;; Retrieve BIOS memory map if available + ;; + xor ebx,ebx + mov edi, _multiboot_address_ranges .mmap_next: - mov edx, 'PAMS' - mov ecx, multiboot_address_range_size - mov eax, 0E820h - int 15h - jc .done_mmap + mov edx, 'PAMS' + mov ecx, multiboot_address_range_size + mov eax, 0E820h + int 15h + jc .done_mmap - cmp eax, 'PAMS' - jne .done_mmap + cmp eax, 'PAMS' + jne .done_mmap - add edi, multiboot_address_range_size + add edi, multiboot_address_range_size - cmp ebx, 0 - jne .mmap_next + cmp ebx, 0 + jne .mmap_next - ;; - ;; Prepare multiboot memory map structures - ;; + ;; + ;; Prepare multiboot memory map structures + ;; - ;; Fill in the address descriptor size field - mov dword [_multiboot_address_range_descriptor_size], multiboot_address_range_size + ;; Fill in the address descriptor size field + mov dword [_multiboot_address_range_descriptor_size], multiboot_address_range_size - ;; Set flag and base address and length of memory map - or dword [_multiboot_flags], 40h - mov eax, edi - sub eax, _multiboot_address_ranges - mov dword [_multiboot_mmap_length], eax + ;; Set flag and base address and length of memory map + or dword [_multiboot_flags], 40h + mov eax, edi + sub eax, _multiboot_address_ranges + mov dword [_multiboot_mmap_length], eax xor eax, eax mov ax, ds @@ -713,7 +768,10 @@ _current_size: dd 0 _current_file_size: dd 0 - + +_lst_name_local: + times 2048 db 0 + ;; ;; Load a SYM file ;; DS:DX = Filename @@ -809,9 +867,9 @@ pe_load_module: mov dword [_mb_bss_end_addr], 0 .first: - call load_module2 - call load_module3 - ret + call load_module2 + call load_module3 + ret load_module1: ;; @@ -848,7 +906,7 @@ load_module1: mov dx, error_file_seek_failed jmp error .seek_start: - ret + ret load_module2: ;; @@ -979,7 +1037,7 @@ load_module2: and di, 0xf000 add edi, 0x1000 .no_round: - ret + ret load_module3: mov bx, [_multiboot_mods_count]