blob: 119f1515b1acbe693386bf816af524436fa27358 [file] [log] [blame]
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -03001.. include:: <isonum.txt>
Linus Torvalds1da177e2005-04-16 15:20:36 -07002
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -03003=================================
4Video Mode Selection Support 2.13
5=================================
6
7:Copyright: |copy| 1995--1999 Martin Mares, <mj@ucw.cz>
8
9Intro
10~~~~~
11
12This small document describes the "Video Mode Selection" feature which
Linus Torvalds1da177e2005-04-16 15:20:36 -070013allows the use of various special video modes supported by the video BIOS. Due
14to usage of the BIOS, the selection is limited to boot time (before the
15kernel decompression starts) and works only on 80X86 machines.
16
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -030017.. note::
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -030019 Short intro for the impatient: Just use vga=ask for the first time,
20 enter ``scan`` on the video mode prompt, pick the mode you want to use,
21 remember its mode ID (the four-digit hexadecimal number) and then
22 set the vga parameter to this number (converted to decimal first).
23
24The video mode to be used is selected by a kernel parameter which can be
Linus Torvalds1da177e2005-04-16 15:20:36 -070025specified in the kernel Makefile (the SVGA_MODE=... line) or by the "vga=..."
26option of LILO (or some other boot loader you use) or by the "vidmode" utility
27(present in standard Linux utility packages). You can use the following values
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -030028of this parameter::
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
30 NORMAL_VGA - Standard 80x25 mode available on all display adapters.
31
32 EXTENDED_VGA - Standard 8-pixel font mode: 80x43 on EGA, 80x50 on VGA.
33
34 ASK_VGA - Display a video mode menu upon startup (see below).
35
36 0..35 - Menu item number (when you have used the menu to view the list of
37 modes available on your adapter, you can specify the menu item you want
38 to use). 0..9 correspond to "0".."9", 10..35 to "a".."z". Warning: the
39 mode list displayed may vary as the kernel version changes, because the
40 modes are listed in a "first detected -- first displayed" manner. It's
41 better to use absolute mode numbers instead.
42
43 0x.... - Hexadecimal video mode ID (also displayed on the menu, see below
44 for exact meaning of the ID). Warning: rdev and LILO don't support
45 hexadecimal numbers -- you have to convert it to decimal manually.
46
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -030047Menu
48~~~~
49
50The ASK_VGA mode causes the kernel to offer a video mode menu upon
Linus Torvalds1da177e2005-04-16 15:20:36 -070051bootup. It displays a "Press <RETURN> to see video modes available, <SPACE>
52to continue or wait 30 secs" message. If you press <RETURN>, you enter the
53menu, if you press <SPACE> or wait 30 seconds, the kernel will boot up in
54the standard 80x25 mode.
55
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -030056The menu looks like::
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -030058 Video adapter: <name-of-detected-video-adapter>
59 Mode: COLSxROWS:
60 0 0F00 80x25
61 1 0F01 80x50
62 2 0F02 80x43
63 3 0F03 80x26
64 ....
65 Enter mode number or ``scan``: <flashing-cursor-here>
Linus Torvalds1da177e2005-04-16 15:20:36 -070066
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -030067<name-of-detected-video-adapter> tells what video adapter did Linux detect
Linus Torvalds1da177e2005-04-16 15:20:36 -070068-- it's either a generic adapter name (MDA, CGA, HGC, EGA, VGA, VESA VGA [a VGA
69with VESA-compliant BIOS]) or a chipset name (e.g., Trident). Direct detection
70of chipsets is turned off by default (see CONFIG_VIDEO_SVGA in chapter 4 to see
71how to enable it if you really want) as it's inherently unreliable due to
72absolutely insane PC design.
73
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -030074"0 0F00 80x25" means that the first menu item (the menu items are numbered
Linus Torvalds1da177e2005-04-16 15:20:36 -070075from "0" to "9" and from "a" to "z") is a 80x25 mode with ID=0x0f00 (see the
76next section for a description of mode IDs).
77
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -030078<flashing-cursor-here> encourages you to enter the item number or mode ID
Linus Torvalds1da177e2005-04-16 15:20:36 -070079you wish to set and press <RETURN>. If the computer complains something about
80"Unknown mode ID", it is trying to tell you that it isn't possible to set such
81a mode. It's also possible to press only <RETURN> which leaves the current mode.
82
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -030083The mode list usually contains a few basic modes and some VESA modes. In
Linus Torvalds1da177e2005-04-16 15:20:36 -070084case your chipset has been detected, some chipset-specific modes are shown as
85well (some of these might be missing or unusable on your machine as different
86BIOSes are often shipped with the same card and the mode numbers depend purely
87on the VGA BIOS).
88
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -030089The modes displayed on the menu are partially sorted: The list starts with
Linus Torvalds1da177e2005-04-16 15:20:36 -070090the standard modes (80x25 and 80x50) followed by "special" modes (80x28 and
9180x43), local modes (if the local modes feature is enabled), VESA modes and
92finally SVGA modes for the auto-detected adapter.
93
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -030094If you are not happy with the mode list offered (e.g., if you think your card
Linus Torvalds1da177e2005-04-16 15:20:36 -070095is able to do more), you can enter "scan" instead of item number / mode ID. The
96program will try to ask the BIOS for all possible video mode numbers and test
97what happens then. The screen will be probably flashing wildly for some time and
98strange noises will be heard from inside the monitor and so on and then, really
99all consistent video modes supported by your BIOS will appear (plus maybe some
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300100``ghost modes``). If you are afraid this could damage your monitor, don't use
101this function.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300103After scanning, the mode ordering is a bit different: the auto-detected SVGA
104modes are not listed at all and the modes revealed by ``scan`` are shown before
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105all VESA modes.
106
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300107Mode IDs
108~~~~~~~~
109
110Because of the complexity of all the video stuff, the video mode IDs
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111used here are also a bit complex. A video mode ID is a 16-bit number usually
112expressed in a hexadecimal notation (starting with "0x"). You can set a mode
113by entering its mode directly if you know it even if it isn't shown on the menu.
114
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300115The ID numbers can be divided to those regions::
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116
117 0x0000 to 0x00ff - menu item references. 0x0000 is the first item. Don't use
118 outside the menu as this can change from boot to boot (especially if you
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300119 have used the ``scan`` feature).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120
121 0x0100 to 0x017f - standard BIOS modes. The ID is a BIOS video mode number
122 (as presented to INT 10, function 00) increased by 0x0100.
123
124 0x0200 to 0x08ff - VESA BIOS modes. The ID is a VESA mode ID increased by
125 0x0100. All VESA modes should be autodetected and shown on the menu.
126
127 0x0900 to 0x09ff - Video7 special modes. Set by calling INT 0x10, AX=0x6f05.
128 (Usually 940=80x43, 941=132x25, 942=132x44, 943=80x60, 944=100x60,
129 945=132x28 for the standard Video7 BIOS)
130
131 0x0f00 to 0x0fff - special modes (they are set by various tricks -- usually
132 by modifying one of the standard modes). Currently available:
133 0x0f00 standard 80x25, don't reset mode if already set (=FFFF)
134 0x0f01 standard with 8-point font: 80x43 on EGA, 80x50 on VGA
135 0x0f02 VGA 80x43 (VGA switched to 350 scanlines with a 8-point font)
136 0x0f03 VGA 80x28 (standard VGA scans, but 14-point font)
137 0x0f04 leave current video mode
138 0x0f05 VGA 80x30 (480 scans, 16-point font)
139 0x0f06 VGA 80x34 (480 scans, 14-point font)
140 0x0f07 VGA 80x60 (480 scans, 8-point font)
141 0x0f08 Graphics hack (see the CONFIG_VIDEO_HACK paragraph below)
142
143 0x1000 to 0x7fff - modes specified by resolution. The code has a "0xRRCC"
144 form where RR is a number of rows and CC is a number of columns.
145 E.g., 0x1950 corresponds to a 80x25 mode, 0x2b84 to 132x43 etc.
146 This is the only fully portable way to refer to a non-standard mode,
147 but it relies on the mode being found and displayed on the menu
148 (remember that mode scanning is not done automatically).
149
150 0xff00 to 0xffff - aliases for backward compatibility:
151 0xffff equivalent to 0x0f00 (standard 80x25)
152 0xfffe equivalent to 0x0f01 (EGA 80x43 or VGA 80x50)
153
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300154If you add 0x8000 to the mode ID, the program will try to recalculate
Linus Torvalds1da177e2005-04-16 15:20:36 -0700155vertical display timing according to mode parameters, which can be used to
156eliminate some annoying bugs of certain VGA BIOSes (usually those used for
157cards with S3 chipsets and old Cirrus Logic BIOSes) -- mainly extra lines at the
158end of the display.
159
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300160Options
161~~~~~~~
162
163Some options can be set in the source text (in arch/i386/boot/video.S).
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164All of them are simple #define's -- change them to #undef's when you want to
165switch them off. Currently supported:
166
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300167CONFIG_VIDEO_SVGA - enables autodetection of SVGA cards. This is switched
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168off by default as it's a bit unreliable due to terribly bad PC design. If you
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300169really want to have the adapter autodetected (maybe in case the ``scan`` feature
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170doesn't work on your machine), switch this on and don't cry if the results
171are not completely sane. In case you really need this feature, please drop me
172a mail as I think of removing it some day.
173
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300174CONFIG_VIDEO_VESA - enables autodetection of VESA modes. If it doesn't work
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175on your machine (or displays a "Error: Scanning of VESA modes failed" message),
176you can switch it off and report as a bug.
177
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300178CONFIG_VIDEO_COMPACT - enables compacting of the video mode list. If there
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179are more modes with the same screen size, only the first one is kept (see above
180for more info on mode ordering). However, in very strange cases it's possible
181that the first "version" of the mode doesn't work although some of the others
182do -- in this case turn this switch off to see the rest.
183
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300184CONFIG_VIDEO_RETAIN - enables retaining of screen contents when switching
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185video modes. Works only with some boot loaders which leave enough room for the
186buffer. (If you have old LILO, you can adjust heap_end_ptr and loadflags
187in setup.S, but it's better to upgrade the boot loader...)
188
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300189CONFIG_VIDEO_LOCAL - enables inclusion of "local modes" in the list. The
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190local modes are added automatically to the beginning of the list not depending
191on hardware configuration. The local modes are listed in the source text after
192the "local_mode_table:" line. The comment before this line describes the format
193of the table (which also includes a video card name to be displayed on the
194top of the menu).
195
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300196CONFIG_VIDEO_400_HACK - force setting of 400 scan lines for standard VGA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197modes. This option is intended to be used on certain buggy BIOSes which draw
198some useless logo using font download and then fail to reset the correct mode.
199Don't use unless needed as it forces resetting the video card.
200
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300201CONFIG_VIDEO_GFX_HACK - includes special hack for setting of graphics modes
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202to be used later by special drivers (e.g., 800x600 on IBM ThinkPad -- see
203ftp://ftp.phys.keio.ac.jp/pub/XFree86/800x600/XF86Configs/XF86Config.IBM_TP560).
204Allows to set _any_ BIOS mode including graphic ones and forcing specific
205text screen resolution instead of peeking it from BIOS variables. Don't use
206unless you think you know what you're doing. To activate this setup, use
207mode number 0x0f08 (see section 3).
208
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300209Still doesn't work?
210~~~~~~~~~~~~~~~~~~~
211
212When the mode detection doesn't work (e.g., the mode list is incorrect or
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213the machine hangs instead of displaying the menu), try to switch off some of
214the configuration options listed in section 4. If it fails, you can still use
215your kernel with the video mode set directly via the kernel parameter.
216
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300217In either case, please send me a bug report containing what _exactly_
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218happens and how do the configuration switches affect the behaviour of the bug.
219
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300220If you start Linux from M$-DOS, you might also use some DOS tools for
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221video mode setting. In this case, you must specify the 0x0f04 mode ("leave
222current settings") to Linux, because if you don't and you use any non-standard
223mode, Linux will switch to 80x25 automatically.
224
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300225If you set some extended mode and there's one or more extra lines on the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226bottom of the display containing already scrolled-out text, your VGA BIOS
227contains the most common video BIOS bug called "incorrect vertical display
228end setting". Adding 0x8000 to the mode ID might fix the problem. Unfortunately,
229this must be done manually -- no autodetection mechanisms are available.
230
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300231If you have a VGA card and your display still looks as on EGA, your BIOS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232is probably broken and you need to set the CONFIG_VIDEO_400_HACK switch to
233force setting of the correct mode.
234
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -0300235History
236~~~~~~~
237
238=============== ================================================================
Linus Torvalds1da177e2005-04-16 15:20:36 -07002391.0 (??-Nov-95) First version supporting all adapters supported by the old
240 setup.S + Cirrus Logic 54XX. Present in some 1.3.4? kernels
241 and then removed due to instability on some machines.
2422.0 (28-Jan-96) Rewritten from scratch. Cirrus Logic 64XX support added, almost
243 everything is configurable, the VESA support should be much more
244 stable, explicit mode numbering allowed, "scan" implemented etc.
2452.1 (30-Jan-96) VESA modes moved to 0x200-0x3ff. Mode selection by resolution
246 supported. Few bugs fixed. VESA modes are listed prior to
247 modes supplied by SVGA autodetection as they are more reliable.
248 CLGD autodetect works better. Doesn't depend on 80x25 being
249 active when started. Scanning fixed. 80x43 (any VGA) added.
250 Code cleaned up.
2512.2 (01-Feb-96) EGA 80x43 fixed. VESA extended to 0x200-0x4ff (non-standard 02XX
252 VESA modes work now). Display end bug workaround supported.
253 Special modes renumbered to allow adding of the "recalculate"
254 flag, 0xffff and 0xfffe became aliases instead of real IDs.
255 Screen contents retained during mode changes.
2562.3 (15-Mar-96) Changed to work with 1.3.74 kernel.
2572.4 (18-Mar-96) Added patches by Hans Lermen fixing a memory overwrite problem
258 with some boot loaders. Memory management rewritten to reflect
259 these changes. Unfortunately, screen contents retaining works
260 only with some loaders now.
261 Added a Tseng 132x60 mode.
2622.5 (19-Mar-96) Fixed a VESA mode scanning bug introduced in 2.4.
2632.6 (25-Mar-96) Some VESA BIOS errors not reported -- it fixes error reports on
264 several cards with broken VESA code (e.g., ATI VGA).
2652.7 (09-Apr-96) - Accepted all VESA modes in range 0x100 to 0x7ff, because some
266 cards use very strange mode numbers.
267 - Added Realtek VGA modes (thanks to Gonzalo Tornaria).
268 - Hardware testing order slightly changed, tests based on ROM
269 contents done as first.
270 - Added support for special Video7 mode switching functions
271 (thanks to Tom Vander Aa).
272 - Added 480-scanline modes (especially useful for notebooks,
273 original version written by hhanemaa@cs.ruu.nl, patched by
274 Jeff Chua, rewritten by me).
275 - Screen store/restore fixed.
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -03002762.8 (14-Apr-96) - Previous release was not compilable without CONFIG_VIDEO_SVGA.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277 - Better recognition of text modes during mode scan.
2782.9 (12-May-96) - Ignored VESA modes 0x80 - 0xff (more VESA BIOS bugs!)
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -03002792.10(11-Nov-96) - The whole thing made optional.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280 - Added the CONFIG_VIDEO_400_HACK switch.
281 - Added the CONFIG_VIDEO_GFX_HACK switch.
282 - Code cleanup.
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -03002832.11(03-May-97) - Yet another cleanup, now including also the documentation.
284 - Direct testing of SVGA adapters turned off by default, ``scan``
Linus Torvalds1da177e2005-04-16 15:20:36 -0700285 offered explicitly on the prompt line.
286 - Removed the doc section describing adding of new probing
287 functions as I try to get rid of _all_ hardware probing here.
Mauro Carvalho Chehabaa4d5202017-05-17 09:00:17 -03002882.12(25-May-98) Added support for VESA frame buffer graphics.
2892.13(14-May-99) Minor documentation fixes.
290=============== ================================================================