]>
git.saurik.com Git - apple/xnu.git/blob - pexpert/pexpert/i386/kdsoft.h
f12b2511f146b86c776339faf6035242766ab5ad
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
30 #ifndef _PEXPERT_I386_KDSOFT_H_
31 #define _PEXPERT_I386_KDSOFT_H_
34 * Mach Operating System
35 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
36 * All Rights Reserved.
38 * Permission to use, copy, modify and distribute this software and its
39 * documentation is hereby granted, provided that both the copyright
40 * notice and this permission notice appear in all copies of the
41 * software, derivative works or modified versions, and any portions
42 * thereof, and that both notices appear in supporting documentation.
44 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
45 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
46 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
48 * Carnegie Mellon requests users of this software to return to
50 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
51 * School of Computer Science
52 * Carnegie Mellon University
53 * Pittsburgh PA 15213-3890
55 * any improvements or extensions that they make and grant Carnegie Mellon
56 * the rights to redistribute these changes.
63 * Description: Software structures for keyboard/display driver, shared with
64 * drivers for specific graphics cards.
68 * Copyright Ing. C. Olivetti & C. S.p.A. 1988, 1989.
69 * All rights reserved.
71 * Copyright 1988, 1989 by Olivetti Advanced Technology Center, Inc.,
72 * Cupertino, California.
76 * Permission to use, copy, modify, and distribute this software and
77 * its documentation for any purpose and without fee is hereby
78 * granted, provided that the above copyright notice appears in all
79 * copies and that both the copyright notice and this permission notice
80 * appear in supporting documentation, and that the name of Olivetti
81 * not be used in advertising or publicity pertaining to distribution
82 * of the software without specific, written prior permission.
84 * OLIVETTI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
85 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
86 * IN NO EVENT SHALL OLIVETTI BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
87 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
88 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
89 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUR OF OR IN CONNECTION
90 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
94 * This driver handles two types of graphics cards. The first type
95 * (e.g., EGA, CGA), treats the screen as a page of characters and
96 * has a hardware cursor. The second type (e.g., the Blit) treats the
97 * screen as a bitmap. A hardware cursor may be present, but it is
98 * ignored in favor of a software cursor.
101 * Most of the driver uses the following abstraction for the display:
103 * The cursor position is simply an index into a (logical) linear char
104 * array that wraps around at the end of each line. Each character
105 * takes up ONE_SPACE bytes. Values in [0..ONE_PAGE) are positions in
106 * the displayed page. Values < 0 and >= ONE_PAGE are off the page
107 * and require some scrolling to put the cursor back on the page.
109 * The kd_dxxx routines handle the conversion from this abstraction to
110 * what the hardware requires.
112 * (*kd_dput)(pos, ch, chattr)
115 * Displays a character at "pos", where "ch" = the character to
116 * be displayed and "chattr" is its attribute byte.
118 * (*kd_dmvup)(from, to, count)
121 * Does a (relatively) fast block transfer of characters upward.
122 * "count" is the number of character positions (not bytes) to move.
123 * "from" is the character position to start moving from (at the start
124 * of the block to be moved). "to" is the character position to start
127 * (*kd_dmvdown)(from, to, count)
130 * "count" is the number of character positions (not bytes) to move.
131 * "from" is the character position to start moving from (at the end
132 * of the block to be moved). "to" is the character position to
135 * (*kd_dclear)(to, count, chattr)
139 * Erases "count" character positions, starting with "to".
141 * (*kd_dsetcursor)(pos)
142 * Sets kd_curpos and moves the displayed cursor to track it. "pos"
143 * should be in the range [0..ONE_PAGE).
146 * In some cases, the boot program expects the display to be in a
147 * particular state, and doing a soft reset (i.e.,
148 * software-controlled reboot) doesn't put it into that state. For
149 * these cases, the machine-specific driver should provide a "reset"
150 * procedure, which will be called just before the kd code causes the
154 //ERICHACK#include <device/io_req.h>
157 * Globals used for both character-based controllers and bitmap-based
161 typedef short csrpos_t
; /* cursor position, ONE_SPACE bytes per char */
162 extern u_char
*vid_start
; /* VM start of video RAM or frame buffer */
163 extern csrpos_t kd_curpos
; /* should be set only by kd_setpos */
164 extern short kd_lines
; /* num lines in tty display */
165 extern short kd_cols
;
166 extern char kd_attr
; /* current character attribute */
170 * Globals used only for bitmap-based controllers.
171 * XXX - probably needs reworking for color.
175 * The following font layout is assumed:
177 * The top scan line of all the characters comes first. Then the
178 * second scan line, then the third, etc.
180 * ------ ... ---------|-----N--------|-------------- ... -----------
181 * ------ ... ---------|-----N--------|-------------- ... -----------
185 * ------ ... ---------|-----N--------|-------------- ... -----------
187 * In the picture, each line is a scan line from the font. Each scan
188 * line is stored in memory immediately after the previous one. The
189 * bits between the vertical lines are the bits for a single character
190 * (e.g., the letter "N").
191 * There are "char_height" scan lines. Each character is "char_width"
192 * bits wide. We make the simplifying assumption that characters are
193 * on byte boundaries. (We also assume that a byte is 8 bits.)
196 extern u_char
*font_start
; /* starting addr of font */
198 extern short fb_width
; /* bits in frame buffer scan line */
199 extern short fb_height
; /* scan lines in frame buffer*/
200 extern short char_width
; /* bit width of 1 char */
201 extern short char_height
; /* bit height of 1 char */
202 extern short chars_in_font
;
203 extern short cursor_height
; /* bit height of cursor */
204 /* char_height + cursor_height = line_height */
206 extern u_char char_black
; /* 8 black (off) bits */
207 extern u_char char_white
; /* 8 white (on) bits */
211 * The tty emulation does not usually require the entire frame buffer.
212 * (xstart, ystart) is the bit address for the upper left corner of the
216 extern short xstart
, ystart
;
220 * Accelerators for bitmap displays.
223 extern short char_byte_width
; /* char_width/8 */
224 extern short fb_byte_width
; /* fb_width/8 */
225 extern short font_byte_width
; /* num bytes in 1 scan line of font */
235 extern void bmpmvdown(
239 extern void bmpclear(
243 extern void bmpsetcursor(
246 extern void (*kd_dput
)( /* put attributed char */
250 extern void (*kd_dmvup
)( /* block move up */
254 extern void (*kd_dmvdown
)( /* block move down */
258 extern void (*kd_dclear
)( /* block clear */
262 extern void (*kd_dsetcursor
)(
263 /* set cursor position on displayed page */
265 extern void (*kd_dreset
)(void); /* prepare for reboot */
268 #include <pexpert/i386/kd_entries.h>
274 #endif /* _PEXPERT_I386_KDSOFT_H_ */