Full of Framebuffer Goodness

Linux framebuffer support has been around for so long that some people probably don't realise that there was a world before framebuffers, in which the only way to look at graphics was to a) run X, or some such program, which would take over the console and speak SVGA straight to the graphics card, or b) get creative.

Whilst I don't much mind pretty graphics at boot time (the default Ubuntu splash screen is pleasant enough), it's a little-mentioned fact that on the text consoles, framebuffer support is significantly slower than the alternative (presumably because it sends rendered characters to the video card one pixel at a time, rather than sending them over as (byte-sized) character values for the hardware to render itself).

As an example, my current (work) machine is able to scroll through the man man page in about four and a half seconds using the framebuffer. That's about 28k of text, and 3700 lines. (In case you were wondering, running man takes about 0.2 seconds; dumping the output in a file and using cat instead makes no appreciable difference in speed.) Without framebuffer, my (old) work laptop is able to scroll through almost three megabytes of text — 350,000 lines — in less than five seconds. In case it hasn't hit you yet, that's a factor of about a hundred. As you might imagine, there was rarely any point in using tail, because displaying output and returning to the prompt rarely took more than a blink. Scrolling text in a pager used to be instantaneous; with framebuffer you can watch the characters scrolling up the screen.

Of course, as I rarely venture outside X these days, this isn't a problem. And the framebuffer isn't all bad: it can do things which weren't possible before — one of the nicest of which is being able to use high resolutions for displaying lots of text. At only 1024×768, you can get 48 rows of 128-column text, which makes for a nice mutt or emacs session. And of course, you can also get a picture of a penguin with your login prompt.

Anyway, I'd long assumed that the only way to change what, and whether, framebuffer was available was to get into kernel recompiles; and life is too short for that, especially now that packaged kernels regularly support everything I need them to. So I occasionally thought fondly of it, and left it at that. But no! Life is much simpler than I'd expected it could ever be! Hurrah, and much use of exclamation marks!

It turns out that you can just use the kernel boot-time options. See your local, friendly boot-loader documentation for information on passing these to the kernel; I press e a couple of times from the boot menu. There are generally a few kernel options already set, such as splash and root=/dev/..., which you can look for if you're not sure.

Then, if you want to use plain (fast) text for your text consoles just add

vga=normal

to your options. Unless you're using the framebuffer as your rendering device, this will make no difference at all to how X works — and if find you are, just reboot and you'll be right back to normal.

If you want to stay with framebuffer but go for something higher-res, pick a value from Ubuntu's helpful page and substitute a number (in decimal) in place of normal. The mode mentioned above would be

vga=791

for example.

And if you really like it, you can always set it for future use: see http://ubuntuforums.org/showthread.php?t=258484 for details.