Update from previous chapters.

This commit is contained in:
Yifan Wu 2021-01-06 00:19:10 +08:00
parent 3851c2d561
commit c33c0f8aea
7 changed files with 31 additions and 21 deletions

View file

@ -11,7 +11,7 @@ mod lang_items;
#[no_mangle]
#[link_section = ".text.entry"]
pub extern "C" fn _start() -> ! {
syscall::sys_exit(main());
exit(main());
panic!("unreachable after sys_exit!");
}
@ -22,4 +22,9 @@ fn main() -> i32 {
}
pub use syscall::*;
use syscall::*;
pub fn write(fd: usize, buf: &[u8]) -> isize { sys_write(fd, buf) }
pub fn exit(exit_code: i32) -> isize { sys_exit(exit_code) }
pub fn yield_() -> isize { sys_yield() }
pub fn get_time() -> isize { sys_get_time() }