Put Graphics on The Screen Without /Dev/Fb0

Put graphics on the screen without /dev/fb0

the /dev/fb0 handeling with kernel. you must enable:

  • CONFIG_FRAMEBUFFER_CONSOLE if you want to enable 'df' for console
  • CONFIG_DRM and VGA card driver in this.
  • FB and your VGA card driver in this.

What are the syscalls for drawing graphics on the screen in Linux?

Typically a user is running a display server and window system which organizes the screen into windows which applications draw to individually using the API provided by that system. The details will depend on the architecture of this system.

The traditional window system on Linux is the X window system and the more modern Wayland display server/protocol is also in common use. For example X has commands to instruct the X server to draw primitives to the screen.

If no such system is in use, you can directly draw to a display either via a framebuffer device or using the DRM API. Both are not accessed by special syscalls, but instead by using normal file syscalls like open, read, write, etc., but also ioctl, on special device files in /dev, e.g. /dev/dri/card0 for DRM to the first graphics card or /dev/fb0 for the first framebuffer device. DRM is also used for applications to render directly to the screen or a buffer when under a display server or window system as above.

In any case DRM is usually not used directly to draw e.g. pixels to the screen. It still is specific to the graphics card. Typically a library like Mesa3D is used to translate the specific details into a common API like OpenGL or Vulkan for applications to use.



Related Topics



Leave a reply



Submit