diff --git a/kernel/lib.rs b/kernel/lib.rs index ba38597..5a90e4e 100644 --- a/kernel/lib.rs +++ b/kernel/lib.rs @@ -1,68 +1,7 @@ //! # The Redox OS Kernel, version 2 //! -//! The Redox OS Kernel is a hybrid kernel that supports X86 systems and +//! The Redox OS Kernel is a hybrid kernel that supports X86_64 systems and //! provides Unix-like syscalls for primarily Rust applications -//! -//! ## Syscalls -//! Syscalls in Redox are often handled by userspace `schemes`. -//! The essential syscalls in Redox are as follows: -//! -//! ### Open -//! `open(path: &str, flags: usize) -> Result` -//! -//! Open a file, providing a path as a `&str` and flags, defined elsewhere. -//! -//! Returns a number, known as a file descriptor, that is passed to other syscalls -//! -//! ### Close -//! `close(file_descriptor: usize) -> Result<()>` -//! -//! Close a file descriptor, providing the file descriptor from `open` -//! -//! Returns an error, `EBADF`, if the file descriptor was not found. -//! -//! This potential error is often ignored by userspace -//! -//! ### Duplicate -//! `dup(file_descriptor: usize) -> Result` -//! -//! Duplicate a file descriptor, providing the file descriptor from `open` -//! -//! Returns a new file descriptor, or an error -//! -//! ### Read -//! `read(file_descriptor: usize, buffer: &mut [u8]) -> Result` -//! -//! Read from a file descriptor, providing the file descriptor from `open` and a mutable buffer -//! -//! Returns the number of bytes actually read, or an error -//! -//! ### Write -//! `write(file_descriptor: usize, buffer: &[u8]) -> Result` -//! -//! Write to a file descriptor, providing the file descriptor from `open` and a const buffer -//! -//! Returns the number of bytes actually written, or an error -//! -//! ### Stat -//! `fstat(file_descriptor: usize, stat: &mut Stat) -> Result<()>` -//! -//! Get information from a file descriptor, providing the file descriptor from `open` -//! and a mutable Stat struct, defined elsewhere. -//! -//! Returns an error if the operation failed -//! -//! ### Path -//! `fpath(file_descriptor: usize, buffer: &mut [u8]) -> Result` -//! -//! Read the path of a file descriptor, providing the file descriptor from `open` and -//! a mutable buffer. -//! -//! Returns the number of bytes actually read, or an error -//! -//! The buffer should be 4096 bytes, to ensure that the entire path will fit. -//! An error will be returned, `ENOBUFS`, if the buffer is not long enough for the name. -//! In this case, it is recommended to add one page, 4096 bytes, to the buffer and retry. #![feature(alloc)] #![feature(arc_counts)] @@ -215,6 +154,11 @@ pub extern fn kmain_ap(id: usize) { let pid = syscall::getpid(); println!("AP {}: {:?}", id, pid); + // Disable APs for now + loop { + unsafe { interrupt::enable_and_halt(); } + } + loop { unsafe { interrupt::disable(); diff --git a/kernel/scheme/mod.rs b/kernel/scheme/mod.rs index 96e2ef9..58aaa8e 100644 --- a/kernel/scheme/mod.rs +++ b/kernel/scheme/mod.rs @@ -26,37 +26,37 @@ use self::root::{ROOT_SCHEME_ID, RootScheme}; use self::sys::SysScheme; use self::zero::ZeroScheme; -/// Debug scheme +/// `debug:` - provides access to serial console pub mod debug; -/// Kernel events +/// `event:` - allows reading of `Event`s which are registered using `fevent` pub mod event; -/// Environmental variables +/// `env:` - access and modify environmental variables pub mod env; -/// InitFS scheme +/// `initfs:` - a readonly filesystem used for initializing the system pub mod initfs; -/// IRQ handling +/// `irq:` - allows userspace handling of IRQs pub mod irq; -/// Null scheme +/// `null:` - a scheme that will discard all writes, and read no bytes pub mod null; -/// Anonymouse pipe +/// `pipe:` - used internally by the kernel to implement `pipe` pub mod pipe; -/// Root scheme +/// `:` - allows the creation of userspace schemes, tightly dependent on `user` pub mod root; -/// System information +/// `sys:` - system information, such as the context list and scheme list pub mod sys; -/// Userspace schemes +/// A wrapper around userspace schemes, tightly dependent on `root` pub mod user; -/// Zero scheme +/// `zero:` - a scheme that will discard all writes, and always fill read buffers with zero pub mod zero; /// Limit on number of schemes