Add first user program hello_world.rs
This commit is contained in:
parent
d2c0be3dd0
commit
a97d4e82a5
79 changed files with 343 additions and 0 deletions
23
user/src/lib.rs
Normal file
23
user/src/lib.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
#![no_std]
|
||||
#![feature(llvm_asm)]
|
||||
#![feature(linkage)]
|
||||
#![feature(panic_info_message)]
|
||||
|
||||
#[macro_use]
|
||||
pub mod console;
|
||||
mod syscall;
|
||||
mod lang_items;
|
||||
|
||||
#[no_mangle]
|
||||
#[link_section = ".text.entry"]
|
||||
pub extern "C" fn _start() -> ! {
|
||||
main();
|
||||
loop {}
|
||||
}
|
||||
|
||||
#[linkage = "weak"]
|
||||
#[no_mangle]
|
||||
fn main() -> i32 {
|
||||
panic!("Cannot find main!");
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue