Crate os

source · []
Expand description

The main module and entrypoint

Various facilities of the kernels are implemented as submodules. The most important ones are:

  • trap: Handles all cases of switching from userspace to the kernel
  • syscall: System call handling and implementation

The operating system also starts in this module. Kernel code starts executing from entry.asm, after which rust_main() is called to initialize various pieces of functionality. (See its source code for details.)

We then call batch::run_next_app() and for the first time go to userspace.

Modules

batch subsystem

board 🔒
console 🔒

SBI console driver, for text output

The panic handler

Global logger

SBI call wrappers

Synchronization and interior mutability primitives

Implementation of syscalls

Trap handling functionality

Macros

Print! to the host console using the format string and arguments.

Println! to the host console using the format string and arguments.

Functions

clear_bss 🔒

clear BSS segment

the rust entry-point of os