pie-boot 0.2.20

Boot kernel code with mmu.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
macro_rules! loader_bin_slice {
    () => {
        include_bytes!(concat!(env!("OUT_DIR"), "/loader.bin"))
    };
}

const LOADER_BIN_LEN: usize = loader_bin_slice!().len();

const fn loader_bin() -> [u8; LOADER_BIN_LEN] {
    let mut buf = [0u8; LOADER_BIN_LEN];
    let bin = loader_bin_slice!();
    buf.copy_from_slice(bin);
    buf
}

#[unsafe(link_section = ".boot_loader")]
pub static LOADER_BIN: [u8; LOADER_BIN_LEN] = loader_bin();