Vesafb is a framebuffer driver for Intel architecture that works with VESA 2.0 compliant graphic cards. It is closely related to the framebuffer device drivers in the kernel.
vesafb is a display driver that enables the use of graphical modes on your Intel platform for bitmapped text consoles. It can also display a logo, which is probably the main reason why you'd want to use vesafb :o)
Unfortunately, you can not use vesafb successfully with VESA 1.2 cards. This is because these 1.2 cards do not use linear frame buffering. Linear frame buffering simply means that the system's CPU is able to access every bit of the display. Historically, older graphic adapters could allow the CPU to access only 64K at a time, hence the limitations of the dreadful CGA/EGA graphic modes! It may be that someone will write a vesafb12 device driver for these cards, but this will use up precious kernel memory and involve a nasty hack.
There is however a potential workaround to add VESA 2.0 extensions for your legacy VESA 1.2 card. You may be able to download a TSR type program that will run from DOS, and used in cojunction with loadlin, can help configure the card for the appropriate graphic console modes. Note that this will not always work, as an example some Cirrus Logic cards such as the VLB 54xx series are mapped to a range of memory addresses (for example, within the 15MB-16MB range) for frame buffering which preludes these from being used successfully with systems that have more than 32MB of memory. There is a way to make this work, i.e. if you have a BIOS option to leave a memory hole at 15MB-16MB range, it might work, Linux doesn't support the use of memory holes. However there are patches for this option though [Who has these and where do one gets them from?]. If you wish to experiment with this option, there are plenty of TSR style programs available, a prime example is UNIVBE, which can be found on the Internet.
Assuming you are using menuconfig, you will need to do the following steps:
Go into the Code Maturity Level menu, and enable the prompt for development and/or incomplete drivers [note this may change for future kernels - when this happens, this HOWTO will be revised]
Go into the Console Drivers menu, and enable the following:
VGA Chipset Support (text only) - vgafb - used to be part of the list above, but it has been removed as it is now deprecated and no longer supported. It will be removed shortly. Use VGA Text Console (fbcon) instead. VGA Character/Attributes is only used with VGA Chipset Support, and doesn't need to be selected.
Ensure that the Mac variable bpp packed pixel support is not enabled. Linux kernel release v2.1.111 (and 112) seemed to enable this automatically if Advanced Low Level Drivers was selected for the first time. This no longer happens with v2.1.113.
Make sure these aren't going to be modules. [Not sure if it's possible to build them as modules yet - please correct me on this]
Then rebuild the kernel, modify /etc/lilo.conf to include the VGA=ASK parameter, and run lilo, this is required in order for you to be able to select the modes you wish to use.
Reboot the kernel, and as a simple test, try entering 0301 at the VGA prompt (this will give you 640x480 @ 256), and you should be able to see a cute little Penguin logo.
Once you can see that's working well, you can explore the various VESA modes (see below) and decide on the one that you like the best, and hardwire that into the "VGA=x" parameter in lilo.conf. When you have chosen the one you like the best, look up the decimal equivalent from the tables below and use the corresponding decimal number (i.e. for 1280x1024 @ 256, you just use "VGA=775"), and re-run lilo. That's all there it is to it. For further references, read the LoadLin/LILO HOWTOs.
NOTE! vesafb does not enable scrollback buffering as a default. You will need to pass to the kernel the option to enable it. Use video=vesa:ypan or video=vesa:ywrap to activate it. Both does the same thing, but in different ways. ywrap is a lot faster than ypan but may not work on slightly broken VESA 2.0 graphic cards. ypan is slower than ywrap but a lot more compatible. This option is only present in kernel v2.1.116 and above. Earlier kernels did not have the ability to allow scrollback buffering in vesafb.
This really depends on the type of VESA 2.0 compliant graphic card that you have in your system, and the amount of video memory available. This is just a matter of testing which modes work best for your graphic card.
The following table shows the mode numbers you can input at the VGA prompt (actually these numbers are plus 0x200 to make it easier to refer to the table)
Colours 640x400 640x480 800x600 1024x768 1280x1024 1600x1200 --------+----------------------------------------------------- 4 bits | ? ? 0302 ? ? ? 8 bits | 0300 0301 0303 0305 0307 031C 15 bits | ? 0310 0313 0316 0319 031D 16 bits | ? 0311 0314 0317 031A 031E 24 bits | ? 0312 0315 0318 031B 031F 32 bits | ? ? ? ? ? ?
For convienence, here is the same table in decimal terms
Colours 640x400 640x480 800x600 1024x768 1280x1024 1600x1200 --------+----------------------------------------------------- 4 bits | ? ? 770 ? ? ? 8 bits | 768 769 771 773 775 796 15 bits | ? 784 787 790 793 797 16 bits | ? 785 788 791 794 798 24 bits | ? 786 789 792 795 799 32 bits | ? ? ? ? ? ?
Key: 8 bits = 256 colours, 15 bits = 32,768 colours, 16 bits = 65,536 colours, 24 bits = 16.8 million colours, 32 bits - same as 24 bits, but the extra 8 bits can be used for other things, and fits perfectly with a 32 bit PCI/VLB/EISA bus.
Additional modes are at the discretion of the manufacturer, as the VESA 2.0 document only defines modes up to 031F(799). You may need to do some fiddling around to find these extra modes.
Yes, there is, actually. You will need to use the XF86_FBdev driver if for some reason your current X11 driver doesn't like vesafb. Go to http://www.xfree86.org, and download the X332servonly.tgz archive, unpack, and configure the drivers, following these steps
and then build the driver. Don't worry about the m68k references, it supports Intel platforms. Then build the whole thing - it'll take a long time though as it's a large source tree.
Alternatively, if you don't have the time to spare, you can obtain the binaries from the sites below. Please note that these are 'unofficial' builds and you use them at your risk.
For libc5, use the one at:
http://user.cs.tu-berlin.de/~kraxel/linux/XF68_FBDev.gzFor glibc2, download from these URLs.
http://user.cs.tu-berlin.de/~kraxel/linux/XF68_FBDev.libc6.gz http://pobox.com/~brion/linux/fbxserver.html
There have been reports that X11 is non functional on certain graphic cards with this vesafb feature enabled, if this is happening, try the new XF86_FBdev driver for X11.
This driver, along with vesafb can also help run X11 in higher graphic resolutions with certain graphic chipsets which are not supported by any of the current X11 drivers. Examples are MGA G-200 et. al.
To configure the XF86_FBdev driver with your X11 system, you'll need to edit your XF86Config for the following:
Section "Screen" Driver "FBDev" Device "Primary Card" Monitor "Primary Monitor" SubSection "Display" Modes "default" EndSubSection EndSection
You'll also need to set XkbDisable in the keyboard section as well, or invoke the XF86_FBDev server with the '-kb' option to set up your keyboard so it works properly. If you forget to set XkbDisable, you will have to put the following lines in your .Xmodmap to straighten out the keyboard mappings. Alternatively, you can edit your xkb to reflect the list below.
! Keycode settings required keycode 104 = KP_Enter keycode 105 = Control_R keycode 106 = KP_Divide keycode 108 = Alt_R Meta_R keycode 110 = Home keycode 111 = Up keycode 112 = Prior keycode 113 = Left keycode 114 = Right keycode 115 = End keycode 116 = Down keycode 117 = Next keycode 118 = Insert keycode 119 = Delete
You may need to do some fiddling around with this (try copying the original definition from the original X11 driver that you were using and editing the name of the driver to FBDev), but basically this is what you need to do to use the vesafb X11 driver.
Hopefully the X11 problems with supported graphic cards will be fixed in future releases.
This lists all the graphic cards that are known to work with the vesafb device:
This list is composed of on-board chipsets on systems' motherboards:
This list below blacklists graphic cards that doesn't work with the vesafb device:
As far as is known, vesafb can't be modularised, although at some point in time, the developer of vesafb may decide to modify the sources for modularising. Note that even if modularising is possible, at boot time you will not be able to see any output on the display until vesafb is modprobed. It's probably a lot wiser to leave it in the kernel, for these cases when there are booting problems.
[Taken from VGA-softcursor.txt - thanks Martin Mares!]
Linux now has some ability to manipulate cursor appearance. Normally, you can set the size of hardware cursor (and also work around some ugly bugs in those miserable Trident cards--see #define TRIDENT_GLITCH in drivers/char/ vga.c). In case you enable "Software generated cursor" in the system configuration, you can play a few new tricks: you can make your cursor look like a non-blinking red block, make it inverse background of the character it's over or to highlight that character and still choose whether the original hardware cursor should remain visible or not. There may be other things I have never thought of.
The cursor appearance is controlled by a
<ESC>[?1;2;3cescape sequence where 1, 2 and 3 are parameters described below. If you omit any of them, they will default to zeroes.
Parameter 1 specifies cursor size (0=default, 1=invisible, 2=underline, ..., 8=full block) + 16 if you want the software cursor to be applied + 32 if you want to always change the background colour + 64 if you dislike having the background the same as the foreground. Highlights are ignored for the last two flags.
The second parameter selects character attribute bits you want to change (by simply XORing them with the value of this parameter). On standard VGA, the high four bits specify background and the low four the foreground. In both groups, low three bits set colour (as in normal colour codes used by the console) and the most significant one turns on highlight (or sometimes blinking--it depends on the configuration of your VGA).
The third parameter consists of character attribute bits you want to set. Bit setting takes place before bit toggling, so you can simply clear a bit by including it in both the set mask and the toggle mask.
To get normal blinking underline, use: echo -e '\033[?2c' To get blinking block, use: echo -e '\033[?6c' To get red non-blinking block, use: echo -e '\033[?17;0;64c'