The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
fb.h File Reference

userspace access to the linear framebuffer. More...

#include <sys/types.h>

Go to the source code of this file.

Data Structures

struct  fb_info_t
 framebuffer geometry and pixel format, filled by fbinfo(). More...

Typedefs

typedef unsigned int uint32_t
typedef unsigned char uint8_t

Functions

int fbinfo (fb_info_t *info)
 query the framebuffer geometry and pixel format.
void * fbmap (void)
 map the framebuffer into this process's address space.
int pollkey (void)
 non-blocking keyboard poll for interactive graphics programs.

Detailed Description

userspace access to the linear framebuffer.

linear framebuffer driver.

a program calls fbinfo() to learn the framebuffer geometry and pixel format, then fbmap() to map it into its address space and draw pixels directly. these are convenience wrappers over the /dev/fb0 fbdev (open + ioctl + mmap, see <sys/fb.h>); a program can use that interface directly instead. this is still a single-client path (no compositor yet): whoever maps it owns the whole screen until it exits.

a pixel-pushing driver for the VBE linear framebuffer described in boot_info_t (see the FB0 bootloader work). it is the framebuffer equivalent of the raw VGA text driver: it knows nothing about fonts, terminals, or ANSI only pixels and rectangles. higher layers (the font renderer, the tty backend) build on top of it.

pixels are composed from the channel masks the boot protocol reported, so the driver works for whatever RGB packing the mode uses (24- or 32-bpp) rather than assuming a fixed 0x00RRGGBB layout.

Typedef Documentation

◆ uint32_t

typedef unsigned int uint32_t

◆ uint8_t

typedef unsigned char uint8_t

Function Documentation

◆ fbinfo()

int fbinfo ( fb_info_t * info)

query the framebuffer geometry and pixel format.

Parameters
infooutput struct.
Returns
0 on success, -1 if there is no framebuffer.

◆ fbmap()

void * fbmap ( void )

map the framebuffer into this process's address space.

Returns
a writable pointer to the framebuffer, or NULL on failure. the returned buffer is pitch * height bytes; write packed pixels.

◆ pollkey()

int pollkey ( void )

non-blocking keyboard poll for interactive graphics programs.

Returns
the next pending character key, or 0 if none is waiting.