Hello everyone, I am new to embedded development and I am facing a bug which I do not understand at all.
For some context, I am writing a toy OS for the raspberry pi zero using Rust. I have reduced my problem to the following minimal example: an assembly "bootloader" sets up the interrupt vector table and the stack pointer, and then calls into the kernel
entry point in Rust. Once in Rust land, I have defined the #[panic_handler]
to be a loop that blinks a led every second.
If the body of the kernel
function looks like the following:
#[no_mangle]
pub extern "C" fn kernel() -> ! {
panic!();
loop {}
}
Then everything is successful, and the LED blinks as expected.
However, if instead I call unwrap
on a None
value for example:
#[no_mangle]
pub extern "C" fn kernel() -> ! {
None::<()>.unwrap();
loop {}
}
Then nothing happens; The LED is not blinking.
Why is that?