Conceptual
Login

Core, Alloc, and What no_std Means

Rust's standard library assumes an operating system underneath it: files, threads, a heap that never fails. A kernel has none of that, so kernel code opts out with no_std and uses only core, the part of the library that needs nothing, plus whatever allocation support the kernel itself provides. That is why familiar Rust conveniences are missing in kernel code and the kernel supplies its own replacements.

Questions this Concept answers

  • Why does the `kernel` crate supply `KBox` and `KVec` instead of reusing the standard library's `Box` and `Vec`?