|
|
|
@ -5,8 +5,8 @@
|
|
|
|
|
//! but it's a project for discovering rust on embedded, so its architecture is less generic and
|
|
|
|
|
//! I'm trying to reuse knowledge from Telecom-Paris SE203 class as much as I can.
|
|
|
|
|
|
|
|
|
|
#![no_main]
|
|
|
|
|
#![no_std]
|
|
|
|
|
#![cfg_attr(not(test), no_main)]
|
|
|
|
|
#![cfg_attr(not(test), no_std)]
|
|
|
|
|
#![feature(format_args_nl)]
|
|
|
|
|
#![feature(panic_info_message)]
|
|
|
|
|
|
|
|
|
@ -16,19 +16,26 @@ mod traits;
|
|
|
|
|
mod bsp;
|
|
|
|
|
mod utils;
|
|
|
|
|
|
|
|
|
|
#[cfg(not(test))]
|
|
|
|
|
mod panic;
|
|
|
|
|
#[cfg(not(test))]
|
|
|
|
|
mod print;
|
|
|
|
|
|
|
|
|
|
#[cfg(not(test))]
|
|
|
|
|
use core::arch::global_asm;
|
|
|
|
|
#[cfg(not(test))]
|
|
|
|
|
use core::arch::asm;
|
|
|
|
|
|
|
|
|
|
// TODO: handle this with features
|
|
|
|
|
//use crate::bsp::qemu::console::console;
|
|
|
|
|
#[cfg(not(test))]
|
|
|
|
|
use crate::bsp::rpi3::uart::console;
|
|
|
|
|
#[cfg(not(test))]
|
|
|
|
|
use crate::bsp::rpi3::gpio;
|
|
|
|
|
|
|
|
|
|
// TODO: move this to BSP
|
|
|
|
|
/// Pause the core with a infinit loop
|
|
|
|
|
#[cfg(not(test))]
|
|
|
|
|
#[inline(always)]
|
|
|
|
|
pub fn wait_forever() -> ! {
|
|
|
|
|
loop {
|
|
|
|
@ -37,9 +44,11 @@ pub fn wait_forever() -> ! {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: move this to BSP
|
|
|
|
|
#[cfg(not(test))]
|
|
|
|
|
global_asm!(include_str!("boot.s"));
|
|
|
|
|
|
|
|
|
|
/// Start the rust part of the kernel
|
|
|
|
|
#[cfg(not(test))]
|
|
|
|
|
#[no_mangle]
|
|
|
|
|
pub unsafe fn _start_rust() -> ! {
|
|
|
|
|
|
|
|
|
@ -85,3 +94,6 @@ pub unsafe fn _start_rust() -> ! {
|
|
|
|
|
panic!("Paniccccccc")
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
|
fn main() {}
|
|
|
|
|