From owner-dev-commits-src-main@freebsd.org Wed Jan 6 12:39:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D42BD4CF87C; Wed, 6 Jan 2021 12:39:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D9pps5dn0z3jgn; Wed, 6 Jan 2021 12:39:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B427C1E369; Wed, 6 Jan 2021 12:39:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 106CdngI065401; Wed, 6 Jan 2021 12:39:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 106CdnVF065400; Wed, 6 Jan 2021 12:39:49 GMT (envelope-from git) Date: Wed, 6 Jan 2021 12:39:49 GMT Message-Id: <202101061239.106CdnVF065400@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: babda0952f83 - main - loader: instead of hw.vga.textmode, use screen.textmode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: babda0952f8355a89b3241d5e8943c7da0fa4f6b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2021 12:39:49 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=babda0952f8355a89b3241d5e8943c7da0fa4f6b commit babda0952f8355a89b3241d5e8943c7da0fa4f6b Author: Toomas Soome AuthorDate: 2021-01-06 11:46:34 +0000 Commit: Toomas Soome 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);