config: Misc improvements

This commit is contained in:
mintsuki 2022-03-22 04:39:51 +01:00
parent 99a4eaac23
commit 49a8dfe4b2
3 changed files with 87 additions and 85 deletions

View File

@ -62,12 +62,18 @@ Some keys take *URIs* as values; these are described in the next section.
* `SERIAL` - If set to `yes`, enable serial I/O for the bootloader.
* `DEFAULT_ENTRY` - 1-based entry index of the entry which will be automatically selected at startup. If unspecified, it is `1`.
* `GRAPHICS` - If set to `no`, force CGA text mode for the boot menu, else use a video mode. Ignored with Limine UEFI.
* `MENU_RESOLUTION` - Specify screen resolution to be used by the Limine menu in the form `<width>x<height>`. This will *only* affect the menu, not any booted OS. If not specified, Limine will pick a resolution automatically. If the resolution is not available, Limine will pick another one automatically. Ignored if `GRAPHICS` is not `yes`.
* `MENU_BRANDING` - A string that will be displayed on top of the Limine menu.
* `MENU_BRANDING_COLOUR` - A value between 0 and 7 specifying the colour of the branding string. Default is cyan (6).
* `MENU_BRANDING_COLOR` - Alias of `MENU_BRANDING_COLOUR`.
* `VERBOSE` - If set to `yes`, print additional information during boot. Defaults to not verbose.
* `RANDOMISE_MEMORY` - If set to `yes`, randomise the contents of RAM at bootup in order to find bugs related to non zeroed memory or for security reasons. This option will slow down boot time significantly. For the BIOS port of Limine, this will only randomise memory below 4GiB.
* `RANDOMIZE_MEMORY` - Alias of `RANDOMISE_MEMORY`.
The following options control Limine's graphical terminal. They are ignored if using text mode.
Limine interface control options.
* `INTERFACE_RESOLUTION` - Specify screen resolution to be used by the Limine interface (menu, editor, console...) in the form `<width>x<height>`. This will *only* affect the Limine interface, not any booted OS. If not specified, Limine will pick a resolution automatically. If the resolution is not available, Limine will pick another one automatically. Ignored if using text mode.
* `INTERFACE_BRANDING` - A string that will be displayed on top of the Limine interface.
* `INTERFACE_BRANDING_COLOUR` - A value between 0 and 7 specifying the colour of the branding string. Default is cyan (6).
* `INTERFACE_BRANDING_COLOR` - Alias of `INTERFACE_BRANDING_COLOUR`.
Limine graphical terminal control options. They are ignored if using text mode.
* `TERM_FONT` - URI path to a font file to be used instead of the default one for the menu and terminal. The font file must be a code page 437 character set comprised of 256 consecutive glyph bitmaps. Each glyph's bitmap must be expressed left to right (1 byte per row), and top to bottom (16 bytes per whole glyph by default; see `TERM_FONT_SIZE`). See e.g. the [VGA text mode font collection](https://github.com/viler-int10h/vga-text-mode-fonts) for fonts.
* `TERM_FONT_SIZE` - The size of the font in dots, which must correspond to the font file or the display will be garbled. Note that glyphs are always one byte wide, and columns over 8 are empty. Many fonts may be used in both 8- and 9-dot wide variants. Defaults to `8x16`. Ignored if `TERM_FONT` not set or if the font fails to load.
@ -83,16 +89,15 @@ The following options control Limine's graphical terminal. They are ignored if u
* `TERM_WALLPAPER_STYLE` - The style which will be used to display the wallpaper image: `tiled`, `centered`, or `stretched`. Default is `stretched`.
* `TERM_BACKDROP` - When the background style is `centered`, this specifies the colour of the backdrop for parts of the screen not covered by the background image, in RRGGBB format.
Editor control options.
* `EDITOR_ENABLED` - If set to `no`, the editor will not be accessible. Defaults to `yes`.
* `EDITOR_HIGHLIGHTING` - If set to `no`, syntax highlighting in the editor will be disabled. Defaults to `yes`.
* `EDITOR_VALIDATION` - If set to `no`, the editor will not alert you about invalid keys / syntax errors. Defaults to `yes`.
* `VERBOSE` - If set to `yes`, print additional information during boot. Defaults to not verbose.
* `RANDOMISE_MEMORY` - If set to `yes`, randomise the contents of RAM at bootup in order to find bugs related to non zeroed memory or for security reasons. This option will slow down boot time significantly. For the BIOS port of Limine, this will only randomise memory below 4GiB.
* `RANDOMIZE_MEMORY` - Alias of `RANDOMISE_MEMORY`.
*Locally assignable (non protocol specific)* keys are:
* `COMMENT` - An optional comment string that will be displayed by the bootloader on the menu when an entry is selected.
* `PROTOCOL` - The boot protocol that will be used to boot the kernel. Valid protocols are: `linux`, `stivale`, `stivale2`, `chainload`, `multiboot` or `multiboot1` and `multiboot2`. If the protocol is omitted, Limine will try to autodetect it, following this list of protocols, in this order: `stivale2 -> stivale1 -> multiboot2 -> multiboot1 -> linux -> failure`.
* `PROTOCOL` - The boot protocol that will be used to boot the kernel. Valid protocols are: `linux`, `limine`, `stivale`, `stivale2`, `chainload`, `multiboot` or `multiboot1` and `multiboot2`. If the protocol is omitted, Limine will try to autodetect it, following this list of protocols, in this order: `stivale2 -> stivale1 -> multiboot2 -> multiboot1 -> limine -> linux -> failure`.
* `CMDLINE` - The command line string to be passed to the kernel. Can be omitted.
* `KERNEL_CMDLINE` - Alias of `CMDLINE`.
@ -105,6 +110,24 @@ The following options control Limine's graphical terminal. They are ignored if u
modules.
* `RESOLUTION` - The resolution to be used. This setting takes the form of `<width>x<height>x<bpp>`. If the resolution is not available, Limine will pick another one automatically. Omitting `<bpp>` will default to 32.
* `TEXTMODE` - If set to `yes`, prefer text mode. (BIOS only)
* Limine protocol:
* `KERNEL_PATH` - The URI path of the kernel.
* `MODULE_PATH` - The URI path to a module.
* `MODULE_CMDLINE` - A command line to be passed to a module.
**Note:** One can define these 2 last variable multiple times to specify multiple
modules.
The entries will be matched in order. E.g.: The 1st module path entry will be matched
to the 1st module string entry that appear, and so on.
* `RESOLUTION` - The resolution to be used. This setting takes the form of `<width>x<height>x<bpp>`. If the resolution is not available, Limine will pick another one automatically. Omitting `<bpp>` will default to 32.
* `KASLR` - For relocatable kernels, if set to `no`, disable kernel address space layout randomisation. KASLR is enabled by default.
* Chainload protocol on BIOS:
* `DRIVE` - The 1-based BIOS drive to chainload, if omitted, assume boot drive.
* `PARTITION` - The 1-based BIOS partition to chainload, if omitted, chainload drive (MBR).
* Chainload protocol on UEFI:
* `IMAGE_PATH` - URI of the EFI application to chainload.
* `RESOLUTION` - The resolution to be used. This setting takes the form of `<width>x<height>x<bpp>`. If the resolution is not available, Limine will pick another one automatically. Omitting `<bpp>` will default to 32.
* stivale and stivale2 protocols:
* `KERNEL_PATH` - The URI path of the kernel.
* `MODULE_PATH` - The URI path to a module.

View File

@ -673,13 +673,13 @@ static noreturn void _menu(bool timeout_enabled) {
editor_enabled = strcmp(editor_enabled_str, "yes") == 0;
}
menu_branding = config_get_value(NULL, 0, "MENU_BRANDING");
menu_branding = config_get_value(NULL, 0, "INTERFACE_BRANDING");
if (menu_branding == NULL)
menu_branding = "Limine " LIMINE_VERSION;
menu_branding_colour = config_get_value(NULL, 0, "MENU_BRANDING_COLOUR");
menu_branding_colour = config_get_value(NULL, 0, "INTERFACE_BRANDING_COLOUR");
if (menu_branding_colour == NULL)
menu_branding_colour = config_get_value(NULL, 0, "MENU_BRANDING_COLOR");
menu_branding_colour = config_get_value(NULL, 0, "INTERFACE_BRANDING_COLOR");
if (menu_branding_colour == NULL)
menu_branding_colour = "6";
@ -730,7 +730,7 @@ reterm:
if (graphics == NULL || strcmp(graphics, "no") == 1) {
size_t req_width = 0, req_height = 0, req_bpp = 0;
char *menu_resolution = config_get_value(NULL, 0, "MENU_RESOLUTION");
char *menu_resolution = config_get_value(NULL, 0, "INTERFACE_RESOLUTION");
if (menu_resolution != NULL)
parse_resolution(&req_width, &req_height, &req_bpp, menu_resolution);
@ -940,6 +940,7 @@ autodetect:
stivale_load(config, cmdline);
multiboot2_load(config, cmdline);
multiboot1_load(config, cmdline);
limine_load(config, cmdline);
linux_load(config, cmdline);
panic(true, "Kernel protocol autodetection failed");
}

View File

@ -1,107 +1,85 @@
${STIVALE_KERNEL}=boot:///boot/test.elf
${BACKGROUND_PATH}=boot:///boot/bg.bmp
# Some example macros
${TEST_KERNEL}=boot:///boot/test.elf
${WALLPAPER_PATH}=boot:///boot/bg.bmp
DEFAULT_ENTRY=1
TIMEOUT=3
VERBOSE=yes
# Terminal related settings
TERM_BACKGROUND=68000000
TERM_WALLPAPER=${BACKGROUND_PATH}
TERM_WALLPAPER=${WALLPAPER_PATH}
TERM_BACKDROP=008080
:Limine Test
COMMENT=Test of the Limine boot protocol.
COMMENT=Test of the Limine boot protocol.
PROTOCOL=limine
KERNEL_PATH=${TEST_KERNEL}
KERNEL_CMDLINE=This is an example kernel command line.
PROTOCOL=limine
KERNEL_PATH=${STIVALE_KERNEL}
KERNEL_CMDLINE=Woah! Another example!
MODULE_PATH=${BACKGROUND_PATH}
MODULE_CMDLINE=This is the first module.
MODULE_PATH=${BACKGROUND_PATH}
MODULE_CMDLINE=yooooo
# Test that the module string provided to the kernel will be
# the module path since a module string is not specified.
# (cc CONFIG.md stivale2.`MODULE_STRING` section)
MODULE_PATH=boot:///boot/bg.bmp
MODULE_PATH=boot:///boot/bg.bmp
:Multiboot2 Test
COMMENT=Test of the multiboot2 boot protocol.
COMMENT=Test of the multiboot2 boot protocol.
PROTOCOL=multiboot2
KERNEL_PATH=boot:///boot/multiboot2.elf
KERNEL_CMDLINE=This is an example kernel command line.
PROTOCOL=multiboot2
RESOLUTION=800x600
KERNEL_PATH=boot:///boot/multiboot2.elf
KERNEL_CMDLINE=Woah! Another another example!
MODULE_PATH=boot:///boot/bg.bmp
MODULE_STRING=This is the background image!
MODULE_PATH=boot:///boot/bg.bmp
MODULE_STRING=This is the first module.
:EFI Chainloading
COMMENT=Test EFI image chainloading.
COMMENT=Test EFI image chainloading.
PROTOCOL=chainload
IMAGE_PATH=boot:///EFI/BOOT/BOOTX64.EFI
PROTOCOL=chainload
IMAGE_PATH=boot:///EFI/BOOT/BOOTX64.EFI
:BIOS Chainloading
COMMENT=Test BIOS chainloading.
COMMENT=Test EFI image chainloading.
PROTOCOL=chainload
DRIVE=1
PROTOCOL=chainload
DRIVE=1
:+Legacy
COMMENT=Directory containing legacy entries.
COMMENT=Contains legacy entries.
::Stivale Test
COMMENT=Stivale1 test.
::Stivale Test
PROTOCOL=stivale
KERNEL_PATH=boot:///boot/test.elf
KERNEL_CMDLINE=This is an example kernel command line.
COMMENT=Stivale1 test.
MODULE_PATH=boot:///boot/test.elf
MODULE_STRING=This is the first module.
PROTOCOL=stivale
KERNEL_PATH=boot:///boot/test.elf
KERNEL_CMDLINE=Hi! This is an example!
MODULE_PATH=boot:///boot/bg.bmp
MODULE_STRING=This is the second module.
MODULE_PATH=boot:///boot/test.elf
MODULE_STRING=yooooo
::Stivale2 Test
COMMENT=Stivale2 test.
MODULE_PATH=boot:///boot/bg.bmp
MODULE_STRING=yooooo
PROTOCOL=stivale2
KERNEL_PATH=boot:///boot/test.elf
KERNEL_CMDLINE=This is an example kernel command line.
::Multiboot1 Test
MODULE_PATH=boot:///boot/test.elf
MODULE_STRING=This is the first module.
COMMENT=Test of the multiboot1 boot protocol.
MODULE_PATH=boot:///boot/bg.bmp
MODULE_STRING=This is the second module.
PROTOCOL=multiboot1
RESOLUTION=800x600
KERNEL_PATH=boot:///boot/multiboot.elf
KERNEL_CMDLINE=Woah! Another another another example!
::Multiboot1 Test
COMMENT=Test of the multiboot1 boot protocol.
MODULE_PATH=boot:///boot/bg.bmp
MODULE_STRING=This is the background image! Yay!
# Test that this should be NULL:
MODULE_PATH=boot:///boot/bg.bmp
:Test hdd://
PROTOCOL=stivale2
RESOLUTION=640x480x16
KERNEL_PATH=hdd://1:1/boot/test.elf
KERNEL_CMDLINE=Woah! Another example!
MODULE_PATH=hdd://1:1/boot/bg.bmp
MODULE_STRING=yooooo
:Test odd://
PROTOCOL=stivale2
RESOLUTION=640x480x16
KERNEL_PATH=odd://1:/boot/test.elf
KERNEL_CMDLINE=Woah! Another example!
MODULE_PATH=odd://1:/boot/bg.bmp
MODULE_STRING=yooooo
PROTOCOL=multiboot1
KERNEL_PATH=boot:///boot/multiboot.elf
KERNEL_CMDLINE=This is an example kernel command line.
MODULE_PATH=boot:///boot/bg.bmp
MODULE_STRING=This is the first module.