git: babda0952f83 - main - loader: instead of hw.vga.textmode, use screen.textmode

Toomas Soome tsoome at FreeBSD.org
Wed Jan 6 12:39:49 UTC 2021


The branch main has been updated by tsoome:

URL: https://cgit.FreeBSD.org/src/commit/?id=babda0952f8355a89b3241d5e8943c7da0fa4f6b

commit babda0952f8355a89b3241d5e8943c7da0fa4f6b
Author:     Toomas Soome <tsoome at FreeBSD.org>
AuthorDate: 2021-01-06 11:46:34 +0000
Commit:     Toomas Soome <tsoome at FreeBSD.org>
CommitDate: 2021-01-06 12:38:55 +0000

    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.
---
 stand/defaults/loader.conf.5 | 29 ++++++++++++++++++++++++++---
 stand/i386/libi386/vbe.c     | 11 +++++------
 2 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/stand/defaults/loader.conf.5 b/stand/defaults/loader.conf.5
index 22fe9812a33a..2adfbacc3a62 100644
--- a/stand/defaults/loader.conf.5
+++ b/stand/defaults/loader.conf.5
@@ -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
diff --git a/stand/i386/libi386/vbe.c b/stand/i386/libi386/vbe.c
index 232f13dab077..6a70cfe6f3e9 100644
--- a/stand/i386/libi386/vbe.c
+++ b/stand/i386/libi386/vbe.c
@@ -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);


More information about the dev-commits-src-all mailing list