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 $
32 * $DragonFly: src/usr.sbin/pcvt/ispcvt/Attic/ispcvt.c,v 1.3 2004/03/24 17:46:23 cpressey Exp $
36 "@(#)ispcvt.c, 3.20, Last Edit-Date: [Wed Apr 5 17:53:28 1995]";
38 /*---------------------------------------------------------------------------*
42 * -hm upgraded to report pcvt compile time configuration
43 * -hm PCVT_INHIBIT_NUMLOCK patch from Joerg
44 * -hm PCVT_META_ESC patch from Joerg
46 * -hm new ioctl VGAPCVTINFO
47 * -hm new CONF_ values for 3.10
48 * -hm new CONF_ values for 3.20
49 * -hm removed PCVT_FAKE_SYSCONS10
50 * -hm added PCVT_PORTIO_DELAY
51 * -hm removed PCVT_386BSD
52 * -hm add -d option to specify a device
53 * -hm PCVT_XSERVER -> XSERVER
55 *---------------------------------------------------------------------------*/
57 #include <machine/pcvt_ioctl.h>
65 static void usage(void);
66 static void next(void);
69 main(int argc, char **argv)
76 struct pcvtinfo pcvtinfo;
85 while( (c = getopt(argc, argv, "vcd:")) != -1)
111 if((fd = open(device, O_RDWR)) == -1)
114 warn("ERROR opening %s", device);
123 if(ioctl(fd, VGAPCVTID, &pcvtid) == -1)
126 warn("ioctl VGAPCVTID failed, error");
130 if(!strcmp(pcvtid.name, PCVTIDNAME))
132 if(pcvtid.rmajor == PCVTIDMAJOR)
134 if(pcvtid.rminor != PCVTIDMINOR)
137 warnx("minor revision: expected %d, got %d", PCVTIDMINOR, pcvtid.rminor);
138 exit(4); /* minor revision mismatch */
144 warnx("major revision: expected %d, got %d", PCVTIDMAJOR, pcvtid.rmajor);
145 exit(3); /* major revision mismatch */
151 warnx("name check: expected %s, got %s", PCVTIDNAME, pcvtid.name);
152 exit(2); /* name mismatch */
157 warnx("\nkernel and utils match, driver name [%s], release [%1.1d.%02.2d]\n",
158 pcvtid.name, pcvtid.rmajor, pcvtid.rminor);
164 if(ioctl(fd, VGAPCVTINFO, &pcvtinfo) == -1)
167 warn("ioctl VGAPCVTINFO failed, error");
173 switch(pcvtinfo.opsys)
184 case CONF_UNKNOWNOPSYS:
189 fprintf(stderr,"Operating System = %s\t", p);
190 fprintf(stderr,"OS Release Id = %u\n", pcvtinfo.opsysrel);
191 fprintf(stderr,"PCVT_NSCREENS = %u\t\t", pcvtinfo.nscreens);
192 fprintf(stderr,"PCVT_UPDATEFAST = %u\n", pcvtinfo.updatefast);
193 fprintf(stderr,"PCVT_UPDATESLOW = %u\t\t", pcvtinfo.updateslow);
194 fprintf(stderr,"PCVT_SYSBEEPF = %u\n", pcvtinfo.sysbeepf);
195 fprintf(stderr,"PCVT_PCBURST = %u\t\t", pcvtinfo.pcburst);
196 fprintf(stderr,"PCVT_KBD_FIFO_SZ = %u\n\n", pcvtinfo.kbd_fifo_sz);
198 /* config booleans */
200 fprintf(stderr,"PCVT_132GENERIC = %s",
201 (pcvtinfo.compile_opts & CONF_132GENERIC) ? "ON" : "OFF");
203 fprintf(stderr,"PCVT_24LINESDEF = %s",
204 (pcvtinfo.compile_opts & CONF_24LINESDEF) ? "ON" : "OFF");
206 fprintf(stderr,"PCVT_BACKUP_FONTS = %s",
207 (pcvtinfo.compile_opts & CONF_BACKUP_FONTS) ? "ON" : "OFF");
209 fprintf(stderr,"PCVT_CTRL_ALT_DEL = %s",
210 (pcvtinfo.compile_opts & CONF_CTRL_ALT_DEL) ? "ON" : "OFF");
212 fprintf(stderr,"PCVT_EMU_MOUSE = %s",
213 (pcvtinfo.compile_opts & CONF_EMU_MOUSE) ? "ON" : "OFF");
215 fprintf(stderr,"PCVT_INHIBIT_NUMLOCK = %s",
216 (pcvtinfo.compile_opts & CONF_INHIBIT_NUMLOCK) ? "ON" : "OFF");
218 fprintf(stderr,"PCVT_KEYBDID = %s",
219 (pcvtinfo.compile_opts & CONF_KEYBDID) ? "ON" : "OFF");
221 fprintf(stderr,"PCVT_KBD_FIFO = %s",
222 (pcvtinfo.compile_opts & CONF_KBD_FIFO) ? "ON" : "OFF");
224 fprintf(stderr,"PCVT_META_ESC = %s",
225 (pcvtinfo.compile_opts & CONF_META_ESC) ? "ON" : "OFF");
227 fprintf(stderr,"PCVT_NOFASTSCROLL = %s",
228 (pcvtinfo.compile_opts & CONF_NOFASTSCROLL) ? "ON" : "OFF");
230 fprintf(stderr,"PCVT_NO_LED_UPDATE = %s",
231 (pcvtinfo.compile_opts & CONF_NO_LED_UPDATE) ? "ON" : "OFF");
233 fprintf(stderr,"PCVT_NULLCHARS = %s",
234 (pcvtinfo.compile_opts & CONF_NULLCHARS) ? "ON" : "OFF");
236 fprintf(stderr,"PCVT_PALFLICKER = %s",
237 (pcvtinfo.compile_opts & CONF_PALFLICKER) ? "ON" : "OFF");
239 fprintf(stderr,"PCVT_PORTIO_DELAY = %s",
240 (pcvtinfo.compile_opts & CONF_PORTIO_DELAY) ? "ON" : "OFF");
242 fprintf(stderr,"PCVT_PRETTYSCRNS = %s",
243 (pcvtinfo.compile_opts & CONF_PRETTYSCRNS) ? "ON" : "OFF");
245 fprintf(stderr,"PCVT_SCREENSAVER = %s",
246 (pcvtinfo.compile_opts & CONF_SCREENSAVER) ? "ON" : "OFF");
248 fprintf(stderr,"PCVT_SETCOLOR = %s",
249 (pcvtinfo.compile_opts & CONF_SETCOLOR) ? "ON" : "OFF");
251 fprintf(stderr,"PCVT_SHOWKEYS = %s",
252 (pcvtinfo.compile_opts & CONF_SHOWKEYS) ? "ON" : "OFF");
254 fprintf(stderr,"PCVT_SIGWINCH = %s",
255 (pcvtinfo.compile_opts & CONF_SIGWINCH) ? "ON" : "OFF");
257 fprintf(stderr,"PCVT_SLOW_INTERRUPT = %s",
258 (pcvtinfo.compile_opts & CONF_SLOW_INTERRUPT) ? "ON" : "OFF");
260 fprintf(stderr,"PCVT_SW0CNOUTP = %s",
261 (pcvtinfo.compile_opts & CONF_SW0CNOUTP) ? "ON" : "OFF");
263 fprintf(stderr,"PCVT_USEKBDSEC = %s",
264 (pcvtinfo.compile_opts & CONF_USEKBDSEC) ? "ON" : "OFF");
266 fprintf(stderr,"PCVT_USL_VT_COMPAT = %s",
267 (pcvtinfo.compile_opts & CONF_USL_VT_COMPAT) ? "ON" : "OFF");
269 fprintf(stderr,"PCVT_VT220KEYB = %s",
270 ((u_int)pcvtinfo.compile_opts & (u_int)CONF_VT220KEYB) ? "ON" : "OFF");
272 fprintf(stderr,"PCVT_WAITRETRACE = %s",
273 (pcvtinfo.compile_opts & CONF_WAITRETRACE) ? "ON" : "OFF");
275 fprintf(stderr,"XSERVER = %s",
276 (pcvtinfo.compile_opts & CONF_XSERVER) ? "ON" : "OFF");
278 fprintf(stderr,"\n\n");
282 fprintf(stderr,"BSD Version = %u\n", pcvtinfo.opsys);
283 fprintf(stderr,"PCVT_NSCREENS = %u\n", pcvtinfo.nscreens);
284 fprintf(stderr,"PCVT_UPDATEFAST = %u\n", pcvtinfo.updatefast);
285 fprintf(stderr,"PCVT_UPDATESLOW = %u\n", pcvtinfo.updateslow);
286 fprintf(stderr,"PCVT_SYSBEEPF = %u\n", pcvtinfo.sysbeepf);
287 fprintf(stderr,"Compile options = 0x%08X\n", pcvtinfo.compile_opts);
294 fprintf(stderr,"\nispcvt - verify current video driver is the pcvt-driver\n");
295 fprintf(stderr," usage: ispcvt [-v] [-c] [-d device]\n");
296 fprintf(stderr,"options: -v be verbose\n");
297 fprintf(stderr," -c print compile time configuration\n");
298 fprintf(stderr," -d <name> use devicefile <name> for verification\n\n");
307 fprintf(stderr, "%s", (i == 0) ? "\t\t" : "\n");