diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 1999-10-16 18:56:38 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 1999-10-16 18:56:38 +0000 |
commit | c58f75931455fa39eee6866e375b5791c6478fea (patch) | |
tree | 4941afb4376222061c2a617df76e0949198bf70a /sys/arch/i386 | |
parent | dadb7bf9c6f6f6c27e774fd5edd5c5fd9c0b98b9 (diff) |
- Add support for a traditional PC display (16 colors and use the standard IBM
font) and make it the default mode. This is more or less a hack, since pcvt
was developed only to be a vt220 terminal emulator.
- Document new default mode in pcvt(4).
- Add -o option to scon(1) for toggling between the new and legacy modes.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/isa/pcvt/Util/pcvtdoc/pcvt.4 | 17 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/Util/scon/scon.1 | 12 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/Util/scon/scon.c | 21 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_hdr.h | 3 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_ioctl.h | 3 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_out.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_sup.c | 22 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_vtf.c | 38 |
8 files changed, 111 insertions, 13 deletions
diff --git a/sys/arch/i386/isa/pcvt/Util/pcvtdoc/pcvt.4 b/sys/arch/i386/isa/pcvt/Util/pcvtdoc/pcvt.4 index fb755c54279..165095c832e 100644 --- a/sys/arch/i386/isa/pcvt/Util/pcvtdoc/pcvt.4 +++ b/sys/arch/i386/isa/pcvt/Util/pcvtdoc/pcvt.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pcvt.4,v 1.17 1999/10/07 18:37:54 wvdputte Exp $ +.\" $OpenBSD: pcvt.4,v 1.18 1999/10/16 18:56:37 aaron Exp $ .\" .\" Copyright (c) 1992, 1995 Hellmuth Michaelis, Brian Dunford-Shore, .\" Joerg Wunsch and Holger Veit. @@ -83,8 +83,21 @@ functionality. See .Sx Features for a detailed description. +.Sy Note: +As of +.Ox 2.6 , +.Nm +does not do character mapping by default in favor of a traditional PC display +where 16 colors are available and the standard IBM font is used. +See the +.Fl o +flag in +.Xr scon 1 +to toggle between this mode and the old mode. + .Ss VT Keys -Despite the complexity of options, if installed in a normal OpenBSD +Despite the complexity of options, if installed in a normal +.Ox configuration with the default options, on a standard i386 architecture system, you can use multiple virtual terminals. The key sequence used to move among virtual terminals are, diff --git a/sys/arch/i386/isa/pcvt/Util/scon/scon.1 b/sys/arch/i386/isa/pcvt/Util/scon/scon.1 index 615b2fa98ca..37f9387ed11 100644 --- a/sys/arch/i386/isa/pcvt/Util/scon/scon.1 +++ b/sys/arch/i386/isa/pcvt/Util/scon/scon.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: scon.1,v 1.9 1999/09/29 22:29:10 aaron Exp $ +.\" $OpenBSD: scon.1,v 1.10 1999/10/16 18:56:37 aaron Exp $ .\" .\" Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch .\" @@ -49,6 +49,7 @@ .Op Fl H .Op Fl l .Op Fl m +.Op Fl o .Op Fl v .Op Fl V .Op Fl s Ar lines @@ -122,6 +123,15 @@ any HP escape sequences and without displaying function key labels. Switch the specified/current screen into a mixed HP/VT220 mode. That is, that in addition to the full VT220 emulation, the HP function key labels and the escape sequences for handling the labels are available to the user. +.It Fl o +Toggle +.Dq legacy +pcvt mode with traditional PC display mode. +As of +.Ox 2.6 , +character mapping is turned off by default in favour of a traditional PC +display with 16 colors and the standard IBM font. +This option has no effect in line modes other than 25. .It Fl s Specify the number of character lines on the screen. Possible parameters are 25, 28, 35, 40, 43 or 50. To use all this screen sizes, the fonts required diff --git a/sys/arch/i386/isa/pcvt/Util/scon/scon.c b/sys/arch/i386/isa/pcvt/Util/scon/scon.c index 2a0945df9d2..250439b2525 100644 --- a/sys/arch/i386/isa/pcvt/Util/scon/scon.c +++ b/sys/arch/i386/isa/pcvt/Util/scon/scon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scon.c,v 1.15 1999/10/07 18:26:21 wvdputte Exp $ */ +/* $OpenBSD: scon.c,v 1.16 1999/10/16 18:56:37 aaron Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch @@ -72,6 +72,7 @@ int bflag = -1; unsigned int scrollback_pages = 8; int lflag = -1; int mflag = -1; +int oflag = -1; int current = -1; int pflag = -1; int hflag = -1; @@ -208,7 +209,7 @@ char *argv[]; int c; int fd; - while( (c = getopt(argc, argv, "ab:c:d:f:HVlms:t:vp:18")) != -1) + while( (c = getopt(argc, argv, "ab:c:d:f:HVlmos:t:vp:18")) != -1) { switch(c) { @@ -270,6 +271,10 @@ char *argv[]; vflag++; break; + case 'o': + oflag = 1; + break; + case 'p': if(!strcmp(optarg, "list")) { @@ -343,7 +348,7 @@ char *argv[]; if(dflag == -1 && lflag == -1 && current == -1 && pflag == -1 && hflag == -1 && res == -1 && Pflag == 0 && tflag == 0 && fflag == -1 - && colms == 0 && mflag == -1 && bflag == -1) + && colms == 0 && mflag == -1 && bflag == -1 && oflag == -1) { lflag = 1; } @@ -389,6 +394,16 @@ char *argv[]; exit(0); } + if (oflag == 1) + { + if (ioctl(fd, TOGGLEPCDISP, &oflag) < 0) + { + perror("ioctl(TOGGLEPCDISP)"); + exit(2); + } + exit(0); + } + if(mflag == 1) /* return monitor type */ { printmonitor(fd); diff --git a/sys/arch/i386/isa/pcvt/pcvt_hdr.h b/sys/arch/i386/isa/pcvt/pcvt_hdr.h index 8cf173166ab..8973098a469 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_hdr.h +++ b/sys/arch/i386/isa/pcvt/pcvt_hdr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_hdr.h,v 1.25 1999/09/29 22:29:10 aaron Exp $ */ +/* $OpenBSD: pcvt_hdr.h,v 1.26 1999/10/16 18:56:35 aaron Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. @@ -617,6 +617,7 @@ EXTERN u_char *more_chars; /* response buffer via kbd */ EXTERN int char_count; /* response char count */ EXTERN u_char color; /* color or mono display */ +EXTERN u_char pcdisp; /* vt220 or traditional pc features */ EXTERN u_short kern_attr; /* kernel messages char attributes */ EXTERN u_short user_attr; /* character attributes */ diff --git a/sys/arch/i386/isa/pcvt/pcvt_ioctl.h b/sys/arch/i386/isa/pcvt/pcvt_ioctl.h index a702caf4320..68285ba0c3e 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_ioctl.h +++ b/sys/arch/i386/isa/pcvt/pcvt_ioctl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_ioctl.h,v 1.11 1999/09/29 22:29:09 aaron Exp $ */ +/* $OpenBSD: pcvt_ioctl.h,v 1.12 1999/10/16 18:56:36 aaron Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. @@ -479,6 +479,7 @@ struct pcvtinfo { /* compile time option values */ #define VGASETCOLMS _IOW('V', 115, int) /* set number of columns (80/132)*/ #define SETSCROLLSIZE _IOW('V', 116, u_short) /* scrollbuffer size */ +#define TOGGLEPCDISP _IOW('V', 117, int) /* toggle traditional pc mode */ /* * only useful if compiled with ``XSERVER'' defined, but always here: diff --git a/sys/arch/i386/isa/pcvt/pcvt_out.c b/sys/arch/i386/isa/pcvt/pcvt_out.c index acb7f3a3e68..3811612ca01 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_out.c +++ b/sys/arch/i386/isa/pcvt/pcvt_out.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_out.c,v 1.12 1999/09/29 22:29:10 aaron Exp $ */ +/* $OpenBSD: pcvt_out.c,v 1.13 1999/10/16 18:56:36 aaron Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. @@ -92,6 +92,11 @@ static __inline void write_char (svsp, attrib, ch) struct video_state *svsp; u_short attrib, ch; { + if (pcdisp) { + *video = attrib | ch; + return; + } + if ((ch >= 0x20) && (ch <= 0x7f)) /* use GL if ch >= 0x20 */ { if(!svsp->ss) /* single shift G2/G3 -> GL ? */ @@ -1017,6 +1022,7 @@ vt_coldinit(void) struct video_state *svsp; do_initialization = 0; /* reset init necessary flag */ + pcdisp = 1; /* turn on traditional pc colors/font */ /* get the equipment byte from the RTC chip */ diff --git a/sys/arch/i386/isa/pcvt/pcvt_sup.c b/sys/arch/i386/isa/pcvt/pcvt_sup.c index 001eb999ea2..7c1594d89b5 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_sup.c +++ b/sys/arch/i386/isa/pcvt/pcvt_sup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_sup.c,v 1.10 1999/09/29 22:29:10 aaron Exp $ */ +/* $OpenBSD: pcvt_sup.c,v 1.11 1999/10/16 18:56:36 aaron Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. @@ -235,6 +235,13 @@ vgaioctl(Dev_t dev, int cmd, caddr_t data, int flag) reallocate_scrollbuffer(vsp, scrollback_pages); break; + case TOGGLEPCDISP: + if (vsp->screen_rowsize == 25) { + pcdisp = !pcdisp; + set_2ndcharset(); + } + break; + case TIOCSWINSZ: /* do nothing here */ break; @@ -713,6 +720,8 @@ set_screen_size(struct video_state *svsp, int size) if(vgacs[i].screen_size == size) { set_charset(svsp, i); + pcdisp = 0; + set_2ndcharset(); clr_parms(svsp); /* escape parameter init */ svsp->state = STATE_INIT; /* initial state */ svsp->scrr_beg = 0; /* start of scrolling region */ @@ -1791,9 +1800,16 @@ set_2ndcharset(void) inb(GN_INPSTAT1M); /* select color plane enable reg, caution: set ATC access bit ! */ - outb(ATC_INDEX, (ATC_COLPLEN | ATC_ACCESS)); - outb(ATC_DATAW, 0x07); /* disable plane 3 */ + + if (!pcdisp) { + outb(ATC_DATAW, 0x07); /* disable plane 3 */ + sgr_tab_color[02] = (BG_BROWN | FG_LIGHTGREY); + } + else { + outb(ATC_DATAW, 0x0F); /* enable plane 3 */ + sgr_tab_color[02] = (BG_BLACK | FG_CYAN); + } } #if PCVT_SCREENSAVER diff --git a/sys/arch/i386/isa/pcvt/pcvt_vtf.c b/sys/arch/i386/isa/pcvt/pcvt_vtf.c index b47e9c97a20..37e24c64752 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_vtf.c +++ b/sys/arch/i386/isa/pcvt/pcvt_vtf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_vtf.c,v 1.6 1998/11/16 23:47:57 weingart Exp $ */ +/* $OpenBSD: pcvt_vtf.c,v 1.7 1999/10/16 18:56:36 aaron Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. @@ -149,10 +149,18 @@ vt_sgr(struct video_state *svsp) { case 0: /* reset to normal attributes */ svsp->vtsgr = VT_NORMAL; + if (pcdisp) + setcolor = 0; break; case 1: /* bold */ svsp->vtsgr |= VT_BOLD; + if (pcdisp) { + if ((setcolor >> 8) == 0) + setcolor = (FG_LIGHTGREY << 8); + setcolor |= (FG_INTENSE << 8); + colortouched = 1; + } break; case 4: /* underline */ @@ -161,14 +169,30 @@ vt_sgr(struct video_state *svsp) case 5: /* blinking */ svsp->vtsgr |= VT_BLINK; + if (pcdisp) { + setcolor |= (FG_BLINK << 8); + colortouched = 1; + } break; case 7: /* reverse */ svsp->vtsgr |= VT_INVERSE; + if (pcdisp) { + if ((setcolor >> 8) == 0) + setcolor = (FG_LIGHTGREY << 8); + setcolor = (((setcolor>>8) & 0x88) | + ((((setcolor>>8) >> 4) | + ((setcolor>>8) << 4)) & 0x77)) << 8; + colortouched = 1; + } break; case 22: /* not bold */ svsp->vtsgr &= ~VT_BOLD; + if (pcdisp) { + setcolor &= ~(FG_INTENSE << 8); + colortouched = 1; + } break; case 24: /* not underlined */ @@ -177,10 +201,20 @@ vt_sgr(struct video_state *svsp) case 25: /* not blinking */ svsp->vtsgr &= ~VT_BLINK; + if (pcdisp) { + setcolor &= ~(FG_BLINK << 8); + colortouched = 1; + } break; case 27: /* not reverse */ svsp->vtsgr &= ~VT_INVERSE; + if (pcdisp) { + setcolor = (((setcolor>>8) & 0x88) | + ((((setcolor>>8) >> 4) | + ((setcolor>>8) << 4)) & 0x77)) << 8; + colortouched = 1; + } break; case 30: /* foreground colors */ @@ -196,6 +230,8 @@ vt_sgr(struct video_state *svsp) colortouched = 1; setcolor &= ~(FG_MASK<<8); setcolor |= ((fgansitopc[(svsp->parms[i-1]-30) & 7]) << 8); + if (pcdisp && svsp->vtsgr & VT_BOLD) + setcolor |= (FG_INTENSE << 8); } break; |