add #![deny(missing_docs)] AND #![deny(warnings)] in main.rs, and add more comments
This commit is contained in:
parent
2b53281dd8
commit
745ea760d0
20 changed files with 126 additions and 13 deletions
|
@ -1,5 +1,8 @@
|
|||
//! File and filesystem-related syscalls
|
||||
|
||||
const FD_STDOUT: usize = 1;
|
||||
|
||||
/// write buf of length `len` to a file with `fd`
|
||||
pub fn sys_write(fd: usize, buf: *const u8, len: usize) -> isize {
|
||||
match fd {
|
||||
FD_STDOUT => {
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
//! Implementation of syscalls
|
||||
//!
|
||||
//! The single entry point to all system calls, [`syscall()`], is called
|
||||
//! whenever userspace wishes to perform a system call using the `ecall`
|
||||
//! instruction. In this case, the processor raises an 'Environment call from
|
||||
//! U-mode' exception, which is handled as one of the cases in
|
||||
//! [`crate::trap::trap_handler`].
|
||||
//!
|
||||
//! For clarity, each single syscall is implemented as its own function, named
|
||||
//! `sys_` then the name of the syscall. You can find functions like this in
|
||||
//! submodules, and you should also implement syscalls this way.
|
||||
|
||||
const SYSCALL_WRITE: usize = 64;
|
||||
const SYSCALL_EXIT: usize = 93;
|
||||
const SYSCALL_YIELD: usize = 124;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//! Process management syscalls
|
||||
use crate::task::{exit_current_and_run_next, suspend_current_and_run_next};
|
||||
use crate::timer::get_time_ms;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue