vgacon: Add support for soft scrollback
Subsystems (2)
PATCH 1/1 vgacon: Add support for soft scrollback
The scrollback buffer of the VGA console is located in VGA RAM. This RAM is fixed in size and is very small. To make the scrollback buffer larger, it must be placed instead in System RAM.
This patch adds this feature. The feature and the size of the buffer are made as a kernel config option. Besides consuming kernel memory, this feature will slow down the console by approximately 20%.
---
This patch is the result of a discussion on how to capture very long oops tracings. One of the suggestions was to increase the size of the scrollback buffer of the VGA console.
I haven't tested the code rigorously, so let me know of any bugs. I also tried to make it behave as close as possible to vgacon with a hard scrollback.
Tony
drivers/video/console/Kconfig | 24 ++++ drivers/video/console/vgacon.c | 245 +++++++++++++++++++++++++++++++++------- 2 files changed, 226 insertions(+), 43 deletions(-)
drivers/video/console/Kconfig +24 -0
@@ -26,6 +26,30 @@ config VGA_CONSOLE # fi # fi +config VGACON_SOFT_SCROLLBACK + bool "Enable Scrollback Buffer in System RAM" + depends on VGA_CONSOLE + default n + help + The scrollback buffer of the standard VGA console is located in + the VGA RAM. The size of this RAM is fixed and is quite small. + If you require a larger scrollback buffer, this can be placed in + System RAM which is dynamically allocated during intialization. + Placing the scrollback buffer in System RAM will slightly slow + down the console. + + If you want this feature, say 'Y' here and enter the amount of + RAM to allocate for this buffer. If unsure, say 'N'. + +config VGACON_SOFT_SCROLLBACK_SIZE + int "Scrollback Buffer Size (in KB)" + depends on VGACON_SOFT_SCROLLBACK + default "64" + help + Enter the amount of System RAM to allocate for the scrollback + buffer. Each 64KB will give you approximately 16 80x25 + screenfuls of scrollback buffer + config VIDEO_SELECT bool "Video mode selection support" depends on X86 && VGA_CONSOLE
drivers/video/console/vgacon.c +202 -43
299 lines not on this page · raw message
Quoted 4 lines
This patch adds this feature. The feature and the size of the buffer are made as a kernel config option. Besides consuming kernel memory, this feature will slow down the console by approximately 20%.
Slower? Then I would rather prefer compact oopses.
Jan Engelhardt
Quoted 5 lines · Jan Engelhardt
Quoted 3 lines
This patch adds this feature. The feature and the size of the buffer are made as a kernel config option. Besides consuming kernel memory, this feature will slow down the console by approximately 20%.
Slower?
Yes, I mentioned this before. The slowdown is unavoidable because the contents of the scrollback is read from the VGA RAM. It can be speeded up but it will require an overhaul of vgacon to use buffers in system RAM for the entire screen contents, visible and not visible.
Hard scrollback is still the default for vgacon, and soft scrollback has to be selected during kernel config.
Quoted 1 line
Then I would rather prefer compact oopses.
Of course.
Tony
Quoted 3 lines
Hard scrollback is still the default for vgacon, and soft scrollback has to be selected during kernel config.
kconfig - that's good to hear - then I'm absolutely fine with it.
Jan Engelhardt
Quoted 18 lines · Antonino A. Daplas
The scrollback buffer of the VGA console is located in VGA RAM. This RAM is fixed in size and is very small. To make the scrollback buffer larger, it must be placed instead in System RAM.
This patch adds this feature. The feature and the size of the buffer are made as a kernel config option. Besides consuming kernel memory, this feature will slow down the console by approximately 20%.
Signed-off-by Antonino Daplas <[email protected]>---
This patch is the result of a discussion on how to capture very long oops tracings. One of the suggestions was to increase the size of the scrollback buffer of the VGA console.
I haven't tested the code rigorously, so let me know of any bugs. I also tried to make it behave as close as possible to vgacon with a hard scrollback.
[...]
drivers/video/console/vgacon.c static inline void write_vga(unsigned ch · line 334
Quoted 9 lines
drivers/video/console/vgacon.c +9
-0+static int vgacon_scrolldelta (struct vc_data *c,int lines) +{ +if (!lines)/* Turn scrollback off */ + c->vc_visible_origin = c->vc_origin; +else { +int margin = c->vc_size_row *4 ; +int ul, we, p, st; + +printk ("vgacon delta: %i\n" , lines);
^^^^^^
This disables the hard scrollback, as the console is immediately scrolled back when the mesage gets printed.
Regards,
Signature · 1 line
Jindrich Makovicka
Quoted 7 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ + printk("vgacon delta: %i\n", lines);^^^^^^This disables the hard scrollback, as the console is immediately scrolled back when the mesage gets printed.
printk(KERN_DEBUG ) should probably help it. That way, only syslog picks it up.
Jan Engelhardt