Crates.io | cursor-rs |
lib.rs | cursor-rs |
version | 0.1.4 |
source | src |
created_at | 2023-11-28 13:19:14.228268 |
updated_at | 2023-11-29 15:27:23.43338 |
description | Getter & Setter cursor position on VGA(0xB8000) in freestanding Rust. |
homepage | https://gitlab.com/hwoy/cursor-rs |
repository | |
max_upload_size | |
id | 1051988 |
size | 10,694 |
Getter & Setter cursor position on VGA(0xB8000) in freestanding Rust.
cargo add cursor-rs
#![no_std]
extern crate vgainfo_rs;
use vgainfo_rs::*;
extern crate cursor_rs;
use cursor_rs::*;
fn reset_screen() {
let buffer_ptr = LENGTH as *mut VgaCharType;
let iter = (0..LENGTH).map(|i| unsafe { buffer_ptr.add(i) });
for ptr in iter {
let value = unsafe { ptr.read_volatile() };
unsafe { ptr.write_volatile(value & 0xff00) };
}
VgaCursor::new().set(0,0);
}