asterinas/src
Jianfeng Jiang 634d4a5016 add syscall rt_sigaction and rt_sigreturn 2022-11-04 16:31:11 +08:00
..
.cargo add hello_c support 2022-09-26 19:45:01 +08:00
kxos-boot move virtio block device out of kxos frame 2022-10-05 21:56:06 -07:00
kxos-frame add syscall rt_sigaction and rt_sigreturn 2022-11-04 16:31:11 +08:00
kxos-frame-pod-derive add derive procedural macro for pod 2022-10-10 10:28:14 +08:00
kxos-pci move virtio block device out of kxos frame 2022-10-05 21:56:06 -07:00
kxos-rights-proc add procedural macro require 2022-10-24 16:38:46 +08:00
kxos-std add syscall rt_sigaction and rt_sigreturn 2022-11-04 16:31:11 +08:00
kxos-typeflags add procedural macro require 2022-10-24 16:38:46 +08:00
kxos-typeflags-util add syscall execve 2022-10-27 13:13:05 +08:00
kxos-user add syscall rt_sigaction and rt_sigreturn 2022-11-04 16:31:11 +08:00
kxos-util move virtio block device out of kxos frame 2022-10-05 21:56:06 -07:00
kxos-virtio move virtio block device out of kxos frame 2022-10-05 21:56:06 -07:00
src fix the logic to start the first process 2022-09-06 11:41:08 +08:00
tests add tests and hide some pub functions 2022-08-31 23:25:26 -07:00
Cargo.lock move exception handling to kxos-std 2022-11-04 16:18:53 +08:00
Cargo.toml add procedural macro typeflags 2022-10-19 15:07:09 +08:00
README.md Add README for src/ 2022-08-08 13:33:34 -07:00
x86_64-custom.json finish virtual memory and part of task 2022-08-23 02:50:07 -07:00

README.md

KxOS Source Code

Code organization

The codebase is organized as a number of Rust crates.

  • The kxos crate assembles all other crates into a runnable OS kernel image. This is the only binary crate; all other crates are libraries.
  • The kxos-frame crate constitutes the main part of the KxOS framework, providing a minimal set of safe abstractions that encapsulates unsafe Rust code to deal with hardware resources like CPU, memory, and interrupts.
  • The kxos-frame-* crates complement kxos-frame by providing more safe types, APIs, or abstractions that are useful to specific aspects of the KxOS.
  • The kxos-std crate is KxOS's equivalent of Rust's std crate, although their APIs are quite different. This crate offers an extensive set of high-level safe APIs that are widely used throughout the OS code above the framework (i.e., the crates described below).
  • The rest of kxos-* crates implement most of the functionalities of KxOS, e.g., Linux syscall dispatching, process management, file systems, network stacks, and device drivers.

Privilege separation

KxOS is a framekernel, separating the entire OS into two halves: the privileged half (so-called "frame") and the unprivileged half. Only the privileged half is allowed to include any unsafe Rust code. And it is the privileged half's responsibility to encapsulate the unsafe Rust code in safe API so that most of the OS functionalities can be implemented with safe Rust in the unprivileged half.

This philosophy of privilege separationn is also reflected in the code organization.

  • The privileged half consists of kxos, kxos-frame, and kxos-frame-* crates.
  • The unprivileged half consists of kxos-std and the rest kxos-* crates.