]>
git.saurik.com Git - apple/xnu.git/blob - pexpert/pexpert/i386/kdsoft.h
399fa9e6e4b7f0e7f548e7db742481ab6f7e2392
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
28 #ifndef _PEXPERT_I386_KDSOFT_H_
29 #define _PEXPERT_I386_KDSOFT_H_
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
34 * All Rights Reserved.
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
46 * Carnegie Mellon requests users of this software to return to
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
61 * Description: Software structures for keyboard/display driver, shared with
62 * drivers for specific graphics cards.
66 * Copyright Ing. C. Olivetti & C. S.p.A. 1988, 1989.
67 * All rights reserved.
69 * Copyright 1988, 1989 by Olivetti Advanced Technology Center, Inc.,
70 * Cupertino, California.
74 * Permission to use, copy, modify, and distribute this software and
75 * its documentation for any purpose and without fee is hereby
76 * granted, provided that the above copyright notice appears in all
77 * copies and that both the copyright notice and this permission notice
78 * appear in supporting documentation, and that the name of Olivetti
79 * not be used in advertising or publicity pertaining to distribution
80 * of the software without specific, written prior permission.
82 * OLIVETTI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
83 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
84 * IN NO EVENT SHALL OLIVETTI BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
85 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
86 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
87 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUR OF OR IN CONNECTION
88 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
92 * This driver handles two types of graphics cards. The first type
93 * (e.g., EGA, CGA), treats the screen as a page of characters and
94 * has a hardware cursor. The second type (e.g., the Blit) treats the
95 * screen as a bitmap. A hardware cursor may be present, but it is
96 * ignored in favor of a software cursor.
99 * Most of the driver uses the following abstraction for the display:
101 * The cursor position is simply an index into a (logical) linear char
102 * array that wraps around at the end of each line. Each character
103 * takes up ONE_SPACE bytes. Values in [0..ONE_PAGE) are positions in
104 * the displayed page. Values < 0 and >= ONE_PAGE are off the page
105 * and require some scrolling to put the cursor back on the page.
107 * The kd_dxxx routines handle the conversion from this abstraction to
108 * what the hardware requires.
110 * (*kd_dput)(pos, ch, chattr)
113 * Displays a character at "pos", where "ch" = the character to
114 * be displayed and "chattr" is its attribute byte.
116 * (*kd_dmvup)(from, to, count)
119 * Does a (relatively) fast block transfer of characters upward.
120 * "count" is the number of character positions (not bytes) to move.
121 * "from" is the character position to start moving from (at the start
122 * of the block to be moved). "to" is the character position to start
125 * (*kd_dmvdown)(from, to, count)
128 * "count" is the number of character positions (not bytes) to move.
129 * "from" is the character position to start moving from (at the end
130 * of the block to be moved). "to" is the character position to
133 * (*kd_dclear)(to, count, chattr)
137 * Erases "count" character positions, starting with "to".
139 * (*kd_dsetcursor)(pos)
140 * Sets kd_curpos and moves the displayed cursor to track it. "pos"
141 * should be in the range [0..ONE_PAGE).
144 * In some cases, the boot program expects the display to be in a
145 * particular state, and doing a soft reset (i.e.,
146 * software-controlled reboot) doesn't put it into that state. For
147 * these cases, the machine-specific driver should provide a "reset"
148 * procedure, which will be called just before the kd code causes the
152 //ERICHACK#include <device/io_req.h>
155 * Globals used for both character-based controllers and bitmap-based
159 typedef short csrpos_t
; /* cursor position, ONE_SPACE bytes per char */
160 extern u_char
*vid_start
; /* VM start of video RAM or frame buffer */
161 extern csrpos_t kd_curpos
; /* should be set only by kd_setpos */
162 extern short kd_lines
; /* num lines in tty display */
163 extern short kd_cols
;
164 extern char kd_attr
; /* current character attribute */
168 * Globals used only for bitmap-based controllers.
169 * XXX - probably needs reworking for color.
173 * The following font layout is assumed:
175 * The top scan line of all the characters comes first. Then the
176 * second scan line, then the third, etc.
178 * ------ ... ---------|-----N--------|-------------- ... -----------
179 * ------ ... ---------|-----N--------|-------------- ... -----------
183 * ------ ... ---------|-----N--------|-------------- ... -----------
185 * In the picture, each line is a scan line from the font. Each scan
186 * line is stored in memory immediately after the previous one. The
187 * bits between the vertical lines are the bits for a single character
188 * (e.g., the letter "N").
189 * There are "char_height" scan lines. Each character is "char_width"
190 * bits wide. We make the simplifying assumption that characters are
191 * on byte boundaries. (We also assume that a byte is 8 bits.)
194 extern u_char
*font_start
; /* starting addr of font */
196 extern short fb_width
; /* bits in frame buffer scan line */
197 extern short fb_height
; /* scan lines in frame buffer*/
198 extern short char_width
; /* bit width of 1 char */
199 extern short char_height
; /* bit height of 1 char */
200 extern short chars_in_font
;
201 extern short cursor_height
; /* bit height of cursor */
202 /* char_height + cursor_height = line_height */
204 extern u_char char_black
; /* 8 black (off) bits */
205 extern u_char char_white
; /* 8 white (on) bits */
209 * The tty emulation does not usually require the entire frame buffer.
210 * (xstart, ystart) is the bit address for the upper left corner of the
214 extern short xstart
, ystart
;
218 * Accelerators for bitmap displays.
221 extern short char_byte_width
; /* char_width/8 */
222 extern short fb_byte_width
; /* fb_width/8 */
223 extern short font_byte_width
; /* num bytes in 1 scan line of font */
233 extern void bmpmvdown(
237 extern void bmpclear(
241 extern void bmpsetcursor(
244 extern void (*kd_dput
)( /* put attributed char */
248 extern void (*kd_dmvup
)( /* block move up */
252 extern void (*kd_dmvdown
)( /* block move down */
256 extern void (*kd_dclear
)( /* block clear */
260 extern void (*kd_dsetcursor
)(
261 /* set cursor position on displayed page */
263 extern void (*kd_dreset
)(void); /* prepare for reboot */
266 #include <pexpert/i386/kd_entries.h>
272 #endif /* _PEXPERT_I386_KDSOFT_H_ */