^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) ===============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) What is vesafb?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ===============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) This is a generic driver for a graphic framebuffer on intel boxes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) The idea is simple: Turn on graphics mode at boot time with the help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) of the BIOS, and use this as framebuffer device /dev/fb0, like the m68k
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) (and other) ports do.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) This means we decide at boot time whenever we want to run in text or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) graphics mode. Switching mode later on (in protected mode) is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) impossible; BIOS calls work in real mode only. VESA BIOS Extensions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) Version 2.0 are required, because we need a linear frame buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) Advantages:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * It provides a nice large console (128 cols + 48 lines with 1024x768)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) without using tiny, unreadable fonts.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * You can run XF68_FBDev on top of /dev/fb0 (=> non-accelerated X11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) support for every VBE 2.0 compliant graphics board).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * Most important: boot logo :-)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) Disadvantages:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * graphic mode is slower than text mode...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) How to use it?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) ==============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) Switching modes is done using the vga=... boot parameter. Read
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) Documentation/admin-guide/svga.rst for details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) You should compile in both vgacon (for text mode) and vesafb (for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) graphics mode). Which of them takes over the console depends on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) whenever the specified mode is text or graphics.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) The graphic modes are NOT in the list which you get if you boot with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) vga=ask and hit return. The mode you wish to use is derived from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) VESA mode number. Here are those VESA mode numbers:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) ====== ======= ======= ======== =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) colors 640x480 800x600 1024x768 1280x1024
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) ====== ======= ======= ======== =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 256 0x101 0x103 0x105 0x107
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 32k 0x110 0x113 0x116 0x119
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 64k 0x111 0x114 0x117 0x11A
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 16M 0x112 0x115 0x118 0x11B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) ====== ======= ======= ======== =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) The video mode number of the Linux kernel is the VESA mode number plus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 0x200:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) Linux_kernel_mode_number = VESA_mode_number + 0x200
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) So the table for the Kernel mode numbers are:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) ====== ======= ======= ======== =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) colors 640x480 800x600 1024x768 1280x1024
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) ====== ======= ======= ======== =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 256 0x301 0x303 0x305 0x307
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 32k 0x310 0x313 0x316 0x319
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 64k 0x311 0x314 0x317 0x31A
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) 16M 0x312 0x315 0x318 0x31B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) ====== ======= ======= ======== =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) To enable one of those modes you have to specify "vga=ask" in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) lilo.conf file and rerun LILO. Then you can type in the desired
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) mode at the "vga=ask" prompt. For example if you like to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) 1024x768x256 colors you have to say "305" at this prompt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) If this does not work, this might be because your BIOS does not support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) linear framebuffers or because it does not support this mode at all.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) Even if your board does, it might be the BIOS which does not. VESA BIOS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) Extensions v2.0 are required, 1.2 is NOT sufficient. You will get a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) "bad mode number" message if something goes wrong.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) 1. Note: LILO cannot handle hex, for booting directly with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) "vga=mode-number" you have to transform the numbers to decimal.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) 2. Note: Some newer versions of LILO appear to work with those hex values,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) if you set the 0x in front of the numbers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) X11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) ===
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) XF68_FBDev should work just fine, but it is non-accelerated. Running
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) another (accelerated) X-Server like XF86_SVGA might or might not work.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) It depends on X-Server and graphics board.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) The X-Server must restore the video mode correctly, else you end up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) with a broken console (and vesafb cannot do anything about this).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) Refresh rates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) =============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) There is no way to change the vesafb video mode and/or timings after
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) booting linux. If you are not happy with the 60 Hz refresh rate, you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) have these options:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) * configure and load the DOS-Tools for the graphics board (if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) available) and boot linux with loadlin.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) * use a native driver (matroxfb/atyfb) instead if vesafb. If none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) is available, write a new one!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) * VBE 3.0 might work too. I have neither a gfx board with VBE 3.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) support nor the specs, so I have not checked this yet.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) Configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) =============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) The VESA BIOS provides protected mode interface for changing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) some parameters. vesafb can use it for palette changes and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) to pan the display. It is turned off by default because it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) seems not to work with some BIOS versions, but there are options
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) to turn it on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) You can pass options to vesafb using "video=vesafb:option" on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) the kernel command line. Multiple options should be separated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) by comma, like this: "video=vesafb:ypan,inverse"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) Accepted options:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) inverse use inverse color map
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) ========= ======================================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) ypan enable display panning using the VESA protected mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) interface. The visible screen is just a window of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) video memory, console scrolling is done by changing the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) start of the window.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) pro:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) * scrolling (fullscreen) is fast, because there is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) no need to copy around data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) kontra:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) * scrolling only parts of the screen causes some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) ugly flicker effects (boot logo flickers for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) example).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) ywrap Same as ypan, but assumes your gfx board can wrap-around
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) the video memory (i.e. starts reading from top if it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) reaches the end of video memory). Faster than ypan.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) redraw Scroll by redrawing the affected part of the screen, this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) is the safe (and slow) default.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) vgapal Use the standard vga registers for palette changes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) This is the default.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) pmipal Use the protected mode interface for palette changes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) mtrr:n Setup memory type range registers for the vesafb framebuffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) where n:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) - 0 - disabled (equivalent to nomtrr) (default)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) - 1 - uncachable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) - 2 - write-back
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) - 3 - write-combining
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) - 4 - write-through
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) If you see the following in dmesg, choose the type that matches the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) old one. In this example, use "mtrr:2".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) mtrr: type mismatch for e0000000,8000000 old: write-back new:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) write-combining
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) ...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) nomtrr disable mtrr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) vremap:n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) Remap 'n' MiB of video RAM. If 0 or not specified, remap memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) according to video mode. (2.5.66 patch/idea by Antonino Daplas
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) reversed to give override possibility (allocate more fb memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) than the kernel would) to 2.4 by tmb@iki.fi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) vtotal:n If the video BIOS of your card incorrectly determines the total
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) amount of video RAM, use this option to override the BIOS (in MiB).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) ========= ======================================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) Have fun!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) Gerd Knorr <kraxel@goldbach.in-berlin.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) Minor (mostly typo) changes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) by Nico Schmoigl <schmoigl@rumms.uni-mannheim.de>