Specifications.
[pintos-anon] / specs / freevga / vga / vga.htm
1 <HTML>
2 <HEAD>
3    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
4    <META NAME="Author" CONTENT="Joshua Neal">
5    <META NAME="Description" CONTENT="Pure VGA/SVGA hardware programming (registers, identification, and otherlow-level stuff.)">
6    <META NAME="KeyWords" CONTENT="VGA SVGA hardware video programming">
7    <TITLE>VGA/SVGA Video Programming--Standard VGA Chipset Reference</TITLE>
8 </HEAD>
9 <BODY>
10
11 <CENTER><A HREF="../home.htm">Home</A> <A HREF="#intro">Intro</A> <A HREF="#general">General</A>
12 <A HREF="#register">Registers</A> <A HREF="#index">Index</A> <A HREF="../home.htm#vga">Back</A>&nbsp;
13 <HR WIDTH="100%"><B>Hardware Level VGA and SVGA Video Programming Information
14 Page</B></CENTER>
15
16 <CENTER>VGA Chipset Reference&nbsp;
17 <HR WIDTH="100%"></CENTER>
18
19 <UL>
20 <LI>
21 <A HREF="#intro">Introduction</A> -- introduction to the VGA reference</LI>
22
23 <LI>
24 <A HREF="#general">General Programming Information</A> -- details of the
25 functional operation of the VGA hardware.</LI>
26
27 <LI>
28 <A HREF="#register">Input/Output Register Information</A> -- details on
29 the VGA registers themselves</LI>
30
31 <LI>
32 <A HREF="#index">Indices</A> -- convenient listings of fields and their
33 locations alphabetically and by function</LI>
34 </UL>
35 <A NAME="intro"></A><B>Introduction</B>
36 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This section is intended
37 to be a reference to the common functionality of the original IBM VGA and
38 compatible adapters. If you are writing directly to hardware then this
39 is the lowest common denominator of nearly all video cards in use today.
40 Nearly all programs requiring the performance of low-level hardware access
41 resort to this baseline capacity, so this information is still valuable
42 to programmers. In addition most of the VGA functions apply to SVGA cards
43 when operating in SVGA modes, so it is best to know how to use them even
44 when programming more advanced hardware.
45 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Most VGA references I have
46 seen document the VGA by describing its operation in the various BIOS modes.
47 However, because BIOS was designed for use in MS-DOS real mode applications,
48 its functionality is limited in other environments. This document is structured
49 in a way that explains the VGA hardware and its operation independent of
50 the VGA BIOS modes, which will allow for better understanding of the capabilities
51 of the VGA hardware.
52 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This reference has grown
53 out of my own notes and experimentation while learning to program the VGA
54 hardware. During this process I have identified errors in various references
55 that I have used and have attempted to document the VGA hardware's actual
56 behavior as best as possible. If in your experience you find any of this
57 information to be inaccurate, or even if you find this information to be
58 misleading or inaccurate, please let me know!
59 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; One of the reasons I started
60 this reference was that I was using existing references and found myself
61 wishing for a hypertext reference as almost every register is affected
62 by the operation of another, and was constantly flipping pages. Here I
63 simply use links for the register references, such as <A HREF="crtcreg.htm#13">Offset
64 Register</A>, rather than stating something like: Offset Register (CRTC:
65 Offset = 13h, bits 7-0). While the second method is more informative, using
66 them for every reference to the register makes the text somewhat bogged
67 down. HTML allows simply clicking on the register name and all of the details
68 are provided. Another is that no single reference had all of the information
69 I was looking for, and that I had penciled many corrections and clarifications
70 into the references themselves. This makes it difficult to switch to a
71 newer version of a book when another edition comes out -- I still use my
72 heavily annotated second edition of Ferarro's book, rather than the more
73 up-to-date third edition.
74
75 <P><A NAME="general"></A><B>General Programming Information</B>
76 <BR><B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </B>This section is intended
77 to provide functional information on various aspects of the VGA. If you
78 are looking simply for VGA register descriptions look in the next section.
79 The VGA hardware is complex and can be confusing to program. Rather than
80 attempt to document the VGA better than existing references by using more
81 words to describe the registers, this section breaks down the functionality
82 of the VGA into specific categories of similar functions or by detailing
83 procedures for performing certain operations.
84 <UL>
85 <LI>
86 <A HREF="vgamem.htm">Accessing the VGA Display Memory</A> -- details on
87 the memory interface between the CPU and VGA frame buffer.</LI>
88
89 <LI>
90 <A HREF="vgaseq.htm">Sequencer Operation</A> -- details on how the VGA
91 hardware rasterizes the display buffer</LI>
92
93 <UL>
94 <LI>
95 Text-mode</LI>
96
97 <UL>
98 <LI>
99 <A HREF="vgatext.htm">VGA Text Mode Operation</A> -- details concerning
100 text mode operation, including attributes and fonts.</LI>
101
102 <LI>
103 <A HREF="textcur.htm">Manipulating the Text-mode Cursor</A> -- details
104 controlling the appearance and location of the cursor.</LI>
105 </UL>
106 </UL>
107
108 <UL>
109 <LI>
110 <A HREF="vgafx.htm">Special Effects Hardware</A> -- details on hardware
111 support for windowing, paging, smooth scrolling and panning, and split-screen
112 operation.</LI>
113 </UL>
114
115 <LI>
116 <A HREF="vgaattr.htm">Attribute Controller Operation</A> -- details on
117 the conversion of sequenced display data into DAC input. <B>(WIP)</B></LI>
118
119 <LI>
120 <A HREF="vgadac.htm">DAC Operation</A> -- details controlling the conversion
121 of palette data into analog signals.</LI>
122
123 <LI>
124 <A HREF="vgacrtc.htm">Display Generation</A> -- details on formatting of
125 the produced video signal for output to the display.</LI>
126 </UL>
127 <A NAME="register"></A><B>Input/Output Register Information</B>
128 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This section is intended
129 to provide a detailed reference of the VGA's internal registers. It attempts
130 to combine information from a variety of sources, including the references
131 listed in the reference section of the home page; however, rather than
132 attempting to condense this information into one reference, leaving out
133 significant detail, I have attempted to expand upon the information available
134 and provide an accurate, detailed reference that should be useful to any
135 programmer of the VGA and SVGA. Only those registers that are present and
136 functional on the VGA are given, so if you are seeking information specific
137 to the CGA, EGA, MCGA, or MGA adapters try the Other References section
138 on the home page.
139 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In some cases I have changed
140 the name of the register, not to protect the innocent but simply to make
141 it clearer to understand. One clarification is the use of "Enable" and
142 "Disable". A the function of a field with the name ending with "Enable"
143 is enabled when it is 1, and likewise a field with a name ending in Disable
144 is disabled when it is 1. Another case is when two fields have similar
145 or identical names, I have added more description to the name to differentiate
146 them.
147 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; It can be difficult to understand
148 how to manipulate the VGA registers as many registers have been packed
149 into a small number of I/O ports and accessing them can be non-intuituve,
150 especially the Attribute Controller Registers, so I have provided a tutorial
151 for doing this.
152 <UL>
153 <LI>
154 &nbsp;<A HREF="vgareg.htm">Accessing the VGA Registers</A> -- methods of
155 manipulating the VGA registers</LI>
156 </UL>
157 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In order to facilitate understanding
158 of the registers, one should view them as groups of similar registers,
159 based upon how they are accessed, as the VGA uses indexed registers to
160 access most parameters. This also roughly places them in groups of similar
161 functionality; however, in many cases the fields do not fit neatly into
162 their category. In certain cases I have utilized quotes from the IBM VGA
163 Programmer's Reference, this information is given in "<I>italic.</I>"&nbsp;
164 This is meant to be a temporary placeholder until a better description
165 can be written, it may not be applicable to a standard VGA implementation.&nbsp;
166 Presented to roughly based upon their place in the graphics pipeline between
167 the CPU and the video outputs are the:
168 <UL>
169 <LI>
170 <A HREF="graphreg.htm">Graphics Registers</A> -- control the way the CPU
171 accesses video RAM.</LI>
172
173 <LI>
174 <A HREF="seqreg.htm">Sequencer Registers</A> -- control how video data
175 is sent to the DAC.</LI>
176
177 <LI>
178 <A HREF="attrreg.htm">Attribute Controller Registers</A> -- selects the
179 16 color and 64 color palettes used for EGA/CGA compatibility.</LI>
180
181 <LI>
182 <A HREF="crtcreg.htm">CRT Controller Registers</A> -- control how the video
183 is output to the display.</LI>
184
185 <LI>
186 <A HREF="colorreg.htm">Color Registers</A> -- selects the 256 color palette
187 from the maximum possible colors.</LI>
188
189 <LI>
190 <A HREF="extreg.htm">External Registers</A> -- miscellaneous registers
191 used to control video operation.</LI>
192 </UL>
193 <A NAME="index"></A><B>Indices</B>
194 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In order to locate a particular
195 register quickly, the following indexes are provided. The first is a listing
196 of all of the register fields of the VGA hardware. This is especially useful
197 for fields that are split among multiple registers, or for finding the
198 location of a field that are packed in with other fields in one register.
199 The second is indexed by function groups each pertaining to a particular
200 part of the VGA hardware. This makes understanding and programming the
201 VGA hardware easier by listing the fields by subsystem, as the VGA's fields
202 are grouped in a somewhat haphazard fashion. The third is intended for
203 matching a read or write to a particular I/O port address to the section
204 where it is described.
205 <UL>
206 <LI>
207 <A HREF="vgargidx.htm">VGA Field Index</A> -- An alphabetical listing of
208 all fields and links to their location.</LI>
209
210 <LI>
211 <A HREF="vgafunc.htm">VGA Functional Index</A> -- A listing of all fields
212 and links to their location grouped by function.</LI>
213
214 <LI>
215 <A HREF="portidx.htm">VGA I/O Port Index</A> -- A listing of VGA I/O ports
216 in numerical order.</LI>
217 </UL>
218 Notice: All trademarks used or referred to on this page are the property
219 of their respective owners.
220 <BR>All pages are Copyright &copy; 1997, 1998, J. D. Neal, except where
221 noted. Permission for utilization and distribution is subject to the terms
222 of the <A HREF="license.htm">FreeVGA Project Copyright License</A>.
223
224 <P>&nbsp;
225 </BODY>
226 </HTML>