diff --git a/blog/intro.org b/blog/intro.org index 58680ea..4a0d32c 100644 --- a/blog/intro.org +++ b/blog/intro.org @@ -162,9 +162,12 @@ cargo -Zjson-target-spec build --target x86_64-unknown-kernel.json #+begin_src toml [unstable] json-target-spec = true # lets us specify a custom target specification file +build-std-features = ["compiler-builtins-mem"] build-std = ["core", "compiler_builtins"] #+end_src +Because we plan on using builtin functions like =memcpy=, we tell cargo to build the =compiler_builtins= crate with the =mem= feature enabled. + Rust permits the user to abort the program at any time by calling the =panic!= macro, or a function that “panics” internally. Typically, the mechanism by which this happens, as well as the more complex behaviour of unwinding the stack and catching unwinds, is provided by the =std=. Since we’ve opted out of using =std=, we will need to provide a panic handler for rust to call in case of a panic. Unwinding is already disabled by the =panic-strategy= field in our target specification file. For the time being, we will again simply spin in an infinite loop whenever a panic occurs: