You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/this-month/2021-12/index.md
+38-1Lines changed: 38 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,44 @@ In this section, we give an overview of notable changes to the projects hosted u
36
36
37
37
The `x86_64` crate provides various abstractions for `x86_64` systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.
38
38
39
-
In December, …
39
+
We merged the following changes in December:
40
+
41
+
-[Fix build error on the latest nightly (`asm!` import)](https://github.com/rust-osdev/x86_64/pull/329)
42
+
-[Remove `const_assert!` in favor of std's `assert!`](https://github.com/rust-osdev/x86_64/pull/326)
The `bootloader` crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables.
54
+
55
+
This month, we released new patch versions for both `v0.9` and `v0.10` to fix the `asm!` macro imports on the latest Rust nightlies:
56
+
57
+
-[[v0.9] Update x86_64 dependency to `v0.14.7` to fix nightly breakage](https://github.com/rust-osdev/bootloader/pull/208) <spanclass="gray">(published as `v0.9.20`)</span>
58
+
-[Fix `asm` imports on latest nightly](https://github.com/rust-osdev/bootloader/pull/209) <spanclass="gray">(published as `v0.10.10`)</span>
59
+
60
+
We also continued the work on the upcoming `v0.11` version, which will feature the following improvements:
61
+
62
+
- Configuration via Rust structs and the `entry_point` macro, instead of a `[package.metadata.bootloader]` table in the `Cargo.toml`.
63
+
- The config data is serialized at compile time and put into a separate ELF section of the kernel executable.
64
+
- This makes it possible to read the config data dynamically when loading the kernel, so we no longer need to recompile the bootloader on config changes.
65
+
- The build process is also simplified as we don't need to read the kernel's `Cargo.toml` anymore.
66
+
- Instead of including the kernel ELF file using the [`include_bytes`](https://doc.rust-lang.org/stable/core/macro.include_bytes.html) macro, we read the file dynamically from disk during the boot process.
67
+
- The boot image is now a proper FAT partition for both UEFI and BIOS. The kernel file is simply copied to this partition.
68
+
- In combination with the new config mechanism, the dynamic loading means that the bootloader only needs to be compiled once.
69
+
- The bootloader crate is split into three subcrates:
70
+
- an API crate that defines the configuration and boot information structs, and provides the `entry_point` macro (this will be used by kernels)
71
+
- an implementation crate that contains the actual BIOS and UEFI bootloader code
72
+
- a builder crate that allows to turn kernel ELF files into bootable disk images
73
+
- includes the compiled implementation crate, either by including a precompiled binary or through cargo's upcoming [_artifact dependencies_](https://github.com/rust-lang/cargo/pull/9992) feature
74
+
75
+
The [new configuration system](https://github.com/rust-osdev/bootloader/commit/b3df5e8debad2cfd9d0cad5c4b3914568ec613c7) is already done and working for both the BIOS and UEFI implementations. For UEFI, we also implemented the [kernel loading from a FAT partition](https://github.com/rust-osdev/bootloader/commit/a9c8e9e79cf58cd6b0a0a9024fc06be00bc7f2df) already. Unfortunately, this part is more challenging for the BIOS implementation since the loading needs to happen in 16-bit real mode (as it requires calling functions of the BIOS). Parsing a FAT filesystem is not easy using assembly code, so we're currently working on porting all the lower boot stages to Rust. This includes the [boot sector](https://github.com/rust-osdev/bootloader/tree/next/bios/first_stage), which needs to fit into 448 bytes, so we need some trickery to get a Rust executable that is small enough.
0 commit comments