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
This commit is contained in:
Ivan Baravy 2020-10-02 13:05:10 +00:00
parent a2700ea35c
commit bf38c73d0a
7 changed files with 26 additions and 24 deletions

View File

@ -287,13 +287,13 @@ else
; \end{diamond}[02.12.2005] ; \end{diamond}[02.12.2005]
; if bootloader sets cx = 'HA' and dx = 'RD', then bx contains identifier of source disk ; 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) ; (see comment to BOOT_LO.sys_disk and loader_doc.txt)
mov word [es:BOOT_LO.bx_from_load], 'r1' ; default value: /rd/1 mov word [es:BOOT_LO.sys_disk], 'r1' ; default value: /rd/1
cmp cx, 'HA' cmp cx, 'HA'
jnz no_hd_load jnz no_hd_load
cmp dx, 'RD' cmp dx, 'RD'
jnz no_hd_load jnz no_hd_load
mov [es:BOOT_LO.bx_from_load], bx mov [es:BOOT_LO.sys_disk], bx
no_hd_load: no_hd_load:
; set up stack ; set up stack
@ -971,14 +971,14 @@ end if
mov al, [preboot_device] mov al, [preboot_device]
dec al dec al
mov [es:BOOT_LO.dev], al mov [es:BOOT_LO.rd_load_from], al
; GET MEMORY MAP ; GET MEMORY MAP
include '../detect/biosmem.inc' include '../detect/biosmem.inc'
; READ DISKETTE TO MEMORY ; 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 jne no_sys_on_floppy
mov si, diskload mov si, diskload
call print call print
@ -1305,7 +1305,7 @@ no_sys_on_floppy:
out dx, al out dx, al
if defined extended_primary_loader 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 jne no_sys_from_primary
; load kolibri.img using callback from primary loader ; load kolibri.img using callback from primary loader
and word [movedesc + 24 + 2], 0 and word [movedesc + 24 + 2], 0

View File

@ -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_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_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_dma db 0 ; use DMA for access to HDD (1-always, 2-only for read, 3-never)
preboot_device db 0 ; boot device preboot_device db 0 ; device to load ramdisk from
; (1-floppy 2-harddisk 3-kernel restart 4-format ram disk) ; 0-floppy 1-harddisk 2-kernel restart
;!!!! 0 - autodetect !!!! ; 3-format ram disk 4-don't use ramdisk
preboot_biosdisk db 0 ; use V86 to access disks through BIOS (1-yes, 2-no) preboot_biosdisk db 0 ; use V86 to access disks through BIOS (1-yes, 2-no)
if defined extended_primary_loader if defined extended_primary_loader
; timeout in 1/18th of second for config settings screen ; timeout in 1/18th of second for config settings screen

View File

@ -11,7 +11,7 @@ $Revision$
read_ramdisk: read_ramdisk:
; READ RAMDISK IMAGE FROM HD (only for IDE0, IDE1, IDE2, IDE3) ; 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 jne no_sys_on_hd.1
xor ebp, ebp xor ebp, ebp
@ -112,7 +112,7 @@ no_sys_on_hd:
DEBUGF 1, "K : RD not found\n" DEBUGF 1, "K : RD not found\n"
.1: .1:
; test_to_format_ram_disk (need if not using ram disk) ; 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 jne not_format_ram_disk
; format_ram_disk ; format_ram_disk
mov edi, RAMDISK mov edi, RAMDISK

View File

@ -232,7 +232,7 @@ main:
mov word[esi + BOOT_LO.apm_code_16], 0 mov word[esi + BOOT_LO.apm_code_16], 0
mov word[esi + BOOT_LO.apm_data_16], 0 mov word[esi + BOOT_LO.apm_data_16], 0
mov byte[esi + BOOT_LO.bios_hd_cnt], 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] lgdt [cs:GDTR]

View File

@ -683,6 +683,12 @@ struct e820entry
type dd ? type dd ?
ends 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 struct boot_data
bpp db ? ; bits per pixel bpp db ? ; bits per pixel
pitch dw ? ; scanline length pitch dw ? ; scanline length
@ -710,13 +716,10 @@ struct boot_data
apm_code_32 dw ? apm_code_32 dw ?
apm_code_16 dw ? apm_code_16 dw ?
apm_data_16 dw ? apm_data_16 dw ?
dev db ? rd_load_from db ? ; Device to load ramdisk from, RD_LOAD_FROM_*
db ? db ?
kernel_restart dw ? kernel_restart dw ?
bx_from_load dw ? sys_disk dw ? ; Device to mount on /sys/, see loader_doc.txt for details
; 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
acpi_rsdp dd ? acpi_rsdp dd ?
rb 0x1f rb 0x1f
bios_hd_cnt db ? ; number of BIOS hard disks bios_hd_cnt db ? ; number of BIOS hard disks

View File

@ -28,7 +28,7 @@ proc Parser_params
locals locals
buff rb 4 ; for test cd buff rb 4 ; for test cd
endl endl
mov ax, [BOOT.bx_from_load] mov ax, [BOOT.sys_disk]
mov ecx, sysdir_path mov ecx, sysdir_path
mov [ecx-64], dword 'sys' mov [ecx-64], dword 'sys'
mov [ecx-2], byte 3 mov [ecx-2], byte 3

View File

@ -697,12 +697,11 @@ endg
call PIT_init call PIT_init
; Register ramdisk file system ; Register ramdisk file system
cmp byte [BOOT.dev], 1 cmp [BOOT.rd_load_from], RD_LOAD_FROM_HD ; will be loaded later
je @f je @f
cmp [BOOT.rd_load_from], RD_LOAD_FROM_NONE
mov esi, boot_initramdisk je @f
call boot_log call register_ramdisk
call ramdisk_init
;-------------------------------------- ;--------------------------------------
@@: @@:
mov esi, boot_initapic mov esi, boot_initapic
@ -794,7 +793,7 @@ include 'detect/dev_fd.inc'
include 'detect/init_ata.inc' include 'detect/init_ata.inc'
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
if 0 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} cmp ax, 'r1'; if using not ram disk, then load librares and parameters {SPraid.simba}
je no_lib_load je no_lib_load