Struct stivale_boot::v2::StivaleTerminalTag
source · [−]#[repr(C)]pub struct StivaleTerminalTag {
pub header: StivaleTagHeader,
pub flags: u32,
pub cols: u16,
pub rows: u16,
pub term_write_addr: u64,
}
Expand description
If the terminal tag was requested through the terminal tag header and its supported by the stivale bootloader, this tag is returned to the kernel. This tag provides an interface to the stivale terminal.
Fields
header: StivaleTagHeader
flags: u32
cols: u16
The amount of columns in the stivale terminal setup by the bootloader.
rows: u16
The amount of rows in the stivale terminal setup by the bootloader.
term_write_addr: u64
The virtual address of the term_write
function, which is used to write to the stivale terminal. For
a more safer way use the StivaleTerminalTag::term_write
Implementations
sourceimpl StivaleTerminalTag
impl StivaleTerminalTag
sourcepub fn term_write(&self) -> impl Fn(&str)
pub fn term_write(&self) -> impl Fn(&str)
Returns the terminal write function provided by the terminal stivale tag. This function returns the transmuted function for you to simplify the process of passing the string as a raw pointer and passing the string length.
Example
use stivale_boot::v2::StivaleStruct;
fn kmain(stivale_struct: &'static StivaleStruct) {
let terminal_tag = stivale_struct.terminal().expect("skill issue :^)");
let term_write = terminal_tag.term_write();
term_write("Hello, Stivale!");
term_write("Hello, Rust!")
}
Safety
This function is not thread safe.
Auto Trait Implementations
impl RefUnwindSafe for StivaleTerminalTag
impl Send for StivaleTerminalTag
impl Sync for StivaleTerminalTag
impl Unpin for StivaleTerminalTag
impl UnwindSafe for StivaleTerminalTag
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more