| Crates.io | eclipse_framebuffer |
| lib.rs | eclipse_framebuffer |
| version | 0.1.0 |
| created_at | 2025-11-06 21:47:13.867352+00 |
| updated_at | 2025-11-06 21:47:13.867352+00 |
| description | A lightweight no_std framebuffer text renderer with scrolling support for bare-metal Rust and the Limine bootloader |
| homepage | https://github.com/GhostedGaming/eclipse-os |
| repository | https://github.com/GhostedGaming/eclipse-os |
| max_upload_size | |
| id | 1920769 |
| size | 20,312 |
A lightweight, no_std framebuffer text rendering library designed for bare-metal Rust projects using the Limine bootloader. Features scrolling text support and a familiar println! macro interface.
no_std Rust implementationprintln! macro just like stdinclude_bytes!Add this to your Cargo.toml:
[dependencies]
eclipse-framebuffer = "0.1.0"
#![no_std]
#![no_main]
use limine::request::FramebufferRequest;
use eclipse_framebuffer::{ScrollingTextRenderer, println};
static FONT: &[u8] = include_bytes!("../fonts/Mik_8x16.psf");
#[used]
#[link_section = ".requests"]
static FRAMEBUFFER_REQUEST: FramebufferRequest = FramebufferRequest::new();
#[no_mangle]
unsafe extern "C" fn kmain() -> ! {
let framebuffer_response = FRAMEBUFFER_REQUEST
.get_response()
.expect("No framebuffer");
let framebuffer = framebuffer_response
.framebuffers()
.next()
.expect("No framebuffer available");
// Initialize the scrolling text renderer
ScrollingTextRenderer::init(
framebuffer.addr(),
framebuffer.width() as usize,
framebuffer.height() as usize,
framebuffer.pitch() as usize,
framebuffer.bpp() as usize,
FONT,
);
// Now you can use println! just like in std
println!("Hello from Eclipse Framebuffer!");
println!("Framebuffer: {}x{}", framebuffer.width(), framebuffer.height());
loop {}
}
The ScrollingTextRenderer provides automatic text scrolling when the screen fills up:
use eclipse_framebuffer::{ScrollingTextRenderer, println};
// After initialization...
println!("Line 1");
println!("Line 2");
println!("Line 3");
// Automatically scrolls when screen is full!
The println! macro supports all standard Rust formatting:
println!("Number: {}", 42);
println!("Hex: 0x{:X}", 0xDEADBEEF);
println!("Debug: {:?}", some_struct);
Eclipse Framebuffer supports PSF (PC Screen Font) and PSF2 formats. These are simple bitmap font formats commonly used in console applications.
Place your .psf font files in your project and include them at compile time:
static FONT_8X16: &[u8] = include_bytes!("../fonts/Mik_8x16.psf");
static FONT_8X8: &[u8] = include_bytes!("../fonts/default_8x8.psf");
/usr/share/consolefonts/)psftoolsEclipse Framebuffer works across multiple architectures:
ScrollingTextRenderer - Main renderer with automatic scrollingprintln! - Macro for formatted text output (like std::println!)ScrollingTextRenderer::init(
addr: *mut u8, // Framebuffer address
width: usize, // Screen width in pixels
height: usize, // Screen height in pixels
pitch: usize, // Bytes per scanline
bpp: usize, // Bits per pixel
font: &'static [u8], // PSF font data
);
Eclipse Framebuffer is designed to work seamlessly with the Limine bootloader:
ScrollingTextRenderer with framebuffer parametersprintln! throughout your kernelSee the Quick Start example above for complete integration code.
Eclipse Framebuffer is ideal for:
no_std environmentsContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
Built for the Rust bare-metal development community. Special thanks to the Limine bootloader project for providing excellent tooling for OS development.
Note: This is a no_std library designed for bare-metal environments. It requires a bootloader (like Limine) that provides framebuffer access.