From bf38c73d0a8c9bb54bae44e8961aea82800d4769 Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Fri, 2 Oct 2020 13:05:10 +0000 Subject: [PATCH] kernel: don't use ramdisk if asked. The blue screen is not aware of this option. git-svn-id: svn://kolibrios.org@8089 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/boot/bootcode.inc | 12 ++++++------ kernel/trunk/boot/preboot.inc | 6 +++--- kernel/trunk/boot/rdload.inc | 4 ++-- kernel/trunk/boot/uefi4kos.asm | 2 +- kernel/trunk/const.inc | 13 ++++++++----- kernel/trunk/fs/parse_fn.inc | 2 +- kernel/trunk/kernel.asm | 11 +++++------ 7 files changed, 26 insertions(+), 24 deletions(-) diff --git a/kernel/trunk/boot/bootcode.inc b/kernel/trunk/boot/bootcode.inc index 02c35b5bff..ef20a46029 100644 --- a/kernel/trunk/boot/bootcode.inc +++ b/kernel/trunk/boot/bootcode.inc @@ -287,13 +287,13 @@ else ; \end{diamond}[02.12.2005] ; if bootloader sets cx = 'HA' and dx = 'RD', then bx contains identifier of source disk -; (see comment to BOOT_LO.bx_from_load and loader_doc.txt) - mov word [es:BOOT_LO.bx_from_load], 'r1' ; default value: /rd/1 +; (see comment to BOOT_LO.sys_disk and loader_doc.txt) + mov word [es:BOOT_LO.sys_disk], 'r1' ; default value: /rd/1 cmp cx, 'HA' jnz no_hd_load cmp dx, 'RD' jnz no_hd_load - mov [es:BOOT_LO.bx_from_load], bx + mov [es:BOOT_LO.sys_disk], bx no_hd_load: ; set up stack @@ -971,14 +971,14 @@ end if mov al, [preboot_device] dec al - mov [es:BOOT_LO.dev], al + mov [es:BOOT_LO.rd_load_from], al ; GET MEMORY MAP include '../detect/biosmem.inc' ; READ DISKETTE TO MEMORY - cmp byte [es:BOOT_LO.dev], 0 + cmp byte [es:BOOT_LO.rd_load_from], RD_LOAD_FROM_FLOPPY jne no_sys_on_floppy mov si, diskload call print @@ -1305,7 +1305,7 @@ no_sys_on_floppy: out dx, al if defined extended_primary_loader - cmp [es:BOOT_LO.dev], 1 + cmp [es:BOOT_LO.rd_load_from], RD_LOAD_FROM_HD jne no_sys_from_primary ; load kolibri.img using callback from primary loader and word [movedesc + 24 + 2], 0 diff --git a/kernel/trunk/boot/preboot.inc b/kernel/trunk/boot/preboot.inc index b47a8c94e1..0199ef1039 100644 --- a/kernel/trunk/boot/preboot.inc +++ b/kernel/trunk/boot/preboot.inc @@ -26,9 +26,9 @@ preboot_gprobe db 0 ; probe vesa3 videomodes (1-no, 2-yes) preboot_debug db 0 ; load kernel in debug mode? (1-yes, 2-no) preboot_launcher db 0 ; start launcher after kernel is loaded? (1-yes, 2-no) preboot_dma db 0 ; use DMA for access to HDD (1-always, 2-only for read, 3-never) -preboot_device db 0 ; boot device - ; (1-floppy 2-harddisk 3-kernel restart 4-format ram disk) - ;!!!! 0 - autodetect !!!! +preboot_device db 0 ; device to load ramdisk from + ; 0-floppy 1-harddisk 2-kernel restart + ; 3-format ram disk 4-don't use ramdisk preboot_biosdisk db 0 ; use V86 to access disks through BIOS (1-yes, 2-no) if defined extended_primary_loader ; timeout in 1/18th of second for config settings screen diff --git a/kernel/trunk/boot/rdload.inc b/kernel/trunk/boot/rdload.inc index 366cbd56e9..db6c736f95 100644 --- a/kernel/trunk/boot/rdload.inc +++ b/kernel/trunk/boot/rdload.inc @@ -11,7 +11,7 @@ $Revision$ read_ramdisk: ; READ RAMDISK IMAGE FROM HD (only for IDE0, IDE1, IDE2, IDE3) - cmp byte [BOOT.dev], 1 + cmp byte [BOOT.rd_load_from], RD_LOAD_FROM_HD jne no_sys_on_hd.1 xor ebp, ebp @@ -112,7 +112,7 @@ no_sys_on_hd: DEBUGF 1, "K : RD not found\n" .1: ; test_to_format_ram_disk (need if not using ram disk) - cmp byte [BOOT.dev], 3 + cmp byte [BOOT.rd_load_from], RD_LOAD_FROM_FORMAT jne not_format_ram_disk ; format_ram_disk mov edi, RAMDISK diff --git a/kernel/trunk/boot/uefi4kos.asm b/kernel/trunk/boot/uefi4kos.asm index 3a843821e6..0faf784809 100644 --- a/kernel/trunk/boot/uefi4kos.asm +++ b/kernel/trunk/boot/uefi4kos.asm @@ -232,7 +232,7 @@ main: mov word[esi + BOOT_LO.apm_code_16], 0 mov word[esi + BOOT_LO.apm_data_16], 0 mov byte[esi + BOOT_LO.bios_hd_cnt], 0 - mov word[esi + BOOT_LO.bx_from_load], 'r1' ; boot from /rd/1 + mov word[esi + BOOT_LO.sys_disk], 'r1' ; boot from /rd/1 lgdt [cs:GDTR] diff --git a/kernel/trunk/const.inc b/kernel/trunk/const.inc index ff97d675fa..105c4ecb1c 100644 --- a/kernel/trunk/const.inc +++ b/kernel/trunk/const.inc @@ -683,6 +683,12 @@ struct e820entry type dd ? ends +RD_LOAD_FROM_FLOPPY = 0 +RD_LOAD_FROM_HD = 1 +RD_LOAD_FROM_MEMORY = 2 +RD_LOAD_FROM_FORMAT = 3 +RD_LOAD_FROM_NONE = 4 + struct boot_data bpp db ? ; bits per pixel pitch dw ? ; scanline length @@ -710,13 +716,10 @@ struct boot_data apm_code_32 dw ? apm_code_16 dw ? apm_data_16 dw ? - dev db ? + rd_load_from db ? ; Device to load ramdisk from, RD_LOAD_FROM_* db ? kernel_restart dw ? - bx_from_load dw ? - ; low byte: a,b,c,d -- hdX, r -- rdX - ; high byte: symbol 'X' as in the line above, e.g. '1', not 1 - ; see loader_doc.txt for details + sys_disk dw ? ; Device to mount on /sys/, see loader_doc.txt for details acpi_rsdp dd ? rb 0x1f bios_hd_cnt db ? ; number of BIOS hard disks diff --git a/kernel/trunk/fs/parse_fn.inc b/kernel/trunk/fs/parse_fn.inc index 73f71d4a98..25c9070b43 100644 --- a/kernel/trunk/fs/parse_fn.inc +++ b/kernel/trunk/fs/parse_fn.inc @@ -28,7 +28,7 @@ proc Parser_params locals buff rb 4 ; for test cd endl - mov ax, [BOOT.bx_from_load] + mov ax, [BOOT.sys_disk] mov ecx, sysdir_path mov [ecx-64], dword 'sys' mov [ecx-2], byte 3 diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 8a9c3d4281..e8dc6526e8 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -697,12 +697,11 @@ endg call PIT_init ; Register ramdisk file system - cmp byte [BOOT.dev], 1 + cmp [BOOT.rd_load_from], RD_LOAD_FROM_HD ; will be loaded later je @f - - mov esi, boot_initramdisk - call boot_log - call ramdisk_init + cmp [BOOT.rd_load_from], RD_LOAD_FROM_NONE + je @f + call register_ramdisk ;-------------------------------------- @@: mov esi, boot_initapic @@ -794,7 +793,7 @@ include 'detect/dev_fd.inc' include 'detect/init_ata.inc' ;----------------------------------------------------------------------------- if 0 - mov ax, [BOOT.bx_from_load] + mov ax, [BOOT.sys_disk] cmp ax, 'r1'; if using not ram disk, then load librares and parameters {SPraid.simba} je no_lib_load