]>
git.saurik.com Git - apple/xnu.git/blob - pexpert/pexpert/i386/kdsoft.h
2cdfd0aa9df7638728c6c9ae639450c3dbb8ea88
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
22 #ifndef _PEXPERT_I386_KDSOFT_H_
23 #define _PEXPERT_I386_KDSOFT_H_
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
28 * All Rights Reserved.
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
55 * Description: Software structures for keyboard/display driver, shared with
56 * drivers for specific graphics cards.
60 * Copyright Ing. C. Olivetti & C. S.p.A. 1988, 1989.
61 * All rights reserved.
63 * Copyright 1988, 1989 by Olivetti Advanced Technology Center, Inc.,
64 * Cupertino, California.
68 * Permission to use, copy, modify, and distribute this software and
69 * its documentation for any purpose and without fee is hereby
70 * granted, provided that the above copyright notice appears in all
71 * copies and that both the copyright notice and this permission notice
72 * appear in supporting documentation, and that the name of Olivetti
73 * not be used in advertising or publicity pertaining to distribution
74 * of the software without specific, written prior permission.
76 * OLIVETTI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
77 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
78 * IN NO EVENT SHALL OLIVETTI BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
79 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
80 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
81 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUR OF OR IN CONNECTION
82 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
86 * This driver handles two types of graphics cards. The first type
87 * (e.g., EGA, CGA), treats the screen as a page of characters and
88 * has a hardware cursor. The second type (e.g., the Blit) treats the
89 * screen as a bitmap. A hardware cursor may be present, but it is
90 * ignored in favor of a software cursor.
93 * Most of the driver uses the following abstraction for the display:
95 * The cursor position is simply an index into a (logical) linear char
96 * array that wraps around at the end of each line. Each character
97 * takes up ONE_SPACE bytes. Values in [0..ONE_PAGE) are positions in
98 * the displayed page. Values < 0 and >= ONE_PAGE are off the page
99 * and require some scrolling to put the cursor back on the page.
101 * The kd_dxxx routines handle the conversion from this abstraction to
102 * what the hardware requires.
104 * (*kd_dput)(pos, ch, chattr)
107 * Displays a character at "pos", where "ch" = the character to
108 * be displayed and "chattr" is its attribute byte.
110 * (*kd_dmvup)(from, to, count)
113 * Does a (relatively) fast block transfer of characters upward.
114 * "count" is the number of character positions (not bytes) to move.
115 * "from" is the character position to start moving from (at the start
116 * of the block to be moved). "to" is the character position to start
119 * (*kd_dmvdown)(from, to, count)
122 * "count" is the number of character positions (not bytes) to move.
123 * "from" is the character position to start moving from (at the end
124 * of the block to be moved). "to" is the character position to
127 * (*kd_dclear)(to, count, chattr)
131 * Erases "count" character positions, starting with "to".
133 * (*kd_dsetcursor)(pos)
134 * Sets kd_curpos and moves the displayed cursor to track it. "pos"
135 * should be in the range [0..ONE_PAGE).
138 * In some cases, the boot program expects the display to be in a
139 * particular state, and doing a soft reset (i.e.,
140 * software-controlled reboot) doesn't put it into that state. For
141 * these cases, the machine-specific driver should provide a "reset"
142 * procedure, which will be called just before the kd code causes the
146 //ERICHACK#include <device/io_req.h>
149 * Globals used for both character-based controllers and bitmap-based
153 typedef short csrpos_t
; /* cursor position, ONE_SPACE bytes per char */
154 extern u_char
*vid_start
; /* VM start of video RAM or frame buffer */
155 extern csrpos_t kd_curpos
; /* should be set only by kd_setpos */
156 extern short kd_lines
; /* num lines in tty display */
157 extern short kd_cols
;
158 extern char kd_attr
; /* current character attribute */
162 * Globals used only for bitmap-based controllers.
163 * XXX - probably needs reworking for color.
167 * The following font layout is assumed:
169 * The top scan line of all the characters comes first. Then the
170 * second scan line, then the third, etc.
172 * ------ ... ---------|-----N--------|-------------- ... -----------
173 * ------ ... ---------|-----N--------|-------------- ... -----------
177 * ------ ... ---------|-----N--------|-------------- ... -----------
179 * In the picture, each line is a scan line from the font. Each scan
180 * line is stored in memory immediately after the previous one. The
181 * bits between the vertical lines are the bits for a single character
182 * (e.g., the letter "N").
183 * There are "char_height" scan lines. Each character is "char_width"
184 * bits wide. We make the simplifying assumption that characters are
185 * on byte boundaries. (We also assume that a byte is 8 bits.)
188 extern u_char
*font_start
; /* starting addr of font */
190 extern short fb_width
; /* bits in frame buffer scan line */
191 extern short fb_height
; /* scan lines in frame buffer*/
192 extern short char_width
; /* bit width of 1 char */
193 extern short char_height
; /* bit height of 1 char */
194 extern short chars_in_font
;
195 extern short cursor_height
; /* bit height of cursor */
196 /* char_height + cursor_height = line_height */
198 extern u_char char_black
; /* 8 black (off) bits */
199 extern u_char char_white
; /* 8 white (on) bits */
203 * The tty emulation does not usually require the entire frame buffer.
204 * (xstart, ystart) is the bit address for the upper left corner of the
208 extern short xstart
, ystart
;
212 * Accelerators for bitmap displays.
215 extern short char_byte_width
; /* char_width/8 */
216 extern short fb_byte_width
; /* fb_width/8 */
217 extern short font_byte_width
; /* num bytes in 1 scan line of font */
227 extern void bmpmvdown(
231 extern void bmpclear(
235 extern void bmpsetcursor(
238 extern void (*kd_dput
)( /* put attributed char */
242 extern void (*kd_dmvup
)( /* block move up */
246 extern void (*kd_dmvdown
)( /* block move down */
250 extern void (*kd_dclear
)( /* block clear */
254 extern void (*kd_dsetcursor
)(
255 /* set cursor position on displayed page */
257 extern void (*kd_dreset
)(void); /* prepare for reboot */
260 #include <pexpert/i386/kd_entries.h>
266 #endif /* _PEXPERT_I386_KDSOFT_H_ */