#low-level #vga #freestanding #0x-b8000

vga-rs

Low level VGA(0xB8000) library in freestanding Rust

1 unstable release

0.1.4 Nov 29, 2023
0.1.3 Nov 29, 2023
0.1.2 Nov 28, 2023
0.1.1 Nov 28, 2023
0.1.0 Nov 28, 2023

#117 in Video

Download history 5/week @ 2024-02-24 1/week @ 2024-03-02 2/week @ 2024-03-09 22/week @ 2024-03-30 1/week @ 2024-04-06 17/week @ 2024-04-13 48/week @ 2024-04-20

88 downloads per month
Used in vgastream-rs

MIT/Apache

10KB
178 lines

vga-rs

Low level VGA(0xB8000) library in freestanding Rust.

How to build


cargo add vga-rs

Example

#![no_std]
extern crate vga_rs;
use vga_rs::*;
extern crate cursor_rs;

fn reset_screen() {
	let mut vga_buffer = VgaBuffer::new()
	let buffer_slice = let mut vga_buffer.as_mut_slice();
	for vchar in buffer_slice.iter_mut()
	{
		let VgaChar { codepoint: _,attribute: attr,} = vchar.get_volatile();
		vchar.set_volatile(VgaChar::new(0u8, Attribute::from_u8(attr)));
	}
    cursor_rs::set_cursor(0,0);
}

Contact me


lib.rs:

vga-rs

Low level VGA(0xB8000) library in freestanding Rust.

Example

#![no_std]
extern crate vga_rs;
use vga_rs::*;
extern crate cursor_rs;

fn reset_screen() {
	let mut vga_buffer = VgaBuffer::new()
	let buffer_slice = let mut vga_buffer.as_mut_slice();
	for vchar in buffer_slice.iter_mut()
	{
   		let VgaChar { codepoint: _,attribute: attr,} = vchar.get_volatile();
		vchar.set_volatile(VgaChar::new(0u8, Attribute::from_u8(attr)));
	}
    cursor_rs::set_cursor(0,0);
}

Dependencies

~3KB