(I) Accessing the Linux Framebuffer

Abstract

This set of procedures allow to display the Inlab Scheme graphical data types directly on the Linux framebuffer.

The Linux framebuffer (fbdev) is a graphic hardware-independent abstraction layer to show graphics on a computer monitor, typically on the system console. It allows direct access to the framebuffer (the part of a computer’s video memory containing a current video frame) using only the Linux kernel’s own basic facilities and its device file system interface. It does not rely on user space software like SVGALib.

Typically, one either deactivates the graphical frontend/GUI or switches to the text console for testing (with Ctrl-Alt-F1(-F7)).

Since /dev/fb0 usually has read and write permissions for all users in the video group, it makes sense to add the executing user id running Inlab Scheme to that group (e.g. with sudo usermod -a -G video ).

Framebuffer Procedures

framebuffer-open

(framebuffer open) opens /dev/fb0 for further usage. There’s no possibility (or need) to write to a different device.

Supported are 32 bits per pixel (BGRX - one byte for blue, green and red and one unused byte) or 16 bits per pixel (BGR 5-6-5) covering virtually all contemporary displays.

While executing this procedure, the screen is cleared to all black.

If the framebuffer device has already been opened, an error is signalled.

Example:

[1] (framebuffer-open)
ok
[2]

framebuffer-get-dimensions

framebuffer-close

framebuffer-display-bitmap

framebuffer-display-greymap

framebuffer-display-colormap