linux: Add TEXTMODE config option

This commit is contained in:
mintsuki 2021-11-27 00:44:07 +01:00
parent 6b0c9c4cb1
commit f5b3653d26
2 changed files with 12 additions and 0 deletions

View File

@ -100,6 +100,7 @@ Some keys take *URIs* as values; these are described in the next section.
Note that one can define this last variable multiple times to specify multiple
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)
* stivale and stivale2 protocols:
* `KERNEL_PATH` - The URI path of the kernel.
* `MODULE_PATH` - The URI path to a module.

View File

@ -495,6 +495,16 @@ bool linux_load(char *config, char *cmdline) {
struct screen_info *screen_info = &boot_params->screen_info;
#if bios == 1
{
char *textmode_str = config_get_value(config, 0, "TEXTMODE");
bool textmode = textmode_str != NULL && strcmp(textmode_str, "yes") == 0;
if (textmode) {
goto set_textmode;
}
}
#endif
size_t req_width = 0, req_height = 0, req_bpp = 0;
char *resolution = config_get_value(config, 0, "RESOLUTION");
@ -506,6 +516,7 @@ bool linux_load(char *config, char *cmdline) {
#if uefi == 1
panic("linux: Unable to set video mode");
#elif bios == 1
set_textmode:;
size_t rows, cols;
init_vga_textmode(&rows, &cols, false);