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