[Linux] Inhibit kernel messages and cursor - Page 1
Forum section: electronics / general

author: blueskull
author_rank: Unknown
timestamp: October 25, 2017, 03:38:37 am
content: I'm working on my Framebuffer GUI toolkit, as described here:https://www.eevblog.com/forum/microcontrollers/framebuffer-gui-toolkit/Now, I can get control of FB, and I implemented some simple drawing functions (draw pixel, load bitmap and bitblt).I'm facing one problem -- Linux kernel occasionally puts some crap on screen, also the default login prompt has a blinking cursor which occasionally gets into my screen canvas.Is there anyway I can completely take control of the FB in exclusive mode that's free from messages from kernel or any other programs?

author: technix
author_rank: Super Contributor
timestamp: October 25, 2017, 04:06:36 am
content: You need to turn off the framebuffer console module (fbcon).

author: cv007
author_rank: Frequent Contributor
timestamp: October 25, 2017, 04:30:23 am
content: turn off cursorprintf "\033[?25l"change log level to something lowecho 2 > /proc/sys/kernel/printk

author: technix
author_rank: Super Contributor
timestamp: October 25, 2017, 05:06:30 am
content: A third alternative is to spawn a new framebuffer just four application. (Just take the code from a recent version of X Server.) The user can switch between your framebuffer and the system console framebuffers through Ctrl-Alt-Fx Key combo.

author: stmdude
author_rank: Frequent Contributor
timestamp: October 25, 2017, 06:17:48 am
content: There's a more standard way of doing this guys..First off, to get the kernel to stop logging on the graphical console (/dev/tty0), move it to some other tty with the kernel argument "console=/dev/ttyS0" (or other serial-port, or wherever you'd like to be able to see them).The blinking cursor will still remain, as it should on a tty.The solution to that is to switch the tty into graphics mode in your application. You can do that by issuing the KD_SETMODE ioctl to the ttys fd. Something like:Code:fd = open("/dev/tty0",O_RDWR);ioctl(fd, KDSETMODE, KD_GRAPHICS);I'm assuming you already have opened the tty to mmap/whatever the framebuffer, so the open() is probably already done in your code.

author: technix
author_rank: Super Contributor
timestamp: October 25, 2017, 08:49:56 am
content: Quote from: blueskull on October 25, 2017, 07:38:30 amMaybe just grab that one program?

author: stmdude
author_rank: Frequent Contributor
timestamp: October 25, 2017, 11:37:09 am
content: Quote from: blueskull on October 25, 2017, 06:43:14 amFor future reference, the kernel-arg "quiet" was probably what you were looking for when it comes to getting rid of kernel messages.Quote from: blueskull on October 25, 2017, 07:38:30 amWell, that's how /sys/class/graphics/fb0/blank is supposed to work. Doing it repeatedly isn't a solution either, as setting it to 0 doesn't reset the timer...consoleblank=0 _should_ work, but there might be some brokenness in your display driver.setterms powersave works like this:Code:char ioctlarg;ioctlarg = TIOCL_SETVESABLANK;ioctlarg = 0; // Turn off VESA blankingioctl(STDIN_FILENO, TIOCLINUX, ioctlarg);( Never mind the "VESA" part. It's just legacy naming. )

author: cv007
author_rank: Frequent Contributor
timestamp: October 25, 2017, 12:47:11 pm
content: another way from terminal prompt for consoleblank value-printf "\033[9;0]"there is also-xset dpms 0if terminal is in the x-windows type environment, I think this possibly could be the culprit(not sure if you are working in gui environment or at terminal/vfb only)

author: BradC
author_rank: Super Contributor
timestamp: October 25, 2017, 02:40:44 pm
content: Quote from: blueskull on October 25, 2017, 07:38:30 amhttps://www.linuxquestions.org/questions/linux-server-73/how-to-disable-console-blanking-in-text-mode-780272/And busybox.