link more references/inspiration, small elaborations

This commit is contained in:
janis 2026-07-18 20:42:46 +02:00
parent 56aa40fb4c
commit 4cad6a2b17
Signed by: janis
SSH key fingerprint: SHA256:bB1qbbqmDXZNT0KKD5c2Dfjg53JGhj7B3CFcLIzSqq8

View file

@ -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 weve 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.