Friday, January 30, 2009

Increasing the scrollback buffer in tty console

Tty consoles (that's what you boot into when you start Linux without X) in the 2.6 kernels allow only about 15 screens of scroll back. At 80 lines per screen, that works out to a meager 1200 lines.

Now 1200 lines may not be meager - in the normal course of things, you may not need to scroll back more than 1200 lines. But there are some times when this becomes essential - kernel compile, debugging the boot process, looking at dmesg outputs - to name a few.

If you are using an X manager (Gnome for instance), you can change the scroll back buffer size of the Terminal easily (Edit->Profiles->Scrolling). But what if you are booting without X - or if your system does not have X. Such situations arise when you are working with VM's or in a full system simulator.

I found out that it is possible to re-allocate the memory for the console from the System RAM instead of VGA RAM. This can be set up by setting the VGACON_SOFT_SCROLLBACK kernel config item to Y. Once this is set up, calculate the amount of memory needed (rule of thumb is 64KB for 16 screens of 80 lines each) and set this in VGACON_SOFT_SCROLLBACK_SIZE. recompile the kernel - and you are done.

Another option, which has added advantages, is using GNU screen. I have not checked it out - but I am sure that the scrollback buffer size will be configurable. But if increasing the scroll back buffer size is all you want - then screen may not be needed. Plus it is not as much fun as kernel compile - now is it :)

(I got this from http://www.linuxinsight.com/soft_scrollback_for_the_linux_vga_console.html. That link was pointed out by Ron Johnson Jr from the Debian Mailing List.)

0 Comments:

Post a Comment

<< Home