FreeBSD/Linux Kernel Cross Reference
sys/i386at/kdsoft.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: kdsoft.h,v $
29 * Revision 2.5 91/05/14 16:28:11 mrt
30 * Correcting copyright
31 *
32 * Revision 2.4 91/02/05 17:19:42 mrt
33 * Changed to new Mach copyright
34 * [91/02/01 17:46:13 mrt]
35 *
36 * Revision 2.3 90/11/26 14:50:41 rvb
37 * jsb bet me to XMK34, sigh ...
38 * [90/11/26 rvb]
39 * Synched 2.5 & 3.0 at I386q (r1.4.1.4) & XMK35 (r2.3)
40 * [90/11/15 rvb]
41 *
42 * Revision 2.2 90/05/03 15:45:20 dbg
43 * First checkin.
44 *
45 * Revision 1.4.1.3 90/02/28 15:50:45 rvb
46 * Fix numerous typo's in Olivetti disclaimer.
47 * [90/02/28 rvb]
48 *
49 * Revision 1.4.1.2 90/01/08 13:30:35 rvb
50 * Add Olivetti copyright.
51 * [90/01/08 rvb]
52 *
53 * Revision 1.4.1.1 89/10/22 11:34:39 rvb
54 * Revision 1.5 89/09/27 16:02:59 kupfer
55 * Add support for resetting display before reboot.
56 *
57 * Revision 1.4 89/07/17 10:42:18 rvb
58 * Olivetti Changes to X79 upto 5/9/89:
59 * [89/07/11 rvb]
60 *
61 * Revision 1.1.1.1 89/04/27 12:36:07 kupfer
62 * X79 from CMU.
63 *
64 * Revision 1.3 89/02/26 12:42:58 gm0w
65 * Changes for cleanup.
66 *
67 */
68
69 /* **********************************************************************
70 File: kdsoft.h
71 Description: Software structures for keyboard/display driver, shared with
72 drivers for specific graphics cards.
73
74 $ Header: $
75
76 Copyright Ing. C. Olivetti & C. S.p.A. 1988, 1989.
77 All rights reserved.
78 ********************************************************************** */
79
80 /*
81 Copyright 1988, 1989 by Olivetti Advanced Technology Center, Inc.,
82 Cupertino, California.
83
84 All Rights Reserved
85
86 Permission to use, copy, modify, and distribute this software and
87 its documentation for any purpose and without fee is hereby
88 granted, provided that the above copyright notice appears in all
89 copies and that both the copyright notice and this permission notice
90 appear in supporting documentation, and that the name of Olivetti
91 not be used in advertising or publicity pertaining to distribution
92 of the software without specific, written prior permission.
93
94 OLIVETTI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
95 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
96 IN NO EVENT SHALL OLIVETTI BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
97 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
98 LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
99 NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUR OF OR IN CONNECTION
100 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
101 */
102
103 /*
104 * This driver handles two types of graphics cards. The first type
105 * (e.g., EGA, CGA), treats the screen as a page of characters and
106 * has a hardware cursor. The second type (e.g., the Blit) treats the
107 * screen as a bitmap. A hardware cursor may be present, but it is
108 * ignored in favor of a software cursor.
109 *
110 *
111 * Most of the driver uses the following abstraction for the display:
112 *
113 * The cursor position is simply an index into a (logical) linear char
114 * array that wraps around at the end of each line. Each character
115 * takes up ONE_SPACE bytes. Values in [0..ONE_PAGE) are positions in
116 * the displayed page. Values < 0 and >= ONE_PAGE are off the page
117 * and require some scrolling to put the cursor back on the page.
118 *
119 * The kd_dxxx routines handle the conversion from this abstraction to
120 * what the hardware requires.
121 *
122 * (*kd_dput)(pos, ch, chattr)
123 * csrpos_t pos;
124 * char ch, chattr;
125 * Displays a character at "pos", where "ch" = the character to
126 * be displayed and "chattr" is its attribute byte.
127 *
128 * (*kd_dmvup)(from, to, count)
129 * csrpos_t from, to;
130 * int count;
131 * Does a (relatively) fast block transfer of characters upward.
132 * "count" is the number of character positions (not bytes) to move.
133 * "from" is the character position to start moving from (at the start
134 * of the block to be moved). "to" is the character position to start
135 * moving to.
136 *
137 * (*kd_dmvdown)(from, to, count)
138 * csrpos_t from, to;
139 * int count;
140 * "count" is the number of character positions (not bytes) to move.
141 * "from" is the character position to start moving from (at the end
142 * of the block to be moved). "to" is the character position to
143 * start moving to.
144 *
145 * (*kd_dclear)(to, count, chattr)
146 * csrpos_t, to;
147 * int count;
148 * char chattr;
149 * Erases "count" character positions, starting with "to".
150 *
151 * (*kd_dsetcursor)(pos)
152 * Sets kd_curpos and moves the displayed cursor to track it. "pos"
153 * should be in the range [0..ONE_PAGE).
154 *
155 * (*kd_dreset)()
156 * In some cases, the boot program expects the display to be in a
157 * particular state, and doing a soft reset (i.e.,
158 * software-controlled reboot) doesn't put it into that state. For
159 * these cases, the machine-specific driver should provide a "reset"
160 * procedure, which will be called just before the kd code causes the
161 * system to reboot.
162 */
163
164 extern void bmpput(), bmpmvup(), bmpmvdown(), bmpclear(), bmpsetcursor();
165
166 extern void (*kd_dput)(); /* put attributed char */
167 extern void (*kd_dmvup)(); /* block move up */
168 extern void (*kd_dmvdown)(); /* block move down */
169 extern void (*kd_dclear)(); /* block clear */
170 extern void (*kd_dsetcursor)();
171 /* set cursor position on displayed page */
172 extern void (*kd_dreset)(); /* prepare for reboot */
173
174
175 /*
176 * Globals used for both character-based controllers and bitmap-based
177 * controllers.
178 */
179 typedef short csrpos_t; /* cursor position, ONE_SPACE bytes per char */
180
181 extern u_char *vid_start; /* VM start of video RAM or frame buffer */
182 extern csrpos_t kd_curpos; /* should be set only by kd_setpos */
183 extern short kd_lines; /* num lines in tty display */
184 extern short kd_cols;
185 extern char kd_attr; /* current character attribute */
186
187
188 /*
189 * Globals used only for bitmap-based controllers.
190 * XXX - probably needs reworking for color.
191 */
192
193 /*
194 * The following font layout is assumed:
195 *
196 * The top scan line of all the characters comes first. Then the
197 * second scan line, then the third, etc.
198 *
199 * ------ ... ---------|-----N--------|-------------- ... -----------
200 * ------ ... ---------|-----N--------|-------------- ... -----------
201 * .
202 * .
203 * .
204 * ------ ... ---------|-----N--------|-------------- ... -----------
205 *
206 * In the picture, each line is a scan line from the font. Each scan
207 * line is stored in memory immediately after the previous one. The
208 * bits between the vertical lines are the bits for a single character
209 * (e.g., the letter "N").
210 * There are "char_height" scan lines. Each character is "char_width"
211 * bits wide. We make the simplifying assumption that characters are
212 * on byte boundaries. (We also assume that a byte is 8 bits.)
213 */
214
215 extern u_char *font_start; /* starting addr of font */
216
217 extern short fb_width; /* bits in frame buffer scan line */
218 extern short fb_height; /* scan lines in frame buffer*/
219 extern short char_width; /* bit width of 1 char */
220 extern short char_height; /* bit height of 1 char */
221 extern short chars_in_font;
222 extern short cursor_height; /* bit height of cursor */
223 /* char_height + cursor_height = line_height */
224
225 extern u_char char_black; /* 8 black (off) bits */
226 extern u_char char_white; /* 8 white (on) bits */
227
228
229 /*
230 * The tty emulation does not usually require the entire frame buffer.
231 * (xstart, ystart) is the bit address for the upper left corner of the
232 * tty "screen".
233 */
234
235 extern short xstart, ystart;
236
237
238 /*
239 * Accelerators for bitmap displays.
240 */
241
242 extern short char_byte_width; /* char_width/8 */
243 extern short fb_byte_width; /* fb_width/8 */
244 extern short font_byte_width; /* num bytes in 1 scan line of font */
Cache object: 992a5a3e9e326643863d9c8bc6782784
|