home *** CD-ROM | disk | FTP | other *** search
- /*
- * ibmpc.h: machine dependent parameters for IBM-PC/AX/J3100
- *
- * Author: HIRANO Satoshi
- * (C) 1989 Halca Computer Science Laboratory TM
- * University of Tokyo
- *
- * Edition history:
- * 1.1 90/02/03 Halca.Hirano separate from config.h
- *
- * $Header: ibmpc.hv 1.2 90/06/23 16:18:36 hirano Exp $
- */
-
- /*
- * system calls
- */
- #define VIDEOBIOS 0x10 /* VIDEO BIOS interrupt vector */
- #define KEY_BIOS 0x16 /* keyboard BIOS interrupt vector */
- #define PRINTER_BIOS 0x17 /* printer BIOS interrupt vector */
-
- #ifdef J3100
- #define SYSTEMSUB 0x60 /* system subroutine entry of BIOS */
- #endif /* J3100 */
-
- /*
- * NS16450 (INS8250A) serial port device register assignments
- */
- #define THR 0x0 /* transmitter holding register */
- #define RS_DATA THR /* transmit data register */
- #define DIVL 0x0 /* divisor latch LSB */
- #define DIVH 0x1 /* divisor latch MSB */
- #define IER 0x1 /* interrupt enable register */
- #define IIR 0x2 /* interrupt identification register */
- #define LCR 0x3 /* line control register */
- #define MCR 0x4 /* modem control register */
- #define LSR 0x5 /* line status register */
- #define RS_STATUS LSR /* status register */
- #define MSR 0x6 /* modem status register */
-
- /*
- * LCR bits
- */
- #define LCR_DLAB 0x80 /* divisor latch access */
- #define LCR_SBRK 0x40 /* 1=send break */
- #define LCR_STCP 0x20 /* stack parity bit */
- #define LCR_EPS 0x10 /* 0=even parity, 1=odd parity */
- #define LCR_PEN 0x8 /* 0=no parity, 1=parity */
- #define LCR_STB 0x4 /* 0=1 stop bit, 1=2 stop bit */
- #define LCR_WLS_FLAG 0x3 /* 00=5 bit, 01=6, 10=7, 11=8 */
- #define LCR_5BITS 0
- #define LCR_6BITS 1
- #define LCR_7BITS 2
- #define LCR_8BITS 3
- #define TX_READY 0x20 /* transmitter buffer empty */
-
- /*
- * hardware address, vectors, masks
- */
- #define IMR 0x21 /* interrupt mask register (not offset!) */
- #define ADDR_PORT_COM1 0x3F8 /* serial port com1: address */
- #define ADDR_PORT_COM2 0x2f8 /* serial port com2: address */
- #define ADDR_PORT_COM3 0xff /* ??? serial port com1: address */
- #define ADDR_PORT_COM4 0xff /* ??? serial port com2: address */
- #define PORT_VECTOR_COM1 0xc /* serial port com1: vector */
- #define PORT_VECTOR_COM2 0xb /* serial port com2: vector */
- #define PORT_VECTOR_COM3 0xff /* ??? serial port com3: vector */
- #define PORT_VECTOR_COM4 0xff /* ??? serial port com4: vector */
- /*
- * interrupt mask register on master IMR
- * 1= mask, 0=non mask
- * bit 3 = serial port 2
- * bit 4 = serial port 1
- * if com1, 00010000 else if com2, 00001000
- */
- #define INT_MASK_COM1 0x10 /* enable com1 receive interrupt */
- #define INT_MASK_COM2 0x08 /* enable com2 receive interrupt */
- #define INT_MASK_COM3 0x0 /* ??? enable com3 receive interrupt */
- #define INT_MASK_COM4 0x0 /* ??? enable com4 receive interrupt */
- #define PORT_BASE 1 /* portNo 0 is com1: */
-
- /*
- * video card info
- */
- #ifdef IBMPC
- #define VRAM_EGA 0xb800 /* EGA VRAM segment */
- #define VRAM_VGA 0xb800 /* VGA VRAM segment */
- #define VRAM_CGA 0xb800 /* CGA VRAM segment */
- #define VRAM_MDA 0xb000 /* MDA VRAM segment */
- #define VRAM_MCGA 0xb800 /* MCGA VRAM segment */
- #define GVRAMSEG 0xa000 /* EGA graphic VRAM segment */
- #define DEFAULT_VRAM_CARD VRAM_EGA /* use default if no ENV set */
- #define DEFAULT_CARD_MSG "EGA" /* used for warning message */
- #define PAGE1 0x1000 /* page 1 address (size of page0) */
- #define MAX_X_DOT 640 /* graphic mode x dots */
- #define MAX_Y_DOT 350 /* graphic mode y dots */
- #endif /* IBMPC */
-
- #ifdef J3100
- #define VRAM_MONO 0xb800 /* monochrome VRAM segment */
- #define VRAM_COLOR 0xa000 /* color VRAM segment */
- #define GVRAMSEG 0xb800 /* this value is not used */
- #define MAX_X_DOT 640 /* graphic mode x dots */
- #define MAX_Y_DOT 400 /* graphic mode x dots */
- #endif /* J3100 */
-
- /*
- * misc. address, parameters
- */
- #define ADDR_BUZZAR 0x61 /* buzzar address */
- #define CLICK_BEEP 700 /* click beep length */
- #ifdef J3100
- #define BELL_BEEP 2 /* bell beep length (55 * 2 = 110 msec) */
- #else /* !J3100 */
- #define BELL_BEEP 3 /* bell beep length (55 * 3 = 165 msec) */
- #endif /* J3100 */
-
- #define TIMER_VECT 0x1c /* tick timer vector */
- #define TICK_SEC 18 /* timer tick is 18.2 per 1 sec */
- #define TICK_INTERVAL 55 /* 55 msec for 1 interval */
- #define BLINK_ON_INTERVAL 8 /* 8 tick soft cursor blink on */
- #define BLINK_OFF_INTERVAL 4 /* 4 tick soft cursor blink off */
- #define BAUD_NUM_MAX 7 /* up to 38400 baud */
- #define TX_TIMEOUT 25 /* transmit time out 18.2 * 25 = 500msec */
-
- #define MAX_FUNKEY 17 /* max length of key string (16+1) */
- #define NUM_FUNKEY 10 /* number of function keys */
- #define NUM_PADKEY 13 /* number of keypad/cursor keys */
- #define CS_KEY 0x0300 /* CTRL_space key */
-
- #ifdef IBMPC
- #ifdef AX
- #define FBOX_CHAR 0x13 /* scroll bar SHOWING char */
- #define EBOX_CHAR 0x08 /* scroll bar HIDDING char */
- #else
- #define FBOX_CHAR 0xdc /* scroll bar SHOWING char */
- #define EBOX_CHAR 0xc4 /* scroll bar HIDDING char */
- #endif /* AX */
- #endif /* IBMPC */
-
- #ifdef J3100
- #define FBOX_CHAR 0x16 /* scroll bar SHOWING char */
- #define EBOX_CHAR 0x2d /* scroll bar HIDDING char */
- #endif /* J3100 */
-
- /*
- * screen (EGA) attribute
- */
- #ifndef J3100
- #define _NORMAL 0x07
- #define _UNDER 0x00
- #define _REVER 0x70
- #define _HIGH 0x08
- #define _BLINK 0x80
- #define MAX_BACK_COLOR 8
-
- #else /* J3100 */
- /* attribute code following decoded into real attribute by putChar/j3100.c */
- #define _NORMAL 0x00
- #define _UNDER 0x01
- #define _REVER 0x02
- #define _HIGH 0x04
- #define _BLINK 0x08
- #define _NORMAL_ATTR 0x77
- #define _UNDER_ATTR 0x7f
- #define _REVER_ATTR 0x70
- #define _HIGH_ATTR 0x70 /* J-3100 has no intensitied or */
- #define _BLINK_ATTR 0x70 /* blinking character attribute */
- #define MAX_BACK_COLOR 1
- #endif /* J3100 */
-
-