2 * Copyright (c) 1992, 1995 Hellmuth Michaelis
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed by Hellmuth Michaelis
17 * 4. The name authors may not be used to endorse or promote products
18 * derived from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * $FreeBSD: src/usr.sbin/pcvt/ispcvt/ispcvt.c,v 1.7.6.1 2001/05/12 10:11:41 kris Exp $
35 "@(#)ispcvt.c, 3.20, Last Edit-Date: [Wed Apr 5 17:53:28 1995]";
37 /*---------------------------------------------------------------------------*
41 * -hm upgraded to report pcvt compile time configuration
42 * -hm PCVT_INHIBIT_NUMLOCK patch from Joerg
43 * -hm PCVT_META_ESC patch from Joerg
45 * -hm new ioctl VGAPCVTINFO
46 * -hm new CONF_ values for 3.10
47 * -hm new CONF_ values for 3.20
48 * -hm removed PCVT_FAKE_SYSCONS10
49 * -hm added PCVT_PORTIO_DELAY
50 * -hm removed PCVT_386BSD
51 * -hm add -d option to specify a device
52 * -hm PCVT_XSERVER -> XSERVER
54 *---------------------------------------------------------------------------*/
59 #include <machine/pcvt_ioctl.h>
72 struct pcvtinfo pcvtinfo;
81 while( (c = getopt(argc, argv, "vcd:")) != -1)
107 if((fd = open(device, O_RDWR)) == -1)
110 warn("ERROR opening %s", device);
119 if(ioctl(fd, VGAPCVTID, &pcvtid) == -1)
122 warn("ioctl VGAPCVTID failed, error");
126 if(!strcmp(pcvtid.name, PCVTIDNAME))
128 if(pcvtid.rmajor == PCVTIDMAJOR)
130 if(pcvtid.rminor != PCVTIDMINOR)
133 warnx("minor revision: expected %d, got %d", PCVTIDMINOR, pcvtid.rminor);
134 exit(4); /* minor revision mismatch */
140 warnx("major revision: expected %d, got %d", PCVTIDMAJOR, pcvtid.rmajor);
141 exit(3); /* major revision mismatch */
147 warnx("name check: expected %s, got %s", PCVTIDNAME, pcvtid.name);
148 exit(2); /* name mismatch */
153 warnx("\nkernel and utils match, driver name [%s], release [%1.1d.%02.2d]\n",
154 pcvtid.name, pcvtid.rmajor, pcvtid.rminor);
160 if(ioctl(fd, VGAPCVTINFO, &pcvtinfo) == -1)
163 warn("ioctl VGAPCVTINFO failed, error");
169 switch(pcvtinfo.opsys)
180 case CONF_UNKNOWNOPSYS:
185 fprintf(stderr,"Operating System = %s\t", p);
186 fprintf(stderr,"OS Release Id = %u\n", pcvtinfo.opsysrel);
187 fprintf(stderr,"PCVT_NSCREENS = %u\t\t", pcvtinfo.nscreens);
188 fprintf(stderr,"PCVT_UPDATEFAST = %u\n", pcvtinfo.updatefast);
189 fprintf(stderr,"PCVT_UPDATESLOW = %u\t\t", pcvtinfo.updateslow);
190 fprintf(stderr,"PCVT_SYSBEEPF = %u\n", pcvtinfo.sysbeepf);
191 fprintf(stderr,"PCVT_PCBURST = %u\t\t", pcvtinfo.pcburst);
192 fprintf(stderr,"PCVT_KBD_FIFO_SZ = %u\n\n", pcvtinfo.kbd_fifo_sz);
194 /* config booleans */
196 fprintf(stderr,"PCVT_132GENERIC = %s",
197 (pcvtinfo.compile_opts & CONF_132GENERIC) ? "ON" : "OFF");
199 fprintf(stderr,"PCVT_24LINESDEF = %s",
200 (pcvtinfo.compile_opts & CONF_24LINESDEF) ? "ON" : "OFF");
202 fprintf(stderr,"PCVT_BACKUP_FONTS = %s",
203 (pcvtinfo.compile_opts & CONF_BACKUP_FONTS) ? "ON" : "OFF");
205 fprintf(stderr,"PCVT_CTRL_ALT_DEL = %s",
206 (pcvtinfo.compile_opts & CONF_CTRL_ALT_DEL) ? "ON" : "OFF");
208 fprintf(stderr,"PCVT_EMU_MOUSE = %s",
209 (pcvtinfo.compile_opts & CONF_EMU_MOUSE) ? "ON" : "OFF");
211 fprintf(stderr,"PCVT_INHIBIT_NUMLOCK = %s",
212 (pcvtinfo.compile_opts & CONF_INHIBIT_NUMLOCK) ? "ON" : "OFF");
214 fprintf(stderr,"PCVT_KEYBDID = %s",
215 (pcvtinfo.compile_opts & CONF_KEYBDID) ? "ON" : "OFF");
217 fprintf(stderr,"PCVT_KBD_FIFO = %s",
218 (pcvtinfo.compile_opts & CONF_KBD_FIFO) ? "ON" : "OFF");
220 fprintf(stderr,"PCVT_META_ESC = %s",
221 (pcvtinfo.compile_opts & CONF_META_ESC) ? "ON" : "OFF");
223 fprintf(stderr,"PCVT_NOFASTSCROLL = %s",
224 (pcvtinfo.compile_opts & CONF_NOFASTSCROLL) ? "ON" : "OFF");
226 fprintf(stderr,"PCVT_NO_LED_UPDATE = %s",
227 (pcvtinfo.compile_opts & CONF_NO_LED_UPDATE) ? "ON" : "OFF");
229 fprintf(stderr,"PCVT_NULLCHARS = %s",
230 (pcvtinfo.compile_opts & CONF_NULLCHARS) ? "ON" : "OFF");
232 fprintf(stderr,"PCVT_PALFLICKER = %s",
233 (pcvtinfo.compile_opts & CONF_PALFLICKER) ? "ON" : "OFF");
235 fprintf(stderr,"PCVT_PORTIO_DELAY = %s",
236 (pcvtinfo.compile_opts & CONF_PORTIO_DELAY) ? "ON" : "OFF");
238 fprintf(stderr,"PCVT_PRETTYSCRNS = %s",
239 (pcvtinfo.compile_opts & CONF_PRETTYSCRNS) ? "ON" : "OFF");
241 fprintf(stderr,"PCVT_SCREENSAVER = %s",
242 (pcvtinfo.compile_opts & CONF_SCREENSAVER) ? "ON" : "OFF");
244 fprintf(stderr,"PCVT_SETCOLOR = %s",
245 (pcvtinfo.compile_opts & CONF_SETCOLOR) ? "ON" : "OFF");
247 fprintf(stderr,"PCVT_SHOWKEYS = %s",
248 (pcvtinfo.compile_opts & CONF_SHOWKEYS) ? "ON" : "OFF");
250 fprintf(stderr,"PCVT_SIGWINCH = %s",
251 (pcvtinfo.compile_opts & CONF_SIGWINCH) ? "ON" : "OFF");
253 fprintf(stderr,"PCVT_SLOW_INTERRUPT = %s",
254 (pcvtinfo.compile_opts & CONF_SLOW_INTERRUPT) ? "ON" : "OFF");
256 fprintf(stderr,"PCVT_SW0CNOUTP = %s",
257 (pcvtinfo.compile_opts & CONF_SW0CNOUTP) ? "ON" : "OFF");
259 fprintf(stderr,"PCVT_USEKBDSEC = %s",
260 (pcvtinfo.compile_opts & CONF_USEKBDSEC) ? "ON" : "OFF");
262 fprintf(stderr,"PCVT_USL_VT_COMPAT = %s",
263 (pcvtinfo.compile_opts & CONF_USL_VT_COMPAT) ? "ON" : "OFF");
265 fprintf(stderr,"PCVT_VT220KEYB = %s",
266 ((u_int)pcvtinfo.compile_opts & (u_int)CONF_VT220KEYB) ? "ON" : "OFF");
268 fprintf(stderr,"PCVT_WAITRETRACE = %s",
269 (pcvtinfo.compile_opts & CONF_WAITRETRACE) ? "ON" : "OFF");
271 fprintf(stderr,"XSERVER = %s",
272 (pcvtinfo.compile_opts & CONF_XSERVER) ? "ON" : "OFF");
274 fprintf(stderr,"\n\n");
278 fprintf(stderr,"BSD Version = %u\n", pcvtinfo.opsys);
279 fprintf(stderr,"PCVT_NSCREENS = %u\n", pcvtinfo.nscreens);
280 fprintf(stderr,"PCVT_UPDATEFAST = %u\n", pcvtinfo.updatefast);
281 fprintf(stderr,"PCVT_UPDATESLOW = %u\n", pcvtinfo.updateslow);
282 fprintf(stderr,"PCVT_SYSBEEPF = %u\n", pcvtinfo.sysbeepf);
283 fprintf(stderr,"Compile options = 0x%08X\n", pcvtinfo.compile_opts);
289 fprintf(stderr,"\nispcvt - verify current video driver is the pcvt-driver\n");
290 fprintf(stderr," usage: ispcvt [-v] [-c] [-d device]\n");
291 fprintf(stderr,"options: -v be verbose\n");
292 fprintf(stderr," -c print compile time configuration\n");
293 fprintf(stderr," -d <name> use devicefile <name> for verification\n\n");
301 fprintf(stderr, "%s", (i == 0) ? "\t\t" : "\n");