如何直接写入到linux framebuffer?

如何直接写入到linux framebuffer

Solutions Collecting From Web of "如何直接写入到linux framebuffer?"

看看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 ); 

基本上你打开/ dev / fb0,在它上面做一些ioctls,然后把它映射。 然后,您只需在您的流程中写入mmap的区域。

你想写一个设备驱动程序? 如果是这样看看这个如何指南