Expand description
Implements the print!, println! and dbg! macros so they can be used in the kernel without the use of an allocator.
By default the macros are prefixed with kernel_. If you want to remove the prefix, you can enable the std_name feature.
§Usage
Exactly as you’d use the original macros from the standard library.
#![no_std]
// ...
kernel_dbg!(2 + 2);
kernel_print!("{} + {} = {}\n", 2, 2, 2 + 2);
kernel_println!("{} + {} = {}", 2, 2, 2 + 2);§Features
std_name: Allows you to use the macros without thekernel_prefix.format: Uses theformat!macro instead of thecore::fmt::Writetrait to convert the passed data into a string.
Macros§
- kernel_
dbg - Macro for printing the value of a given expression for quick and dirty debugging.
- kernel_
print - Prints to the standard output.
- kernel_
println - Prints to the standard output, with a newline.