loader: instead of hw.vga.textmode, use screen.textmode

hw.vga.textmode is directing VT VGA backend to use text mode.

The default screen mode for BIOS loader is text, and default
screen mode for VT VGA backend is graphics (unless we are running on
hypervisor or hw.vga.textmode is set to 1). Using hw.vga.textmode
for loader does remove possibility to have graphical mode VT VGA with
text mode loader.

screen.textmode can have possible values "0" to disable text mode,
and "1" to set text mode.
This commit is contained in:
Toomas Soome 2021-01-06 13:46:34 +02:00
parent 31c2bcad7e
commit babda0952f
2 changed files with 31 additions and 9 deletions

View File

@ -23,7 +23,7 @@
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
.Dd December 31, 2020
.Dd Januar 6, 2020
.Dt LOADER.CONF 5
.Os
.Sh NAME
@ -237,10 +237,33 @@ selects the video console which prevents any input and hides all output
replacing it with
.Dq spinning
character (useful for embedded products and such).
.It Va screen.font
Set font size for framebuffer mode.
Default font size is selected based on screen resolution, to achieve
terminal dimensions 80x24.
.It Va screen.textmode
Value "0" will trigger BIOS loader to switch to use VESA BIOS Extension (VBE)
frame buffer mode for console.
The same effect can be achieved by setting
.Va vbe_max_resolution .
.Pp
Value "1" will force BIOS loader to use VGA text mode.
.Pp
If
.Va vbe_max_resolution
is not set, the loader will try to set screen resolution based on EDID
information.
If EDID is not available, the default resolution is 800x600 (if available).
.It Va screen.height
.It Va screen.width
.It Va screen.depth
.Va screen.height ,
.Va screen.width ,
.Va screen.depth
are set by loader when loader is using framebuffer mode to draw the screen.
.It Va efi_max_resolution
.It Va vbe_max_resolution
Specify the maximum desired resolution for the EFI or VESA BIOS Extension (VBE)
framebuffer console.
Specify the maximum desired resolution for the EFI or VBE framebuffer console.
The following values are accepted:
.Bl -column "WidthxHeight"
.It Sy Value Ta Sy Resolution

View File

@ -274,7 +274,7 @@ bios_set_text_mode(int mode)
gfx_state.tg_fb.fb_mask_green = (1 << palette_format) - 1 << 8;
gfx_state.tg_fb.fb_mask_blue = (1 << palette_format) - 1 << 0;
gfx_state.tg_ctype = CT_INDEXED;
env_setenv("hw.vga.textmode", EV_VOLATILE | EV_NOHOOK, "1", NULL, NULL);
env_setenv("screen.textmode", EV_VOLATILE | EV_NOHOOK, "1", NULL, NULL);
}
/* Function 00h - Return VBE Controller Information */
@ -378,7 +378,7 @@ biosvbe_set_mode(int mode, struct crtciinfoblock *ci)
if (biosvbe_palette_format(&m) == VBE_SUCCESS)
palette_format = m;
}
env_setenv("hw.vga.textmode", EV_VOLATILE | EV_NOHOOK, "0", NULL, NULL);
env_setenv("screen.textmode", EV_VOLATILE | EV_NOHOOK, "0", NULL, NULL);
return (rv);
}
@ -508,19 +508,18 @@ mode_set(struct env_var *ev, int flags __unused, const void *value)
{
int mode;
if (strcmp(ev->ev_name, "hw.vga.textmode") == 0) {
if (strcmp(ev->ev_name, "screen.textmode") == 0) {
unsigned long v;
char *end;
if (value == NULL)
return (0);
/* VT(4) describes hw.vga.textmode values 0 or 1. */
errno = 0;
v = strtoul(value, &end, 0);
if (errno != 0 || *(char *)value == '\0' || *end != '\0' ||
(v != 0 && v != 1))
return (EINVAL);
env_setenv("hw.vga.textmode", EV_VOLATILE | EV_NOHOOK,
env_setenv("screen.textmode", EV_VOLATILE | EV_NOHOOK,
value, NULL, NULL);
if (v == 1) {
reset_font_flags();
@ -574,7 +573,7 @@ vbe_init(void)
vbe_mode = NULL;
}
env_setenv("hw.vga.textmode", EV_VOLATILE, "1", mode_set,
env_setenv("screen.textmode", EV_VOLATILE, "1", mode_set,
env_nounset);
env_setenv("vbe_max_resolution", EV_VOLATILE, NULL, mode_set,
env_nounset);