This commit is contained in:
Yifan Wu 2020-12-14 16:18:33 +08:00
parent e93a4a0b76
commit 2d34cab989
14 changed files with 218 additions and 18 deletions

View file

@ -9,6 +9,8 @@ pub mod console;
mod syscall;
mod lang_items;
extern crate alloc;
use syscall::*;
use buddy_system_allocator::LockedHeap;
@ -40,6 +42,8 @@ fn main() -> i32 {
panic!("Cannot find main!");
}
pub fn close(fd: usize) -> isize { sys_close(fd) }
pub fn pipe(pipe_fd: &mut [usize]) -> isize { sys_pipe(pipe_fd) }
pub fn read(fd: usize, buf: &mut [u8]) -> isize { sys_read(fd, buf) }
pub fn write(fd: usize, buf: &[u8]) -> isize { sys_write(fd, buf) }
pub fn exit(exit_code: i32) -> ! { sys_exit(exit_code); }