1 |
1625 |
jcastillo |
Video Mode Selection Support 2.9
|
2 |
|
|
(c) 1995, 1996 Martin Mares,
|
3 |
|
|
--------------------------------------------------------------------------------
|
4 |
|
|
|
5 |
|
|
1. Intro
|
6 |
|
|
~~~~~~~~
|
7 |
|
|
This small document describes the "Video Mode Selection" feature which
|
8 |
|
|
allows to use various special video modes supported by the video BIOS. Due
|
9 |
|
|
to usage of the BIOS, the selection is limited to the boot time (before the
|
10 |
|
|
kernel decompression starts and works only on 80X86 machines.
|
11 |
|
|
|
12 |
|
|
IF YOU USE THIS FEATURE, I'LL BE MUCH PLEASED IF YOU SEND ME A MAIL
|
13 |
|
|
DESCRIBING YOUR EXPERIENCE WITH IT. BUG REPORTS ARE ALSO WELCOME.
|
14 |
|
|
|
15 |
|
|
The video mode to be used is selected by a kernel parameter which can be
|
16 |
|
|
specified in the kernel Makefile (the SVGA_MODE=... line) or by the "vga=..."
|
17 |
|
|
option of LILO or by the "vidmode" utility (present in standard Linux utility
|
18 |
|
|
packages). You can use the following settings of this parameter:
|
19 |
|
|
|
20 |
|
|
NORMAL_VGA - Standard 80x25 mode available on all display adapters.
|
21 |
|
|
|
22 |
|
|
EXTENDED_VGA - Standard 8-pixel font mode: 80x43 on EGA, 80x50 on VGA.
|
23 |
|
|
|
24 |
|
|
ASK_VGA - Display a video mode menu upon startup (see below).
|
25 |
|
|
|
26 |
|
|
0..35 - Menu item number (when you have used the menu to view the list of
|
27 |
|
|
modes available on your adapter, you can specify the menu item you want
|
28 |
|
|
to use). 0..9 correspond to "0".."9", 10..35 to "a".."z". Warning: the
|
29 |
|
|
mode list displayed may vary as the kernel version changes, because the
|
30 |
|
|
modes are listed in a "first detected -- first displayed" manner. It's
|
31 |
|
|
better to use absolute mode numbers instead.
|
32 |
|
|
|
33 |
|
|
0x.... - Hexadecimal video mode ID (also displayed on the menu, see below
|
34 |
|
|
for exact meaning of the ID). Warning: rdev and LILO don't support
|
35 |
|
|
hexadecimal numbers -- you have to convert it to decimal manually.
|
36 |
|
|
|
37 |
|
|
2. Menu
|
38 |
|
|
~~~~~~~
|
39 |
|
|
The ASK_VGA mode causes the kernel to offer a video mode menu upon
|
40 |
|
|
bootup. It displays a "Press to see video modes available,
|
41 |
|
|
to continue or wait 30 secs" message. If you press , you enter the
|
42 |
|
|
menu, if you press or wait 30 seconds, the kernel will boot up with
|
43 |
|
|
the standard 80x25 mode set.
|
44 |
|
|
|
45 |
|
|
The menu looks like:
|
46 |
|
|
|
47 |
|
|
Video adapter:
|
48 |
|
|
Mode: COLSxROWS:
|
49 |
|
|
|
50 |
|
|
1 0F01 80x50
|
51 |
|
|
2 0F02 80x43
|
52 |
|
|
3 0F03 80x26
|
53 |
|
|
....
|
54 |
|
|
Enter mode number:
|
55 |
|
|
|
56 |
|
|
should contain a name of your video adapter
|
57 |
|
|
or the chip in it or at least whether it's an EGA or VGA or VESA VGA (VGA with
|
58 |
|
|
a VESA-compliant BIOS in it). If it doesn't match your configuration, tell me
|
59 |
|
|
and I'll try to fix it somehow (you know, hardware detection is a real pain
|
60 |
|
|
on PC's).
|
61 |
|
|
|
62 |
|
|
"0 0F00 80x25" tells that the first menu item (the menu items are numbered
|
63 |
|
|
from "0" to "9" and from "a" to "z") is a 80x25 mode with ID=0x0f00 (see the
|
64 |
|
|
next section for a description of the mode ID's).
|
65 |
|
|
|
66 |
|
|
encourages you to write the item number or mode ID
|
67 |
|
|
you wish to set and press . If the computer complains something about
|
68 |
|
|
"Unknown mode ID", it tries to explain you that it isn't possible to set such
|
69 |
|
|
a mode. It's also possible to press only which forces the current
|
70 |
|
|
mode to be used.
|
71 |
|
|
|
72 |
|
|
The mode list may be a bit inaccurate on your machine (it isn't possible
|
73 |
|
|
to autodetect all existing video cards and their mutations). Some of the
|
74 |
|
|
modes may be unsettable, some of them might work incorrectly with Linux
|
75 |
|
|
(the common case is mirroring of first few lines at the bottom of the screen
|
76 |
|
|
because of BIOS bugs) or there can exist modes which are not displayed. If
|
77 |
|
|
you think the list doesn't match your configuration, let me know and I'll try
|
78 |
|
|
to add your configuration to the next version of the mode selector.
|
79 |
|
|
|
80 |
|
|
The modes displayed on the menu are partially sorted: The list starts with
|
81 |
|
|
the standard modes (80x25 and 80x50) followed by "special" modes (80x28 and
|
82 |
|
|
80x43), local modes (if the local modes feature is enabled), VESA modes and
|
83 |
|
|
finally SVGA modes for the auto-detected adapter.
|
84 |
|
|
|
85 |
|
|
If you enter "scan" instead of item number / mode ID, the program will try
|
86 |
|
|
to scan your video modes in a slightly aggressive, but much more accurate way.
|
87 |
|
|
This should reveal all video modes supported by your BIOS. During this process,
|
88 |
|
|
the screen will flash wildly and strange things will appear. If you are afraid
|
89 |
|
|
this could damage your monitor, don't use this functions. After scanning, the
|
90 |
|
|
mode ordering is a bit different: the auto-detected SVGA modes are not listed
|
91 |
|
|
at all and the modes revealed by the scan are shown before the VESA modes.
|
92 |
|
|
|
93 |
|
|
3. Mode ID's
|
94 |
|
|
~~~~~~~~~~~~
|
95 |
|
|
Because of the complexity of all the video stuff, the video mode ID's
|
96 |
|
|
used here are also a bit complex. A video mode ID is a 16-bit number usually
|
97 |
|
|
expressed in a hexadecimal notation (starting with "0x"). The ID numbers
|
98 |
|
|
can be divided to three regions:
|
99 |
|
|
|
100 |
|
|
0x0000 to 0x00ff - menu item references. 0x0000 is the first item.
|
101 |
|
|
|
102 |
|
|
0x0100 to 0x017f - standard BIOS modes. The ID is a BIOS video mode number
|
103 |
|
|
(as presented to INT 10, function 00) increased by 0x0100. You can
|
104 |
|
|
use any mode numbers even if not shown on the menu.
|
105 |
|
|
|
106 |
|
|
0x0200 to 0x08ff - VESA BIOS modes. The ID is a VESA mode ID increased by
|
107 |
|
|
0x0100. All VESA modes should be autodetected and shown on the menu.
|
108 |
|
|
|
109 |
|
|
0x0900 to 0x09ff - Video7 special modes. Set by calling INT 0x10, AX=0x6f05.
|
110 |
|
|
|
111 |
|
|
0x0f00 to 0x0fff - special modes (they are set by various tricks -- usually
|
112 |
|
|
by modifying one of the standard modes). Currently available:
|
113 |
|
|
0x0f00 standard 80x25, don't reset mode if already set (=FFFF)
|
114 |
|
|
0x0f01 standard with 8-point font: 80x43 on EGA, 80x50 on VGA
|
115 |
|
|
0x0f02 VGA 80x43 (VGA switched to 350 scanlines with a 8-point font)
|
116 |
|
|
0x0f03 VGA 80x28 (standard VGA scans, but 14-point font)
|
117 |
|
|
0x0f04 leave current video mode
|
118 |
|
|
0x0f05 VGA 80x30 (480 scans, 16-point font)
|
119 |
|
|
0x0f06 VGA 80x34 (480 scans, 14-point font)
|
120 |
|
|
0x0f07 VGA 80x60 (480 scans, 8-point font)
|
121 |
|
|
|
122 |
|
|
0x1000 to 0x7fff - modes specified by resolution. The code has a "0xRRCC"
|
123 |
|
|
form where RR is a number of rows and CC is a number of columns.
|
124 |
|
|
E.g., 0x1950 corresponds to a 80x25 mode, 0x2b84 to 132x43 etc.
|
125 |
|
|
This is the only fully portable way to refer to a non-standard mode.
|
126 |
|
|
|
127 |
|
|
0xff00 to 0xffff - aliases for backward compatibility:
|
128 |
|
|
0xffff equivalent to 0x0f00 (standard 80x25)
|
129 |
|
|
0xfffe equivalent to 0x0f01 (EGA 80x43 or VGA 80x50)
|
130 |
|
|
|
131 |
|
|
If you add 0x8000 to the mode ID, the program will try to recalculate
|
132 |
|
|
vertical display timing according to mode parameters, which can be used to
|
133 |
|
|
eliminate some annoying bugs of certain VGA BIOS'es -- mainly extra lines at
|
134 |
|
|
the end of the display.
|
135 |
|
|
|
136 |
|
|
4. Options
|
137 |
|
|
~~~~~~~~~~
|
138 |
|
|
Some options can be set in the source text (in arch/i386/boot/video.S).
|
139 |
|
|
All of them are simple #define's -- change them to #undef's when you want to
|
140 |
|
|
switch them off. Currently supported:
|
141 |
|
|
|
142 |
|
|
CONFIG_VIDEO_SVGA - enables autodetection of SVGA cards. If your card is
|
143 |
|
|
detected incorrectly, you can switch this off.
|
144 |
|
|
|
145 |
|
|
CONFIG_VIDEO_VESA - enables autodetection of VESA modes. If it doesn't work
|
146 |
|
|
on your machine (or displays a "Error: Scanning of VESA modes failed" message),
|
147 |
|
|
you can switch it off and report as a bug.
|
148 |
|
|
|
149 |
|
|
CONFIG_VIDEO_COMPACT - enables compacting of the video mode list. Duplicate
|
150 |
|
|
entries (those with the same screen size) are deleted except for the first one
|
151 |
|
|
(see the previous section for more information on mode ordering). However,
|
152 |
|
|
it's possible that the first variant doesn't work, while some of the others do
|
153 |
|
|
-- in this case turn this switch off to see the rest.
|
154 |
|
|
|
155 |
|
|
CONFIG_VIDEO_RETAIN - enables retaining of screen contents when switching
|
156 |
|
|
video modes. Works only with some boot loaders which leave enough room for the
|
157 |
|
|
buffer.
|
158 |
|
|
|
159 |
|
|
CONFIG_VIDEO_LOCAL - enables inclusion of "local modes" in the list. The
|
160 |
|
|
local modes are added automatically to the beginning of the list not depending
|
161 |
|
|
by hardware configuration. The local modes are listed in the source text after
|
162 |
|
|
the "local_mode_table:" line. The comment before this line describes the format
|
163 |
|
|
of the table (which also includes a video card name to be displayed on the
|
164 |
|
|
top of the menu).
|
165 |
|
|
|
166 |
|
|
5. Adding more cards
|
167 |
|
|
~~~~~~~~~~~~~~~~~~~~
|
168 |
|
|
If you have a card not detected by the driver and you are a good programmer,
|
169 |
|
|
feel free to add it to the source and send me a diff. It's very simple: You
|
170 |
|
|
have to add a new entry to the svga_table consisting of a pointer to your mode
|
171 |
|
|
table and a pointer to your detection routine. The order of entries in the
|
172 |
|
|
svga_table defines the order of probing. Please use only reliable detection
|
173 |
|
|
routines which are known to identify _only_ the card in question.
|
174 |
|
|
|
175 |
|
|
The detection routine is called with BP pointing to your mode table and
|
176 |
|
|
ES containing 0xc000. If you want, you may alter BP allowing to select an
|
177 |
|
|
appropriate mode table according to model ID detected. If the detection fails,
|
178 |
|
|
return BP=0.
|
179 |
|
|
|
180 |
|
|
The mode table consists of lines containing a (BIOS mode number, rows,
|
181 |
|
|
columns) triple and is finished by single zero byte followed by NUL-terminated
|
182 |
|
|
adapter name.
|
183 |
|
|
|
184 |
|
|
6. Still doesn't work?
|
185 |
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
186 |
|
|
When the mode detection doesn't work (e.g., the mode list is incorrect or
|
187 |
|
|
the machine hangs instead of displaying the menu), try to switch off some of
|
188 |
|
|
the configuration options listed in section 4. If it fails, you can still use
|
189 |
|
|
your kernel with the video mode set directly via the kernel parameter.
|
190 |
|
|
|
191 |
|
|
In either case, please send me a bug report containing what _exactly_
|
192 |
|
|
happens and how do the configuration switches affect the behaviour of the bug.
|
193 |
|
|
|
194 |
|
|
If you start Linux from the M$-DOS, you might also use some DOS tools for
|
195 |
|
|
video mode setting. In this case, you must specify the 0x0f04 mode ("leave
|
196 |
|
|
current settings") to Linux, because if you use anything other, the 80x25
|
197 |
|
|
mode will be used automatically.
|
198 |
|
|
|
199 |
|
|
If you set some SVGA mode and there's one or more extra lines on the
|
200 |
|
|
bottom of the display containing already scrolled-out lines, your VGA BIOS
|
201 |
|
|
contains the most common video BIOS bug called "incorrect vertical display
|
202 |
|
|
end setting". Adding 0x8000 to the mode ID might fix the problem. Unfortunately,
|
203 |
|
|
this must be done manually -- no autodetection mechanisms are available.
|
204 |
|
|
|
205 |
|
|
7. History
|
206 |
|
|
~~~~~~~~~~
|
207 |
|
|
1.0 (??-Nov-95) First version supporting all adapters supported by the old
|
208 |
|
|
setup.S + Cirrus Logic 54XX. Present in some 1.3.4? kernels
|
209 |
|
|
and then removed due to instability on some machines.
|
210 |
|
|
2.0 (28-Jan-96) Rewritten from scratch. Cirrus Logic 64XX support added, almost
|
211 |
|
|
everything is configurable, the VESA support should be much more
|
212 |
|
|
stable, explicit mode numbering allowed, "scan" implemented etc.
|
213 |
|
|
2.1 (30-Jan-96) VESA modes moved to 0x200-0x3ff. Mode selection by resolution
|
214 |
|
|
supported. Few bugs fixed. VESA modes are listed prior to
|
215 |
|
|
modes supplied by SVGA autodetection as they are more reliable.
|
216 |
|
|
CLGD autodetect works better. Doesn't depend on 80x25 being
|
217 |
|
|
active when started. Scanning fixed. 80x43 (any VGA) added.
|
218 |
|
|
Code cleaned up.
|
219 |
|
|
2.2 (01-Feb-96) EGA 80x43 fixed. VESA extended to 0x200-0x4ff (non-standard 02XX
|
220 |
|
|
VESA modes work now). Display end bug workaround supported.
|
221 |
|
|
Special modes renumbered to allow adding of the "recalculate"
|
222 |
|
|
flag, 0xffff and 0xfffe became aliases instead of real ID's.
|
223 |
|
|
Screen contents retained during mode changes.
|
224 |
|
|
2.3 (15-Mar-96) Changed to work with 1.3.74 kernel.
|
225 |
|
|
2.4 (18-Mar-96) Added patches by Hans Lermen fixing a memory overwrite problem
|
226 |
|
|
with some boot loaders. Memory management rewritten to reflect
|
227 |
|
|
these changes. Unfortunately, screen contents retaining works
|
228 |
|
|
only with some loaders now.
|
229 |
|
|
Added a Tseng 132x60 mode.
|
230 |
|
|
2.5 (19-Mar-96) Fixed a VESA mode scanning bug introduced in 2.4.
|
231 |
|
|
2.6 (25-Mar-96) Some VESA BIOS errors not reported -- it fixes error reports on
|
232 |
|
|
several cards with broken VESA code (e.g., ATI VGA).
|
233 |
|
|
2.7 (09-Apr-96) - Accepted all VESA modes in range 0x100 to 0x7ff, because some
|
234 |
|
|
cards use very strange mode numbers.
|
235 |
|
|
- Added Realtek VGA modes (thanks to Gonzalo Tornaria).
|
236 |
|
|
- Hardware testing order slightly changed, tests based on ROM
|
237 |
|
|
contents done as first.
|
238 |
|
|
- Added support for special Video7 mode switching functions
|
239 |
|
|
(thanks to Tom Vander Aa).
|
240 |
|
|
- Added 480-scanline modes (especially useful for notebooks,
|
241 |
|
|
original version written by hhanemaa@cs.ruu.nl, patched by
|
242 |
|
|
Jeff Chua, rewritten by me).
|
243 |
|
|
- Screen store/restore fixed.
|
244 |
|
|
2.8 (14-Apr-96) - Previous release was not compilable without CONFIG_VIDEO_SVGA.
|
245 |
|
|
- Better recognition of text modes during mode scan.
|
246 |
|
|
2.9 (12-May-96) - Ignored VESA modes 0x80 - 0xff (more VESA BIOS bugs!)
|