Index: sys/arch/i386/conf/DELPHI =================================================================== RCS file: /cvsroot/src/sys/arch/i386/conf/DELPHI,v retrieving revision 1.38 diff -u -r1.38 DELPHI --- sys/arch/i386/conf/DELPHI 28 Jul 2004 12:34:02 -0000 1.38 +++ sys/arch/i386/conf/DELPHI 29 Jul 2004 22:15:04 -0000 @@ -170,6 +170,9 @@ #options WS_KERNEL_BG=WSCOL_BLACK #options WS_KERNEL_COLATTR="" #options WS_KERNEL_MONOATTR="" +# customization of console border color +#options WSDISPLAY_CUSTOM_BORDER # border customization from wsconsctl(8) +#options WSDISPLAY_BORDER_COLOR=WSCOL_BLUE # default color # compatibility to other console drivers options WSDISPLAY_COMPAT_PCVT # emulate some ioctls options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls Index: sys/arch/i386/conf/GENERIC =================================================================== RCS file: /cvsroot/src/sys/arch/i386/conf/GENERIC,v retrieving revision 1.624 diff -u -r1.624 GENERIC --- sys/arch/i386/conf/GENERIC 28 Jul 2004 12:34:02 -0000 1.624 +++ sys/arch/i386/conf/GENERIC 29 Jul 2004 22:15:14 -0000 @@ -236,6 +236,9 @@ #options WS_KERNEL_BG=WSCOL_BLACK #options WS_KERNEL_COLATTR="" #options WS_KERNEL_MONOATTR="" +# customization of console border color +options WSDISPLAY_CUSTOM_BORDER # border customization from wsconsctl(8) +#options WSDISPLAY_BORDER_COLOR=WSCOL_BLUE # default color # compatibility to other console drivers options WSDISPLAY_COMPAT_PCVT # emulate some ioctls options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls Index: sys/arch/i386/conf/GENERIC_LAPTOP =================================================================== RCS file: /cvsroot/src/sys/arch/i386/conf/GENERIC_LAPTOP,v retrieving revision 1.108 diff -u -r1.108 GENERIC_LAPTOP --- sys/arch/i386/conf/GENERIC_LAPTOP 28 Jul 2004 12:34:02 -0000 1.108 +++ sys/arch/i386/conf/GENERIC_LAPTOP 29 Jul 2004 22:15:15 -0000 @@ -200,6 +200,9 @@ #options WS_KERNEL_BG=WSCOL_BLACK #options WS_KERNEL_COLATTR="" #options WS_KERNEL_MONOATTR="" +# customization of console border color +options WSDISPLAY_CUSTOM_BORDER # border customization from wsconsctl(8) +#options WSDISPLAY_BORDER_COLOR=WSCOL_BLUE # default color # compatibility to other console drivers options WSDISPLAY_COMPAT_PCVT # emulate some ioctls options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls Index: sys/arch/i386/conf/GENERIC_TINY =================================================================== RCS file: /cvsroot/src/sys/arch/i386/conf/GENERIC_TINY,v retrieving revision 1.70 diff -u -r1.70 GENERIC_TINY --- sys/arch/i386/conf/GENERIC_TINY 28 Jul 2004 12:34:02 -0000 1.70 +++ sys/arch/i386/conf/GENERIC_TINY 29 Jul 2004 22:15:15 -0000 @@ -180,6 +180,9 @@ #options WS_KERNEL_BG=WSCOL_BLACK #options WS_KERNEL_COLATTR="" #options WS_KERNEL_MONOATTR="" +# customization of console border color +#options WSDISPLAY_CUSTOM_BORDER # border customization from wsconsctl(8) +#options WSDISPLAY_BORDER_COLOR=WSCOL_BLUE # default color # compatibility to other console drivers options WSDISPLAY_COMPAT_PCVT # emulate some ioctls options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls Index: sys/arch/i386/conf/INSTALL =================================================================== RCS file: /cvsroot/src/sys/arch/i386/conf/INSTALL,v retrieving revision 1.246 diff -u -r1.246 INSTALL --- sys/arch/i386/conf/INSTALL 28 Jul 2004 12:34:02 -0000 1.246 +++ sys/arch/i386/conf/INSTALL 29 Jul 2004 22:15:16 -0000 @@ -168,6 +168,9 @@ #options WS_KERNEL_BG=WSCOL_BLACK #options WS_KERNEL_COLATTR="" #options WS_KERNEL_MONOATTR="" +# customization of console border color +#options WSDISPLAY_CUSTOM_BORDER # border customization from wsconsctl(8) +#options WSDISPLAY_BORDER_COLOR=WSCOL_BLUE # default color # compatibility to other console drivers #options WSDISPLAY_COMPAT_PCVT # emulate some ioctls #options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls Index: sys/arch/i386/conf/INSTALL_LAPTOP =================================================================== RCS file: /cvsroot/src/sys/arch/i386/conf/INSTALL_LAPTOP,v retrieving revision 1.65 diff -u -r1.65 INSTALL_LAPTOP --- sys/arch/i386/conf/INSTALL_LAPTOP 28 Jul 2004 12:34:04 -0000 1.65 +++ sys/arch/i386/conf/INSTALL_LAPTOP 29 Jul 2004 22:15:16 -0000 @@ -166,6 +166,9 @@ #options WS_KERNEL_BG=WSCOL_BLACK #options WS_KERNEL_COLATTR="" #options WS_KERNEL_MONOATTR="" +# customization of console border color +#options WSDISPLAY_CUSTOM_BORDER # border customization from wsconsctl(8) +#options WSDISPLAY_BORDER_COLOR=WSCOL_BLUE # default color # compatibility to other console drivers #options WSDISPLAY_COMPAT_PCVT # emulate some ioctls #options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls Index: sys/arch/i386/conf/IOPENER =================================================================== RCS file: /cvsroot/src/sys/arch/i386/conf/IOPENER,v retrieving revision 1.47 diff -u -r1.47 IOPENER --- sys/arch/i386/conf/IOPENER 28 Jul 2004 12:34:04 -0000 1.47 +++ sys/arch/i386/conf/IOPENER 29 Jul 2004 22:15:17 -0000 @@ -153,6 +153,9 @@ #options WS_KERNEL_BG=WSCOL_BLACK #options WS_KERNEL_COLATTR="" #options WS_KERNEL_MONOATTR="" +# customization of console border color +options WSDISPLAY_CUSTOM_BORDER # border customization from wsconsctl(8) +#options WSDISPLAY_BORDER_COLOR=WSCOL_BLUE # default color # compatibility to other console drivers options WSDISPLAY_COMPAT_PCVT # emulate some ioctls options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls Index: sys/arch/i386/conf/LAMB =================================================================== RCS file: /cvsroot/src/sys/arch/i386/conf/LAMB,v retrieving revision 1.38 diff -u -r1.38 LAMB --- sys/arch/i386/conf/LAMB 28 Jul 2004 12:34:04 -0000 1.38 +++ sys/arch/i386/conf/LAMB 29 Jul 2004 22:15:23 -0000 @@ -174,6 +174,9 @@ #options WS_KERNEL_BG=WSCOL_BLACK #options WS_KERNEL_COLATTR="" #options WS_KERNEL_MONOATTR="" +# customization of console border color +options WSDISPLAY_CUSTOM_BORDER # border customization from wsconsctl(8) +#options WSDISPLAY_BORDER_COLOR=WSCOL_BLUE # default color # compatibility to other console drivers options WSDISPLAY_COMPAT_PCVT # emulate some ioctls options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls Index: sys/arch/i386/conf/SWINGER =================================================================== RCS file: /cvsroot/src/sys/arch/i386/conf/SWINGER,v retrieving revision 1.51 diff -u -r1.51 SWINGER --- sys/arch/i386/conf/SWINGER 28 Jul 2004 12:34:04 -0000 1.51 +++ sys/arch/i386/conf/SWINGER 29 Jul 2004 22:15:32 -0000 @@ -166,6 +166,9 @@ #options WS_KERNEL_BG=WSCOL_BLACK #options WS_KERNEL_COLATTR="" #options WS_KERNEL_MONOATTR="" +# customization of console border color +#options WSDISPLAY_CUSTOM_BORDER # border customization from wsconsctl(8) +#options WSDISPLAY_BORDER_COLOR=WSCOL_BLUE # compatibility to other console drivers options WSDISPLAY_COMPAT_PCVT # emulate some ioctls options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls Index: sys/arch/i386/conf/VIRTUALPC =================================================================== RCS file: /cvsroot/src/sys/arch/i386/conf/VIRTUALPC,v retrieving revision 1.8 diff -u -r1.8 VIRTUALPC --- sys/arch/i386/conf/VIRTUALPC 28 Jul 2004 12:34:04 -0000 1.8 +++ sys/arch/i386/conf/VIRTUALPC 29 Jul 2004 22:15:35 -0000 @@ -208,6 +208,9 @@ #options WS_KERNEL_BG=WSCOL_BLACK #options WS_KERNEL_COLATTR="" #options WS_KERNEL_MONOATTR="" +# customization of console border color +options WSDISPLAY_CUSTOM_BORDER # border customization from wsconsctl(8) +#options WSDISPLAY_BORDER_COLOR=WSCOL_BLUE # compatibility to other console drivers options WSDISPLAY_COMPAT_PCVT # emulate some ioctls options WSDISPLAY_COMPAT_SYSCONS # emulate some ioctls Index: sys/dev/ic/vga.c =================================================================== RCS file: /cvsroot/src/sys/dev/ic/vga.c,v retrieving revision 1.75 diff -u -r1.75 vga.c --- sys/dev/ic/vga.c 28 Jul 2004 12:34:04 -0000 1.75 +++ sys/dev/ic/vga.c 29 Jul 2004 22:15:39 -0000 @@ -29,6 +29,8 @@ /* for WSCONS_SUPPORT_PCVTFONTS and WSDISPLAY_CHARFUNCS */ #include "opt_wsdisplay_compat.h" +/* for WSDISPLAY_CUSTOM_BORDER */ +#include "opt_wsdisplay_border.h" /* for WSDISPLAY_CUSTOM_OUTPUT */ #include "opt_wsmsgattrs.h" @@ -272,6 +274,10 @@ static int vga_getwschar(void *, struct wsdisplay_char *); static int vga_putwschar(void *, struct wsdisplay_char *); #endif /* WSDISPLAY_CHARFUNCS */ +#ifdef WSDISPLAY_CUSTOM_BORDER +static u_int vga_getborder(void *); +static int vga_setborder(void *, u_int); +#endif /* WSDISPLAY_CUSTOM_BORDER */ void vga_doswitch(struct vga_config *); @@ -295,6 +301,13 @@ #else NULL, #endif +#ifdef WSDISPLAY_CUSTOM_BORDER + vga_getborder, + vga_setborder, +#else /* WSDISPLAY_CUSTOM_BORDER */ + NULL, + NULL, +#endif /* WSDISPLAY_CUSTOM_BORDER */ }; /* @@ -577,6 +590,11 @@ TAILQ_INSERT_HEAD(&vc->vc_fontlist, &vga_builtinfont, next); vc->currentfontset1 = vc->currentfontset2 = 0; + + /* This function does all the required sanity checks for us + * (mono video, valid color, etc.); we just don't care about + * possible errors during initialization. */ + (void)vga_setborder(vc->active, WSDISPLAY_BORDER_COLOR); } void @@ -1407,3 +1425,39 @@ return (pcdisplay_putwschar(&scr->pcs, wschar)); } #endif /* WSDISPLAY_CHARFUNCS */ + +#ifdef WSDISPLAY_CUSTOM_BORDER +static u_int +vga_getborder(void *cookie) +{ + struct vgascreen *scr = cookie; + struct vga_handle *vh; + u_int idx; + u_int8_t value; + + if (scr == NULL) return EINVAL; + vh = &scr->cfg->hdl; + if (vh->vh_mono) return ENODEV; + + value = _vga_attr_read(vh, VGA_ATC_OVERSCAN); + for (idx = 0; idx < sizeof(fgansitopc); idx++) + if (fgansitopc[idx] == value) + break; + return idx == sizeof(fgansitopc) ? 0 : idx; +} + +static int +vga_setborder(void *cookie, u_int value) +{ + struct vgascreen *scr = cookie; + struct vga_handle *vh; + + if (scr == NULL) return EINVAL; + vh = &scr->cfg->hdl; + if (vh->vh_mono) return ENODEV; + if (value >= sizeof(fgansitopc)) return EINVAL; + + _vga_attr_write(vh, VGA_ATC_OVERSCAN, fgansitopc[value]); + return (0); +} +#endif /* WSDISPLAY_CUSTOM_BORDER */ Index: sys/dev/ic/vga_subr.c =================================================================== RCS file: /cvsroot/src/sys/dev/ic/vga_subr.c,v retrieving revision 1.17 diff -u -r1.17 vga_subr.c --- sys/dev/ic/vga_subr.c 24 Mar 2004 17:26:53 -0000 1.17 +++ sys/dev/ic/vga_subr.c 29 Jul 2004 22:15:39 -0000 @@ -26,6 +26,9 @@ * */ +/* for WSDISPLAY_BORDER_COLOR */ +#include "opt_wsdisplay_border.h" + #include __KERNEL_RCSID(0, "$NetBSD: vga_subr.c,v 1.17 2004/03/24 17:26:53 drochner Exp $"); @@ -344,7 +347,7 @@ 0x3e, /* 0E: internal palette 14 */ 0x3f, /* 0F: internal palette 15 */ 0x0c, /* 10: attribute mode control */ - 0x00, /* 11: overscan color */ + WSDISPLAY_BORDER_COLOR, /* 11: overscan color */ 0x0f, /* 12: color plane enable */ 0x08, /* 13: horizontal PEL panning */ 0x00 /* 14: color select */ Index: sys/dev/ic/vgareg.h =================================================================== RCS file: /cvsroot/src/sys/dev/ic/vgareg.h,v retrieving revision 1.7 diff -u -r1.7 vgareg.h --- sys/dev/ic/vgareg.h 24 Mar 2004 17:26:53 -0000 1.7 +++ sys/dev/ic/vgareg.h 29 Jul 2004 22:15:39 -0000 @@ -35,6 +35,7 @@ #define VGA_ATC_INDEX 0x0 #define VGA_ATC_DATAW 0x0 #define VGA_ATC_DATAR 0x1 +#define VGA_ATC_OVERSCAN 0x11 struct reg_vgats { /* indexed via port 0x3c4 */ u_int8_t syncreset, mode, wrplmask, fontsel, memmode; Index: sys/dev/wscons/files.wscons =================================================================== RCS file: /cvsroot/src/sys/dev/wscons/files.wscons,v retrieving revision 1.32 diff -u -r1.32 files.wscons --- sys/dev/wscons/files.wscons 28 Jul 2004 15:12:07 -0000 1.32 +++ sys/dev/wscons/files.wscons 29 Jul 2004 22:15:40 -0000 @@ -14,6 +14,8 @@ defparam opt_wsemul.h WSEMUL_DEFAULT defflag opt_wsemul.h WSEMUL_NO_DUMB WSEMUL_SUN WSEMUL_VT100 +defflag opt_wsdisplay_border.h WSDISPLAY_CUSTOM_BORDER +defparam opt_wsdisplay_border.h WSDISPLAY_BORDER_COLOR defflag opt_wsmsgattrs.h WSDISPLAY_CUSTOM_OUTPUT defparam opt_wsmsgattrs.h WS_DEFAULT_COLATTR WS_DEFAULT_MONOATTR WS_DEFAULT_BG WS_DEFAULT_FG Index: sys/dev/wscons/wsconsio.h =================================================================== RCS file: /cvsroot/src/sys/dev/wscons/wsconsio.h,v retrieving revision 1.68 diff -u -r1.68 wsconsio.h --- sys/dev/wscons/wsconsio.h 28 Jul 2004 12:34:04 -0000 1.68 +++ sys/dev/wscons/wsconsio.h 29 Jul 2004 22:15:40 -0000 @@ -451,6 +451,9 @@ #define WSDISPLAYIO_GMSGATTRS _IOR('W', 89, struct wsdisplay_msgattrs) #define WSDISPLAYIO_SMSGATTRS _IOW('W', 90, struct wsdisplay_msgattrs) +#define WSDISPLAYIO_GBORDER _IOR('W', 91, int) +#define WSDISPLAYIO_SBORDER _IOW('W', 92, int) + /* XXX NOT YET DEFINED */ /* Mapping information retrieval. */ Index: sys/dev/wscons/wsdisplay.c =================================================================== RCS file: /cvsroot/src/sys/dev/wscons/wsdisplay.c,v retrieving revision 1.80 diff -u -r1.80 wsdisplay.c --- sys/dev/wscons/wsdisplay.c 28 Jul 2004 12:34:04 -0000 1.80 +++ sys/dev/wscons/wsdisplay.c 29 Jul 2004 22:15:44 -0000 @@ -33,6 +33,7 @@ #include __KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.80 2004/07/28 12:34:04 jmmv Exp $"); +#include "opt_wsdisplay_border.h" #include "opt_wsdisplay_compat.h" #include "opt_wsmsgattrs.h" #include "opt_compat_netbsd.h" @@ -1178,6 +1179,24 @@ return (ENODEV); #endif +#ifdef WSDISPLAY_CUSTOM_BORDER + case WSDISPLAYIO_GBORDER: + if (!sc->sc_accessops->getborder) + return (EINVAL); + *(u_int *)data = (*sc->sc_accessops->getborder) + (scr->scr_dconf->emulcookie); + return (0); + case WSDISPLAYIO_SBORDER: + if (!sc->sc_accessops->setborder) + return (EINVAL); + return (*sc->sc_accessops->setborder) + (scr->scr_dconf->emulcookie, (*(u_int *)data)); +#else /* WSDISPLAY_CUSTOM_BORDER */ + case WSDISPLAYIO_GBORDER: + case WSDISPLAYIO_SBORDER: + return (ENODEV); +#endif /* WSDISPLAY_CUSTOM_BORDER */ + } /* check ioctls for display */ Index: sys/dev/wscons/wsdisplayvar.h =================================================================== RCS file: /cvsroot/src/sys/dev/wscons/wsdisplayvar.h,v retrieving revision 1.28 diff -u -r1.28 wsdisplayvar.h --- sys/dev/wscons/wsdisplayvar.h 28 Jul 2004 12:34:04 -0000 1.28 +++ sys/dev/wscons/wsdisplayvar.h 29 Jul 2004 22:15:46 -0000 @@ -113,6 +113,8 @@ int (*getwschar)(void *, struct wsdisplay_char *); int (*putwschar)(void *, struct wsdisplay_char *); void (*scroll) __P((void *, void *, int)); + u_int (*getborder)(void *); + int (*setborder)(void *, u_int); }; /* @@ -220,6 +222,7 @@ #if defined(_KERNEL) # if defined(_KERNEL_OPT) # include "opt_wsmsgattrs.h" +# include "opt_wsdisplay_border.h" # endif # if !defined(WS_DEFAULT_FG) # define WS_DEFAULT_FG WSCOL_WHITE @@ -251,4 +254,7 @@ # if !defined(WS_KERNEL_MONOATTR) # define WS_KERNEL_MONOATTR WS_DEFAULT_MONOATTR # endif +# if !defined(WSDISPLAY_BORDER_COLOR) +# define WSDISPLAY_BORDER_COLOR WSCOL_BLACK +# endif #endif /* _KERNEL */ Index: sbin/wsconsctl/display.c =================================================================== RCS file: /cvsroot/src/sbin/wsconsctl/display.c,v retrieving revision 1.5 diff -u -r1.5 display.c --- sbin/wsconsctl/display.c 28 Jul 2004 12:34:05 -0000 1.5 +++ sbin/wsconsctl/display.c 29 Jul 2004 22:15:46 -0000 @@ -48,6 +48,7 @@ #include "wsconsctl.h" +static int border; static int dpytype; static struct wsdisplay_usefontdata font; static struct wsdisplay_scroll_data scroll_l; @@ -56,6 +57,7 @@ static int msg_kernel_attrs, msg_kernel_bg, msg_kernel_fg; struct field display_field_tab[] = { + { "border", &border, FMT_COLOR, FLG_MODIFY }, { "type", &dpytype, FMT_DPYTYPE, FLG_RDONLY }, { "font", &font.name, FMT_STRING, FLG_WRONLY }, { "scroll.fastlines", &scroll_l.fastlines, FMT_UINT, FLG_MODIFY }, @@ -92,6 +94,10 @@ if (ioctl(fd, WSDISPLAYIO_GTYPE, &dpytype) < 0) err(1, "WSDISPLAYIO_GTYPE"); + if (field_by_value(&border)->flags & FLG_GET) + if (ioctl(fd, WSDISPLAYIO_GBORDER, &border) < 0) + warn("WSDISPLAYIO_GBORDER"); + if (field_by_value(&msg_default_attrs)->flags & FLG_GET || field_by_value(&msg_default_bg)->flags & FLG_GET || field_by_value(&msg_default_fg)->flags & FLG_GET || @@ -148,6 +154,12 @@ pr_field(field_by_value(&font.name), " -> "); } + if (field_by_value(&border)->flags & FLG_SET) { + if (ioctl(fd, WSDISPLAYIO_SBORDER, &border) < 0) + err(1, "WSDISPLAYIO_SBORDER"); + pr_field(field_by_value(&border), " -> "); + } + if (field_by_value(&msg_default_attrs)->flags & FLG_SET || field_by_value(&msg_default_bg)->flags & FLG_SET || field_by_value(&msg_default_fg)->flags & FLG_SET || Index: share/man/man4/wsdisplay.4 =================================================================== RCS file: /cvsroot/src/share/man/man4/wsdisplay.4,v retrieving revision 1.23 diff -u -r1.23 wsdisplay.4 --- share/man/man4/wsdisplay.4 28 Jul 2004 12:34:05 -0000 1.23 +++ share/man/man4/wsdisplay.4 29 Jul 2004 22:15:51 -0000 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 28, 2004 +.Dd July 29, 2004 .Os .Dt WSDISPLAY 4 .Sh NAME @@ -437,6 +437,13 @@ separate fields for default output and kernel output. The argument structure is the same as for .Dv WSDISPLAYIO_GMSGATTRS . +.It Dv WSDISPLAYIO_GBORDER Pq Li u_int +Retrieve the color of the screen border. +This number corresponds to an ANSI standard color. +.It Dv WSDISPLAYIO_SBORDER Pq Li u_int +Set the color of the screen border, if applicable. +This number corresponds to an ANSI standard color. +Not all drivers support this feature. .El .Sh FILES .Bl -item Index: doc/CHANGES =================================================================== RCS file: /cvsroot/src/doc/CHANGES,v retrieving revision 1.350 diff -u -r1.350 CHANGES --- doc/CHANGES 28 Jul 2004 23:32:03 -0000 1.350 +++ doc/CHANGES 29 Jul 2004 22:15:56 -0000 @@ -89,3 +89,6 @@ wsconsctl(4): Add support to change console colors and kernel colors dynamically after boot [jmmv 20040728] postfix: Postfix 2.1.4 imported. [heas 20040728] + vga(4): Add support to change console border color [jmmv 20040729] + wscons(4): Add support to change console border color [jmmv 20040729] + wsconsctl(4): Add support to change console border color [jmmv 20040729]