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`?
9. no_std and Feature Verification - Rust Engineering Practices
Rust's standard library assumes an operating system beneath it - files, networking, threads, and a heap. This chapter splits Rust into three stacked layers: core, which needs nothing and is always th…