1. What is Framebuffer?
(1) framebuffer frame buffer (one screen data) (FB) is a virtual device in the Linux kernel, Framebuffer provides a unified standard interface display device to the application layer. Frame buffer (framebuffer)
is an interface provided by Linux for display devices, a device that abstracts the graphics memory, allowing the upper-level application to read and write directly to the display buffer in graphical mode. This operation is abstract and uniform. Use
You don't have to worry about the location of physical memory, the mechanism of page change, etc. These are all done by the framebuffer device driver.
(2) From the driver perspective, FB is a typical character device, and creates a class/sys/class/graphics
(3) Use of framebuffer
1): Open framebuffer device file:/dev/fb0
2): Get framebuffer device information #include <linux/fb.h>
3): Mmap do the mapping
4): Fill framebuffer
2. Initialization function of Framebuffer drive frame: fbmem_init
The code of the Framebuffer Driver Framework section is the same as the previous Misc drive frame and LED driver framework, and is implemented as a module that can be dynamically loaded and unloaded when the kernel is configured, and the benefits of the module have been mentioned before.
Fbmem_init Function Code Analysis:
3. Drive frame left to driver Engineer interface: Register_framebuffer (Unregister_framebuffer)
Driver Framework code is not related to the specific hardware operations, mainly software logic, providing service code. The driver engineer needs to invoke the interface function provided by the driver framework to register the driver and the device with the drive frame.
(1) An important structural body: struct FB_INFO
Framebuffer driver Framework for Linux driver framework