[][src]Crate ruspiro_boot

RusPiRo Boot for Raspberry Pi 3

This crates provides the startup routines that will be run from a baremetal kernel on the RaspberryPi.

Usage

Put the following code into your main rustfile of the binary that should be build for the Raspberry Pi:

#[macro_use]
extern crate ruspiro_boot;
 
come_alive_with!(alive);
run_with!(running);
 
fn alive(core: u32) {
    // do one-time initialization here
}
 
fn running(core: u32) -> ! {
    loop {
        // do any processing here and ensure you never return from this function
    }
}

As the boot routines provided by this crate depend on some external defined linker symbols the binary should always be linked with this linker script

The binary would not need any further dependencies to compile and link into a kernel image file that could be put onto a Raspberry Pi SD card and executed as baremetal kernel.

Re-exports

pub use self::macros::*;

Modules

macros

Macros

Macros

come_alive_with

Define a macro that enables easy setting of a custom entry point function to be used once the mandatory boot process has finished and the processing is handed over to the high level rust code. As each core will come come alive one after another, this function is called with the core it's running on. The next core comes alive after the actual one finished processing this function

run_with

Define a macro that enables easy setting of a custom entry point function to be used for the processing after all one-time initializations have been done. This function is intended to never return and is executed on each core individually. Therefore this function is called with the core number it's running on.