VGA Hardware: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
(Undo revision 13456 by Yuhong (talk) --- This article is about the VGA hardware. Who said anything about a BIOS?)
Line 5:
 
== Overview ==
 
While the VGA chip is quite a simple piece of hardware compared to modern video equipment, it is possibly one of the more complicated devices to program for, and especially in the old days knowing your way around this particular device was sufficient for establishing quite a reputation. While currently a legacy device, it is a good place to begin practicing your video driver skills. While a full-blown VGA driver might make an USB controller look trivial, there are fortunately many shortcuts available for taking.
 
=== What's not covered ===
While this page tries to be a complete overview on what the VGA can do, it does not fully cover the whole set of graphics. After all, a video card only turns bytes in it's memory into a signal on the connector on it's backside. Determining what bytes to put in memory is only barely touched in the wiki in general - there are examples of plotting pixels and setting individual characters but your OS will determine what pixels are formed by an image and which characters are part of your title screen. On the remote end, monitors have their own way of dealing with signals. A lot of those settings dictated by monitors are needed by the video card, and each resolution comes with its own set of settings. You can find out your own set of settings by [[Video Signals And Timing|using a set of equations]], but you can skip that step and reuse one of the examples provided at the [[VGA_Hardware#Sample_Register_Settings|example settings]] instead. The [[VGA_Hardware#The_CRT_Controller|CRTC chapter]] explains them in detail.
 
=== Getting started ===
There's a fair share of [[VGA Resources|modesetting code available]] around the web. The basic steps involve calculating the needed register values, writing them to the VGA, then continue with drawing. You'll need:
* Port I/O: The VGA needs 8-bit read/writes, and 16-bit writes.
* MMIO: The VGA uses uncached byte accesses to 0xA0000-0xBFFFF. In several cases, larger writes are also allowed.
* Functions to [[VGA_Hardware#VGA_Registers|read and write registers]] for each VGA component - since there are many more registers than there are ports you will need a wrapper for this.
* A structure that contains the VGA display settings. For a nice list of things you want to set, you can use the example register settings part. Keep in mind that you might also want a structure for things that change during drawing, such as colours and offsets.
* A function that writes that structure to the device
* A function that fills out that structure. You can also use a hardcoded structure initially.
 
=== Hardware components ===
 
The VGA can be divided in several parts. Historically, the predecessor of the VGA - the EGA - had several chips to perform each part in the system. These chips could be configured to your liking using the I/O Bus. On the VGA, these have been merged into one chip (with the exception of the DAC).
1,490

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu