Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Framebuffer

This document describes the framebuffer driver in the Kyronix kernel. It is the child of Drivers.

Source

kernel/drivers/fb.c, kernel/drivers/fbdev.c

Overview

The framebuffer driver provides access to the linear framebuffer provided by the Limine bootloader. It supports text rendering via a built-in PSF font and exposes a character device at /dev/fb0.

Initialization

  1. Read framebuffer info from Limine (LIMINE_FRAMEBUFFER_REQUEST)
  2. Map framebuffer into kernel virtual space
  3. Clear screen with background color
  4. Register /dev/fb0 character device via fbdev

Framebuffer Properties

FieldDescription
addressLinear framebuffer physical address
width, heightResolution in pixels
pitchBytes per scanline
bppBits per pixel

Text Rendering

The kernel includes a built-in PSF (PC Screen Font) for text rendering. Each character is 8x16 pixels. The framebuffer supports ANSI color codes for colored text output.

Functions

FunctionDescription
fb_init(lfb)Initialize framebuffer from Limine response
fb_clear(color)Clear screen with solid color
fb_putchar(c)Render a character at the current cursor position
fb_set_color(fg, bg)Set foreground and background colors
fb_cursor_blink_tick(ticks)Update cursor blink state

Last reviewed: 2026-07-22