zoniony / zoniony.github.io

blog
1 stars 0 forks source link

blog_os (一) #9

Open zoniony opened 4 years ago

zoniony commented 4 years ago

无聊

A Freestanding Rust Binary

注释很清楚了

#![no_std] // don't link the Rust standard library
#![no_main] // disable all Rust-level entry points

use core::panic::PanicInfo;

#[no_mangle] // don't mangle the name of this function
pub extern "C" fn _start() -> ! {
    // this function is the entry point, since the linker looks for a function
    // named `_start` by default
    loop {}
}

/// This function is called on panic.
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
    loop {}
}

最小化内核

VGA 字符模式

内核测试