[][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.

Features

  • ruspiro_pi3 is active by default and need not to be passed. This ensures proper building of the boot assembly.
  • with_panic will ensure that a default panic handler is implemented.
  • with_exception will ensure that a default exception and interrupt handler is implemented.
  • singlecore enforces the compilition of the single core boot sequence. Only the main core 0 is then running.

Re-exports

pub use self::macros::*;

Modules

macros

Macros

Macros

come_alive_with

Use this macro to define the your custom one-time-initialization 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

Use this macro to define the never-returning processing 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.