问题
I have some c code that draws simple graphics on the linux framebuffer console. I'm also using the raspberry pi and it's composite video output. The OS is raspbian, and i'm doing a low level solution without using X.
My graphics are working well, and i'm also able to read the usb keyboard and respond to key presses.
Currently there is a tty terminal that my graphics are written over. The tty is still active and key presses are echoed to the screen.
What I want to achieve is to disable all console messages and ttys on the framebuffer so only my graphics are shown. Does anyone have a good way of doing this? Perhaps disabling the tty on that virtual console?
Rob
回答1:
I think what you're looking for is ioctl(fd, KDSETMODE, KD_GRAPHICS)
. You'll need to set it back before you exit.
回答2:
Thanks for your answer R.. I just created an account so the user1645083 is me. That worked perfectly. I did need to figure out that I should be operating the KDSETMODE on the file descriptor of the tty in question, but after that it worked perfectly, thanks!
In response to the comment above, I probably should have given more details. I did try running the graphics program directly from inittab, also running it from .bashrc, as root, as a user.
Here is my code if anyone is interested. It is a hack-job without a doubt, but this is for art not science!
https://gist.github.com/robmint/4753401
来源:https://stackoverflow.com/questions/14805294/using-linux-framebuffer-for-graphics-but-disabling-console-text