3

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.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
tpimh
  • 446
  • 2
  • 9
  • 23

1 Answers1

3

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.

CL.
  • 173,858
  • 17
  • 217
  • 259
  • I changed it to `vc->vc_def_color = 0x07;`, but no result. By the way it works, if I enable VGA Console, but the result is generally the same: in the very beginning the screen is filled with black color. – tpimh Jun 24 '13 at 18:25
  • `0x07` is the old default. Before the GPU driver is initialized, you get the text mode set by the BIOS, which always has black background. – CL. Jun 24 '13 at 20:29
  • Okay. Does this mean that the kernel doesn't even have the screen filling code? If so, I need to add it. Still someone is filling the screen (see my video at 0:07, the screen is cleared from old data), maybe it is BIOS. – tpimh Jun 25 '13 at 06:40
  • The kernel fills the screen when the GPU driver is initialized. – CL. Jun 25 '13 at 07:51
  • Could you please tell the exact name of function that fills the screen? – tpimh Jun 25 '13 at 12:49