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
  • task: Task management
  • 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 task::run_first_task() and for the first time go to userspace.

Modulesยง

board ๐Ÿ”’
Constants used in rCore for qemu
config ๐Ÿ”’
Constants used in rCore
console ๐Ÿ”’
SBI console driver, for text output
lang_items ๐Ÿ”’
The panic handler
loader ๐Ÿ”’
Loading user applications into memory
logging ๐Ÿ”’
sbi ๐Ÿ”’
SBI call wrappers
sync ๐Ÿ”’
Synchronization and interior mutability primitives
syscall
Implementation of syscalls
task
Task management implementation
timer ๐Ÿ”’
RISC-V timer-related functionality
trap
Trap handling functionality

Macrosยง

print
print string macro
println
println string macro

Functionsยง

clear_bss ๐Ÿ”’
clear BSS segment
rust_main
the rust entry-point of os