uefi-graphics

Crates.iouefi-graphics
lib.rsuefi-graphics
version0.4.0
sourcesrc
created_at2020-09-23 05:23:05.584621
updated_at2021-07-29 14:47:47.890703
descriptionAn embedded-graphics display driver for UEFI environments
homepage
repositoryhttps://github.com/DianaNites/uefi-graphics
max_upload_size
id291966
size4,547
Diana (DianaNites)

documentation

README

Uefi-graphics

An embedded-graphics display driver for UEFI environments.

Simple, slight work in progress. Should work fine, doesn't do too much.

Example

Using the uefi, currently at 0.11.0 crate

// The GraphicsOutput from the uefi crate
let graphics: &mut GraphicsOutput;

// Get the framebuffer.
let mut fb = graphics.frame_buffer();

let display = &mut UefiDisplay::new(
    // The framebuffer pointer.
    // The framebuffer is stored in a variable separately to ensure the
    // `UefiDisplay` cannot become invalid.
    fb.as_mut_ptr(),

    // These casts are needed because, while the uefi spec has these as u32,
    // the uefi crate casts them to usize for some reason.
    mode.stride() as u32,
    (mode.resolution().0 as u32, mode.resolution().1 as u32),

    // This ensures that the lifetimes are correct.
    &fb,
);
Commit count: 30

cargo fmt