From 4cad6a2b17ab35dd047aed2617a06ffb297fafaf Mon Sep 17 00:00:00 2001 From: janis Date: Sat, 18 Jul 2026 20:42:46 +0200 Subject: [PATCH] link more references/inspiration, small elaborations --- blog/intro.org | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blog/intro.org b/blog/intro.org index ae5d66f..a337e4c 100644 --- a/blog/intro.org +++ b/blog/intro.org @@ -17,6 +17,8 @@ The journey that I will hopefully document in this blog, both learning my self a This is both because writing an assembler and multiple compilers from scratch is a lot of very tedious work, and because Rust is, in my opinion, the best language available for the task at hand. * Initial Setup + https://os.phil-opp.com/ + https://wiki.osdev.org/Limine_Bare_Bones We will start by setting up a development environment using the equally awesome nix package manager, which allows us to declaratively specify which software we need and have them made available to us on any system where nix is available. @@ -71,6 +73,7 @@ This is both because writing an assembler and multiple compilers from scratch is } #+end_src This is a lot of code to essentially just say that we would like to have the latest nightly version of Rust as well as a standard collection of build tools available. +We specifically add the =rust-src= component to the Rust derivation because we will need to build the standard library ourselves in a later step. To automatically load the proper environment when entering the project directory, we will also create a .envrc file with the following contents: #+begin_src bash @@ -179,7 +182,7 @@ A list of unstable cargo features can be found [[https://doc.rust-lang.org/cargo =core= implies =compiler_builtins=, but since =build-std= is an unstable feature and may change in the future, we explicitly specify both to be safe. =build-std-features= takes a list of features to pass to the crates specified in =build-std=. -For a complete list of crates and features, I recommend exploring the =library= directory of the Rust source code. +For a complete list of crates and features, I recommend exploring the =library= directory of the Rust source code. Note that not only the crates specified in the =members= field of a workspace =Cargo.toml= are members, but also any path dependencies. 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.