Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 1 | .. include:: <isonum.txt> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 3 | ================================= |
| 4 | Video Mode Selection Support 2.13 |
| 5 | ================================= |
| 6 | |
| 7 | :Copyright: |copy| 1995--1999 Martin Mares, <mj@ucw.cz> |
| 8 | |
| 9 | Intro |
| 10 | ~~~~~ |
| 11 | |
| 12 | This small document describes the "Video Mode Selection" feature which |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | allows the use of various special video modes supported by the video BIOS. Due |
| 14 | to usage of the BIOS, the selection is limited to boot time (before the |
Randy Dunlap | fc67d5b | 2020-09-17 18:56:39 -0700 | [diff] [blame] | 15 | kernel decompression starts) and works only on 80X86 machines that are |
| 16 | booted through BIOS firmware (as opposed to through UEFI, kexec, etc.). |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 18 | .. note:: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 20 | Short intro for the impatient: Just use vga=ask for the first time, |
| 21 | enter ``scan`` on the video mode prompt, pick the mode you want to use, |
| 22 | remember its mode ID (the four-digit hexadecimal number) and then |
| 23 | set the vga parameter to this number (converted to decimal first). |
| 24 | |
| 25 | The video mode to be used is selected by a kernel parameter which can be |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | specified in the kernel Makefile (the SVGA_MODE=... line) or by the "vga=..." |
Randy Dunlap | fc67d5b | 2020-09-17 18:56:39 -0700 | [diff] [blame] | 27 | option of LILO (or some other boot loader you use) or by the "xrandr" utility |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | (present in standard Linux utility packages). You can use the following values |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 29 | of this parameter:: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | |
| 31 | NORMAL_VGA - Standard 80x25 mode available on all display adapters. |
| 32 | |
| 33 | EXTENDED_VGA - Standard 8-pixel font mode: 80x43 on EGA, 80x50 on VGA. |
| 34 | |
| 35 | ASK_VGA - Display a video mode menu upon startup (see below). |
| 36 | |
| 37 | 0..35 - Menu item number (when you have used the menu to view the list of |
| 38 | modes available on your adapter, you can specify the menu item you want |
| 39 | to use). 0..9 correspond to "0".."9", 10..35 to "a".."z". Warning: the |
| 40 | mode list displayed may vary as the kernel version changes, because the |
| 41 | modes are listed in a "first detected -- first displayed" manner. It's |
| 42 | better to use absolute mode numbers instead. |
| 43 | |
| 44 | 0x.... - Hexadecimal video mode ID (also displayed on the menu, see below |
Randy Dunlap | fc67d5b | 2020-09-17 18:56:39 -0700 | [diff] [blame] | 45 | for exact meaning of the ID). Warning: LILO doesn't support |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | hexadecimal numbers -- you have to convert it to decimal manually. |
| 47 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 48 | Menu |
| 49 | ~~~~ |
| 50 | |
| 51 | The ASK_VGA mode causes the kernel to offer a video mode menu upon |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | bootup. It displays a "Press <RETURN> to see video modes available, <SPACE> |
| 53 | to continue or wait 30 secs" message. If you press <RETURN>, you enter the |
| 54 | menu, if you press <SPACE> or wait 30 seconds, the kernel will boot up in |
| 55 | the standard 80x25 mode. |
| 56 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 57 | The menu looks like:: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 59 | Video adapter: <name-of-detected-video-adapter> |
| 60 | Mode: COLSxROWS: |
| 61 | 0 0F00 80x25 |
| 62 | 1 0F01 80x50 |
| 63 | 2 0F02 80x43 |
| 64 | 3 0F03 80x26 |
| 65 | .... |
| 66 | Enter mode number or ``scan``: <flashing-cursor-here> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 68 | <name-of-detected-video-adapter> tells what video adapter did Linux detect |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | -- it's either a generic adapter name (MDA, CGA, HGC, EGA, VGA, VESA VGA [a VGA |
| 70 | with VESA-compliant BIOS]) or a chipset name (e.g., Trident). Direct detection |
Randy Dunlap | 0cf9bb6 | 2017-11-19 10:02:20 -0800 | [diff] [blame] | 71 | of chipsets is turned off by default as it's inherently unreliable due to |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | absolutely insane PC design. |
| 73 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 74 | "0 0F00 80x25" means that the first menu item (the menu items are numbered |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | from "0" to "9" and from "a" to "z") is a 80x25 mode with ID=0x0f00 (see the |
| 76 | next section for a description of mode IDs). |
| 77 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 78 | <flashing-cursor-here> encourages you to enter the item number or mode ID |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | you 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 |
| 81 | a mode. It's also possible to press only <RETURN> which leaves the current mode. |
| 82 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 83 | The mode list usually contains a few basic modes and some VESA modes. In |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | case your chipset has been detected, some chipset-specific modes are shown as |
| 85 | well (some of these might be missing or unusable on your machine as different |
| 86 | BIOSes are often shipped with the same card and the mode numbers depend purely |
| 87 | on the VGA BIOS). |
| 88 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 89 | The modes displayed on the menu are partially sorted: The list starts with |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | the standard modes (80x25 and 80x50) followed by "special" modes (80x28 and |
| 91 | 80x43), local modes (if the local modes feature is enabled), VESA modes and |
| 92 | finally SVGA modes for the auto-detected adapter. |
| 93 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 94 | If you are not happy with the mode list offered (e.g., if you think your card |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | is able to do more), you can enter "scan" instead of item number / mode ID. The |
| 96 | program will try to ask the BIOS for all possible video mode numbers and test |
| 97 | what happens then. The screen will be probably flashing wildly for some time and |
| 98 | strange noises will be heard from inside the monitor and so on and then, really |
| 99 | all consistent video modes supported by your BIOS will appear (plus maybe some |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 100 | ``ghost modes``). If you are afraid this could damage your monitor, don't use |
| 101 | this function. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 103 | After scanning, the mode ordering is a bit different: the auto-detected SVGA |
| 104 | modes are not listed at all and the modes revealed by ``scan`` are shown before |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 105 | all VESA modes. |
| 106 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 107 | Mode IDs |
| 108 | ~~~~~~~~ |
| 109 | |
| 110 | Because of the complexity of all the video stuff, the video mode IDs |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | used here are also a bit complex. A video mode ID is a 16-bit number usually |
| 112 | expressed in a hexadecimal notation (starting with "0x"). You can set a mode |
| 113 | by entering its mode directly if you know it even if it isn't shown on the menu. |
| 114 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 115 | The ID numbers can be divided to those regions:: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | |
| 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 Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 119 | have used the ``scan`` feature). |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | |
| 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) |
Randy Dunlap | 0cf9bb6 | 2017-11-19 10:02:20 -0800 | [diff] [blame] | 141 | 0x0f08 Graphics hack (see the VIDEO_GFX_HACK paragraph below) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 154 | If you add 0x8000 to the mode ID, the program will try to recalculate |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 155 | vertical display timing according to mode parameters, which can be used to |
| 156 | eliminate some annoying bugs of certain VGA BIOSes (usually those used for |
| 157 | cards with S3 chipsets and old Cirrus Logic BIOSes) -- mainly extra lines at the |
| 158 | end of the display. |
| 159 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 160 | Options |
| 161 | ~~~~~~~ |
| 162 | |
Randy Dunlap | 0cf9bb6 | 2017-11-19 10:02:20 -0800 | [diff] [blame] | 163 | Build options for arch/x86/boot/* are selected by the kernel kconfig |
| 164 | utility and the kernel .config file. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | |
Randy Dunlap | 0cf9bb6 | 2017-11-19 10:02:20 -0800 | [diff] [blame] | 166 | VIDEO_GFX_HACK - includes special hack for setting of graphics modes |
| 167 | to be used later by special drivers. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | Allows to set _any_ BIOS mode including graphic ones and forcing specific |
| 169 | text screen resolution instead of peeking it from BIOS variables. Don't use |
| 170 | unless you think you know what you're doing. To activate this setup, use |
Randy Dunlap | 0cf9bb6 | 2017-11-19 10:02:20 -0800 | [diff] [blame] | 171 | mode number 0x0f08 (see the Mode IDs section above). |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 173 | Still doesn't work? |
| 174 | ~~~~~~~~~~~~~~~~~~~ |
| 175 | |
| 176 | When the mode detection doesn't work (e.g., the mode list is incorrect or |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | the machine hangs instead of displaying the menu), try to switch off some of |
Randy Dunlap | 0cf9bb6 | 2017-11-19 10:02:20 -0800 | [diff] [blame] | 178 | the configuration options listed under "Options". If it fails, you can still use |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 179 | your kernel with the video mode set directly via the kernel parameter. |
| 180 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 181 | In either case, please send me a bug report containing what _exactly_ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 182 | happens and how do the configuration switches affect the behaviour of the bug. |
| 183 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 184 | If you start Linux from M$-DOS, you might also use some DOS tools for |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | video mode setting. In this case, you must specify the 0x0f04 mode ("leave |
| 186 | current settings") to Linux, because if you don't and you use any non-standard |
| 187 | mode, Linux will switch to 80x25 automatically. |
| 188 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 189 | If you set some extended mode and there's one or more extra lines on the |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | bottom of the display containing already scrolled-out text, your VGA BIOS |
| 191 | contains the most common video BIOS bug called "incorrect vertical display |
| 192 | end setting". Adding 0x8000 to the mode ID might fix the problem. Unfortunately, |
| 193 | this must be done manually -- no autodetection mechanisms are available. |
| 194 | |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 195 | History |
| 196 | ~~~~~~~ |
| 197 | |
| 198 | =============== ================================================================ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 199 | 1.0 (??-Nov-95) First version supporting all adapters supported by the old |
| 200 | setup.S + Cirrus Logic 54XX. Present in some 1.3.4? kernels |
| 201 | and then removed due to instability on some machines. |
| 202 | 2.0 (28-Jan-96) Rewritten from scratch. Cirrus Logic 64XX support added, almost |
| 203 | everything is configurable, the VESA support should be much more |
| 204 | stable, explicit mode numbering allowed, "scan" implemented etc. |
| 205 | 2.1 (30-Jan-96) VESA modes moved to 0x200-0x3ff. Mode selection by resolution |
| 206 | supported. Few bugs fixed. VESA modes are listed prior to |
| 207 | modes supplied by SVGA autodetection as they are more reliable. |
| 208 | CLGD autodetect works better. Doesn't depend on 80x25 being |
| 209 | active when started. Scanning fixed. 80x43 (any VGA) added. |
| 210 | Code cleaned up. |
| 211 | 2.2 (01-Feb-96) EGA 80x43 fixed. VESA extended to 0x200-0x4ff (non-standard 02XX |
| 212 | VESA modes work now). Display end bug workaround supported. |
| 213 | Special modes renumbered to allow adding of the "recalculate" |
| 214 | flag, 0xffff and 0xfffe became aliases instead of real IDs. |
| 215 | Screen contents retained during mode changes. |
| 216 | 2.3 (15-Mar-96) Changed to work with 1.3.74 kernel. |
| 217 | 2.4 (18-Mar-96) Added patches by Hans Lermen fixing a memory overwrite problem |
| 218 | with some boot loaders. Memory management rewritten to reflect |
| 219 | these changes. Unfortunately, screen contents retaining works |
| 220 | only with some loaders now. |
| 221 | Added a Tseng 132x60 mode. |
| 222 | 2.5 (19-Mar-96) Fixed a VESA mode scanning bug introduced in 2.4. |
| 223 | 2.6 (25-Mar-96) Some VESA BIOS errors not reported -- it fixes error reports on |
| 224 | several cards with broken VESA code (e.g., ATI VGA). |
| 225 | 2.7 (09-Apr-96) - Accepted all VESA modes in range 0x100 to 0x7ff, because some |
| 226 | cards use very strange mode numbers. |
| 227 | - Added Realtek VGA modes (thanks to Gonzalo Tornaria). |
| 228 | - Hardware testing order slightly changed, tests based on ROM |
| 229 | contents done as first. |
| 230 | - Added support for special Video7 mode switching functions |
| 231 | (thanks to Tom Vander Aa). |
| 232 | - Added 480-scanline modes (especially useful for notebooks, |
| 233 | original version written by hhanemaa@cs.ruu.nl, patched by |
| 234 | Jeff Chua, rewritten by me). |
| 235 | - Screen store/restore fixed. |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 236 | 2.8 (14-Apr-96) - Previous release was not compilable without CONFIG_VIDEO_SVGA. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 237 | - Better recognition of text modes during mode scan. |
| 238 | 2.9 (12-May-96) - Ignored VESA modes 0x80 - 0xff (more VESA BIOS bugs!) |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 239 | 2.10(11-Nov-96) - The whole thing made optional. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | - Added the CONFIG_VIDEO_400_HACK switch. |
| 241 | - Added the CONFIG_VIDEO_GFX_HACK switch. |
| 242 | - Code cleanup. |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 243 | 2.11(03-May-97) - Yet another cleanup, now including also the documentation. |
| 244 | - Direct testing of SVGA adapters turned off by default, ``scan`` |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | offered explicitly on the prompt line. |
| 246 | - Removed the doc section describing adding of new probing |
| 247 | functions as I try to get rid of _all_ hardware probing here. |
Mauro Carvalho Chehab | aa4d520 | 2017-05-17 09:00:17 -0300 | [diff] [blame] | 248 | 2.12(25-May-98) Added support for VESA frame buffer graphics. |
| 249 | 2.13(14-May-99) Minor documentation fixes. |
| 250 | =============== ================================================================ |