📄 pcvt_hdr.h
字号:
/* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. * * Copyright (c) 1992, 1993 Brian Dunford-Shore. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by * Hellmuth Michaelis, Brian Dunford-Shore and Joerg Wunsch. * 4. The name authors may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * * @(#)pcvt_hdr.h, 3.20, Last Edit-Date: [Fri Apr 7 10:16:58 1995] * *//*--------------------------------------------------------------------------- * * pcvt_hdr.h VT220 Driver Global Include File * ------------------------------------------------ * -hm ------------ Release 3.00 -------------- * -hm integrating NetBSD-current patches * -hm integrating patches from Thomas Gellekum * -hm moving vt_selattr() inline into this file * -hm Michael's keyboard fifo diffs * -hm documenting some #ifdef's ... * -hm Joerg's patches for FreeBSD's ttymalloc * -jw introduced kbd_emulate_pc() if scanset > 1 * -hm moved user configurable items to pcvt_conf.h * -hm applying Joerg's patches for FreeBSD 2.0 * -hm patch from Onno & Martin for NetBSD-current (post 1.0) * -hm some adjustments for NetBSD 1.0 * -hm patch from Joerg fixing FreeBSD 2.0 support * -hm patch from Onno/John for NetBSD-current * -hm applying patch from Joerg fixing Crtat bug * -hm removed PCVT_FAKE_SYSCONS10 * -hm added pcstop (patch from Onno) * -hm multiple X server bugfixes from Lon Willett * -hm patch from Joerg for FreeBSD pre-2.1 * -jw adding more support for FreeBSD pre-2.1 * *---------------------------------------------------------------------------*/#define PCVT_REL "3.20-b24" /* driver attach announcement */ /* see also: pcvt_ioctl.h */#include "opt_pcvt.h"#if defined(__FreeBSD__) && !defined(PCVT_FREEBSD)# define PCVT_FREEBSD 210#endif#if PCVT_FREEBSD >= 200#include <sys/param.h>#include <sys/conf.h>#include <sys/proc.h>#include <sys/signalvar.h>#include <sys/tty.h>#include <sys/uio.h>#include <sys/callout.h>#include <sys/systm.h>#include <sys/kernel.h>#include <sys/syslog.h>#include <sys/malloc.h>#include <sys/time.h>#if PCVT_FREEBSD > 210#include <machine/random.h>#endif /* PCVT_FREEBSD > 210 */#else /* ! PCVT_FREEBSD >= 200 */#include "param.h"#include "conf.h"#include "ioctl.h"#include "proc.h"#include "signalvar.h"#include "tty.h"#include "uio.h"#include "callout.h"#include "systm.h"#include "kernel.h"#include "syslog.h"#include "malloc.h"#include "time.h"#endif /* PCVT_FREEBSD >= 200 */#include <i386/isa/pcvt/pcvt_conf.h>#include <i386/isa/kbdio.h>#if PCVT_NETBSD > 9#include "device.h"#endif#if PCVT_NETBSD > 9#include "i386/isa/isavar.h"#include "i386/cpufunc.h"#elif PCVT_FREEBSD >= 200#include <i386/isa/isa_device.h>#else#include "i386/isa/isa_device.h"#endif#if PCVT_FREEBSD >= 200#include <i386/isa/icu.h>#else#include "i386/isa/icu.h"#endif#if PCVT_NETBSD > 100#include "i386/isa/isareg.h"#elif PCVT_FREEBSD >= 200#include <i386/isa/isa.h>#else#include "i386/isa/isa.h"#endif#if PCVT_NETBSD > 9#include "dev/cons.h"#elif PCVT_FREEBSD >= 200#include <machine/cons.h>#else#include "i386/i386/cons.h"#endif#if PCVT_NETBSD <= 9#if PCVT_FREEBSD >= 200#include <machine/psl.h>#include <machine/frame.h>#else /* ! PCVT_FREEBSD >= 200 */#include "machine/psl.h"#include "machine/frame.h"#endif /* PCVT_FREEBSD >= 200 */#endif /* PCVT_NETBSD <= 9 */#if PCVT_NETBSD > 9#include <i386/isa/pcvt/pcvt_ioctl.h>#elif PCVT_FREEBSD >= 200#include <machine/pcvt_ioctl.h>#else#include "machine/pcvt_ioctl.h"#endif#if PCVT_FREEBSD >= 200#include <machine/pc/display.h>#if PCVT_FREEBSD > 200#include <machine/clock.h>#include <machine/md_var.h>#endif#else /* PCVT_FREEBSD >= 200 */#include "machine/pc/display.h"#endif /* PCVT_FREEBSD >= 200 *//* setup irq disable function to use */#if !(PCVT_SLOW_INTERRUPT) && (PCVT_NETBSD > 9)# define PCVT_DISABLE_INTR() disable_intr()# define PCVT_ENABLE_INTR() enable_intr()# undef PCVT_SLOW_INTERRUPT#else# define PCVT_DISABLE_INTR() s = spltty()# define PCVT_ENABLE_INTR() splx(s)# undef PCVT_SLOW_INTERRUPT# define PCVT_SLOW_INTERRUPT 1#endif/* perform option consistency checks */#if defined PCVT_FREEBSD && PCVT_FREEBSD == 1# undef PCVT_FREEBSD# define PCVT_FREEBSD 102 /* assume 1.0 release */#endif#if defined PCVT_NETBSD && PCVT_NETBSD == 1#undef PCVT_NETBSD#define PCVT_NETBSD 9 /* assume 0.9 release for now */#endif#if PCVT_FREEBSD + PCVT_NETBSD == 0# error "pcvt_hdr.h: You MUST define one of PCVT_{NET,FREE}BSD \in the config file"#elif (PCVT_FREEBSD && PCVT_NETBSD)# error "pcvt_hdr.h: You CAN only define *one* of PCVT_{NET,FREE}BSD \in the config file"#endif#ifdef XSERVER/* PCVT_NULLCHARS is mandatory for X server */#if !PCVT_NULLCHARS#undef PCVT_NULLCHARS#define PCVT_NULLCHARS 1#endif/* PCVT_BACKUP_FONTS is mandatory for PCVT_USL_VT_COMPAT */#if PCVT_USL_VT_COMPAT && !PCVT_BACKUP_FONTS#undef PCVT_BACKUP_FONTS#define PCVT_BACKUP_FONTS 1#endif#else /* XSERVER */#if PCVT_USL_VT_COMPAT#warning "Option PCVT_USL_VT_COMPAT meaningless without XSERVER"#undef PCVT_USL_VT_COMPAT#define PCVT_USL_VT_COMPAT 0#endif#endif /* XSERVER *//* PCVT_SCREENSAVER is mandatory for PCVT_PRETTYSCRNS */#if PCVT_PRETTYSCRNS && !PCVT_SCREENSAVER#undef PCVT_SCREENSAVER#define PCVT_SCREENSAVER 1#endif/* get the inline inb/outb back again ... */#if PCVT_NETBSD#if PCVT_NETBSD == 9#include "machine/cpufunc.h" /* NetBSD 0.9 [...and earlier -currents] */#undef PCVT_USL_VT_COMPAT#define PCVT_USL_VT_COMPAT 0 /* does not work, workaround ... */#else#include "machine/pio.h" /* recent NetBSD -currents */#define NEW_AVERUNNABLE /* averunnable changes for younger currents */#endif /* PCVT_NETBSD == 9 */#endif /* PCVT_NETBSD */#if PCVT_FREEBSD >= 200#define NEW_AVERUNNABLE /* new averunnable changes for FreeBSD 2.0 */#endif#if PCVT_SCANSET !=1 && PCVT_SCANSET !=2#error "Supported keyboard scancode sets are 1 and 2 only (for now)!!!"#endif/*---------------------------------------------------------------------------* * Keyboard and Keyboard Controller *---------------------------------------------------------------------------*/#ifndef _I386_ISA_KBDIO_H_#define CONTROLLER_CTRL 0x64 /* W - command, R - status */#define CONTROLLER_DATA 0x60 /* R/W - data *//* commands to control the CONTROLLER (8042) on the mainboard */#define CONTR_READ 0x20 /* read command byte from controller */#define CONTR_WRITE 0x60 /* write command to controller, see below */#define CONTR_SELFTEST 0xaa /* controller selftest, returns 0x55 when ok */#define CONTR_IFTEST 0xab /* interface selftest */#define CONTR_KBDISABL 0xad /* disable keyboard */#define CONTR_KBENABL 0xae /* enable keyboard *//* command byte for writing to CONTROLLER (8042) via CONTR_WRITE */#define COMMAND_RES7 0x80 /* bit 7, reserved, always write a ZERO ! */#define COMMAND_PCSCAN 0x40 /* bit 6, 1 = convert to pc scan codes */#define COMMAND_RES5 0x20 /* bit 5, perhaps (!) use 9bit frame * instead of 11 */#define COMMAND_DISABL 0x10 /* bit 4, 1 = disable keyboard */#define COMMAND_INHOVR 0x08 /* bit 3, 1 = override security lock inhibit */#define COMMAND_SYSFLG 0x04 /* bit 2, value stored as "system flag" */#define COMMAND_RES2 0x02 /* bit 1, reserved, always write a ZERO ! */#define COMMAND_IRQEN 0x01 /* bit 0, 1 = enable output buffer full * interrupt *//* status from CONTROLLER (8042) on the mainboard */#define STATUS_PARITY 0x80 /* bit 7, 1 = parity error on last byte */#define STATUS_RXTIMO 0x40 /* bit 6, 1 = receive timeout error occured */#define STATUS_TXTIMO 0x20 /* bit 5, 1 = transmit timeout error occured */#define STATUS_ENABLE 0x10 /* bit 4, 1 = keyboard unlocked */#define STATUS_WHAT 0x08 /* bit 3, 1 = wrote cmd to 0x64, 0 = wrote * data to 0x60 */#define STATUS_SYSFLG 0x04 /* bit 2, value stored as "system flag" */#define STATUS_INPBF 0x02 /* bit 1, 1 = input buffer full (to 8042) */#define STATUS_OUTPBF 0x01 /* bit 0, 1 = output buffer full (from 8042) *//* commands to the KEYBOARD (via the 8042 controller on mainboard..) */#define KEYB_C_RESET 0xff /* reset keyboard to power-on status */#define KEYB_C_RESEND 0xfe /* resend last byte in case of error */#define KEYB_C_TYPEM 0xf3 /* set keyboard typematic rate/delay */#define KEYB_C_ID 0xf2 /* return keyboard id */#define KEYB_C_ECHO 0xee /* diagnostic, echo 0xee */#define KEYB_C_LEDS 0xed /* set/reset numlock,capslock & scroll lock */#endif /* _I386_ISA_KBDIO_H_ *//* responses from the KEYBOARD (via the 8042 controller on mainboard..) */#define KEYB_R_OVERRUN0 0x00 /* keyboard buffer overflow */#define KEYB_R_SELFOK 0xaa /* keyboard selftest ok after KEYB_C_RESET */#define KEYB_R_EXT0 0xe0 /* keyboard extended scancode prefix 1 */#define KEYB_R_EXT1 0xe1 /* keyboard extended scancode prefix 2 */#define KEYB_R_ECHO 0xee /* keyboard response to KEYB_C_ECHO */#define KEYB_R_BREAKPFX 0xf0 /* break code prefix for set 2 and 3 */#define KEYB_R_ACK 0xfa /* acknowledge after a command has rx'd */#define KEYB_R_SELFBAD 0xfc /*keyboard selftest FAILED after KEYB_C_RESET*/#define KEYB_R_DIAGBAD 0xfd /* keyboard self diagnostic failure */#define KEYB_R_RESEND 0xfe /* keyboard wants command resent or illegal * command rx'd */#define KEYB_R_OVERRUN1 0xff /* keyboard buffer overflow */#define KEYB_R_MF2ID1 0xab /* MF II Keyboard id-byte #1 */#define KEYB_R_MF2ID2 0x41 /* MF II Keyboard id-byte #2 */#define KEYB_R_MF2ID2HP 0x83 /* MF II Keyboard id-byte #2 from HP keybd's *//* internal Keyboard Type */#define KB_UNKNOWN 0 /* unknown keyboard type */#define KB_AT 1 /* AT (84 keys) Keyboard */#define KB_MFII 2 /* MF II (101/102 keys) Keyboard *//*---------------------------------------------------------------------------* * CMOS ram access to get the "Equipment Byte" *---------------------------------------------------------------------------*/#define RTC_EQUIPMENT 0x14 /* equipment byte in cmos ram */#define EQ_EGAVGA 0 /* reserved (= ega/vga) */#define EQ_40COLOR 1 /* display = 40 col color */#define EQ_80COLOR 2 /* display = 80 col color */#define EQ_80MONO 3 /* display = 80 col mono *//*---------------------------------------------------------------------------* * VT220 -> internal color conversion table fields *---------------------------------------------------------------------------*/#define VT_NORMAL 0x00 /* no attributes at all */#define VT_BOLD 0x01 /* bold attribute */#define VT_UNDER 0x02 /* underline attribute */#define VT_BLINK 0x04 /* blink attribute */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -