summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2009-09-11 02:07:24 +0000
committerXin LI <delphij@FreeBSD.org>2009-09-11 02:07:24 +0000
commit493d6f54bc85aee304350c1a063994471d7c2d2c (patch)
tree3a59f57d6ab18584579943a2d00b9806f359f71d
parentac54649762aa1d6d323d1c4fd140d5a7e1668305 (diff)
Notes
-rw-r--r--share/man/man4/syscons.414
-rw-r--r--sys/dev/syscons/syscons.c21
-rw-r--r--sys/dev/syscons/syscons.h2
3 files changed, 22 insertions, 15 deletions
diff --git a/share/man/man4/syscons.4 b/share/man/man4/syscons.4
index 3f6e9caceb3d4..2c9d21d905631 100644
--- a/share/man/man4/syscons.4
+++ b/share/man/man4/syscons.4
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 22, 2006
+.Dd September 10, 2009
.Dt SYSCONS 4
.Os
.Sh NAME
@@ -325,7 +325,7 @@ This mode is useful on some laptop computers, but less so on
most other systems, and it adds substantial amount of code to syscons.
If this option is NOT defined, you can reduce the kernel size a lot.
See the
-.Dv VESA800X600
+.Dv VESAMODE
flag below.
.It Dv SC_TWOBUTTON_MOUSE
If you have a two button mouse, you may want to add this option
@@ -426,15 +426,15 @@ or else at the loader prompt (see
.\".It bit 6 (QUIET_BELL)
.\"This option suppresses the bell, whether audible or visual,
.\"if it is rung in a background virtual terminal.
-.It 0x0080 (VESA800X600)
-This option puts the video card in the VESA 800x600 pixel, 16 color
-mode.
-It may be useful for laptop computers for which the 800x600 mode
-is otherwise unsupported by the X server.
+.It 0x0080 (VESAMODE)
+This option puts the video card in the VESA mode specified by higher
+16 bits of the flags during kernel initialization.
Note that in order for this flag to work, the kernel must be
compiled with the
.Dv SC_PIXEL_MODE
option explained above.
+A list of the available mode can be obtained via
+.Xr vidcontrol 1 .
.\"Note also that the ``copy-and-paste'' function is not currently supported
.\"in this mode and the mouse pointer will not be displayed.
.It 0x0100 (AUTODETECT_KBD)
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index 653ff08274a91..4fcbf4173df63 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -352,6 +352,7 @@ sc_attach_unit(int unit, int flags)
#endif
int vc;
struct cdev *dev;
+ u_int16_t vmode;
flags &= ~SC_KERNEL_CONSOLE;
@@ -372,16 +373,20 @@ sc_attach_unit(int unit, int flags)
if (sc_console == NULL) /* sc_console_unit < 0 */
sc_console = scp;
+ vmode = (flags >> 16) & 0x1fff;
+ if (vmode < M_VESA_BASE || vmode > M_VESA_MODE_MAX)
+ vmode = M_VESA_FULL_800;
+
#ifdef SC_PIXEL_MODE
- if ((sc->config & SC_VESA800X600)
- && (vidd_get_info(sc->adp, M_VESA_800x600, &info) == 0)) {
+ if ((sc->config & SC_VESAMODE)
+ && (vidd_get_info(sc->adp, vmode, &info) == 0)) {
#ifdef DEV_SPLASH
if (sc->flags & SC_SPLASH_SCRN)
splash_term(sc->adp);
#endif
- sc_set_graphics_mode(scp, NULL, M_VESA_800x600);
- sc_set_pixel_mode(scp, NULL, COL, ROW, 16, 8);
- sc->initial_mode = M_VESA_800x600;
+ sc_set_graphics_mode(scp, NULL, vmode);
+ sc_set_pixel_mode(scp, NULL, 0, 0, 16, 8);
+ sc->initial_mode = vmode;
#ifdef DEV_SPLASH
/* put up the splash again! */
if (sc->flags & SC_SPLASH_SCRN)
@@ -517,7 +522,7 @@ sctty_open(struct tty *tp)
if (scp == NULL) {
scp = SC_STAT(tp) = alloc_scp(sc, SC_VTY(tp));
if (ISGRAPHSC(scp))
- sc_set_pixel_mode(scp, NULL, COL, ROW, 16, 8);
+ sc_set_pixel_mode(scp, NULL, 0, 0, 16, 8);
}
if (!tp->t_winsize.ws_col && !tp->t_winsize.ws_row) {
tp->t_winsize.ws_col = scp->xsize;
@@ -2995,6 +3000,8 @@ init_scp(sc_softc_t *sc, int vty, scr_stat *scp)
scp->ysize = info.vi_height;
scp->xpixel = scp->xsize*info.vi_cwidth;
scp->ypixel = scp->ysize*info.vi_cheight;
+ }
+
scp->font_size = info.vi_cheight;
scp->font_width = info.vi_cwidth;
if (info.vi_cheight < 14) {
@@ -3016,7 +3023,7 @@ init_scp(sc_softc_t *sc, int vty, scr_stat *scp)
scp->font = NULL;
#endif
}
- }
+
sc_vtb_init(&scp->vtb, VTB_MEMORY, 0, 0, NULL, FALSE);
#ifndef __sparc64__
sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, 0, 0, NULL, FALSE);
diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h
index c0ed6c1fd6422..202769f120c00 100644
--- a/sys/dev/syscons/syscons.h
+++ b/sys/dev/syscons/syscons.h
@@ -191,7 +191,7 @@ struct tty;
typedef struct sc_softc {
int unit; /* unit # */
int config; /* configuration flags */
-#define SC_VESA800X600 (1 << 7)
+#define SC_VESAMODE (1 << 7)
#define SC_AUTODETECT_KBD (1 << 8)
#define SC_KERNEL_CONSOLE (1 << 9)