如何直接写入linux framebuffer?
答案 0 :(得分:8)
查看FBIOPUT_VSCREENINFO,ioctl和mmap
(我有代码,但没有在这台电脑上,抱歉)
编辑:这应该让你入门
//open file descriptor and get info
inf fdScreen = open( "devicename", O_RDWR );
fb_var_screeninfo varInfo;
ioctl( fdScreen, FBIOGET_VSCREENINFO, &varInfo );
//set resolution/dpi/color depth/.. in varInfo, then write it back
ioctl( fdScreen, FBIOPUT_VSCREENINFO, &varInfo );
//get writable screen memory; unsigned short here for 16bit color
unsigned short* display = mmap( 0, nScreenSize,
PROT_READ | PROT_WRITE, MAP_SHARED, fdScreen, 0 );
答案 1 :(得分:6)
基本上你打开/ dev / fb0,对它做一些ioctl,然后mmap它。然后,您只需写入流程中的mmap'd区域。
答案 2 :(得分:4)
您是否正在寻找设备驱动程序?如果是这样,请查看此HowTo指南