svga.txt 12 KB

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