linuxlinux-kernelframebuffervesa

Change Linux framebuffer background color


My question is about the linux kernel. When framebuffer device initializes (I guess it is vesafb), the screen is filled with black color. How can I change that color? What file should I edit? I guess it is something in drivers/video/.

I only know about changing console background (drivers/tty/vt/vt.c), but this is not what I need. VGA Console is turned off.

In case my description is not clear I have a video that shows my system bootup in a virtual machine. After the kernel is loaded QEMU window changes it's size to 640x480 and becomes completely black (0:03-0:04). This is what I want to modify. After it my init is started. It outputs text to framebuffer and then dies, causing kernel panic and reboot in 1sec. Then everything starts over.


Solution

  • The console implementation in vt.c started out as a VGA console once upon a time, but it is now used for all consoles. (The 'attribute byte' is mapped to whatever the underlying hardware driver actually supports.)

    Change the initialization of vc_def_color in vc_init().

    Since version 3.12, this can also be changed with the kernel parameter vt.color.