#multiboot2 #byte #header #memory #structures #tags #helper

no-std multiboot2-common

Common helpers for the multiboot2 and multiboot2-header crates

5 releases

0.2.1 Sep 19, 2024
0.2.0 Sep 17, 2024
0.1.2 Aug 24, 2024
0.1.1 Aug 20, 2024
0.1.0 Aug 20, 2024

#158 in No standard library

Download history 193/week @ 2024-08-16 188/week @ 2024-08-23 39/week @ 2024-08-30 64/week @ 2024-09-06 510/week @ 2024-09-13 4954/week @ 2024-09-20 2870/week @ 2024-09-27 3091/week @ 2024-10-04 3615/week @ 2024-10-11 3073/week @ 2024-10-18 4052/week @ 2024-10-25 3598/week @ 2024-11-01 4334/week @ 2024-11-08 3001/week @ 2024-11-15 2512/week @ 2024-11-22 2757/week @ 2024-11-29

13,139 downloads per month
Used in 5 crates (2 directly)

MIT/Apache

1MB
529 lines

multiboot2-common

crates.io docs

Common helpers for the multiboot2 and multiboot2-header crates.

Architecture Diagrams

The following figures, not displayable in lib.rs / on docs.rs unfortunately, outline the design of this crate. In the following figure, you can see the four classes of Multiboot2 structures and their memory properties. The four kinds of Multiboot2 structures are boot information, boot information tags, header, and header tags. All share the same technical foundation: They have a common header and a possible dynamic size, depending on the header.

Overview Multiboot2 structures

In the next figure, you see how the types from multiboot2-common are used to parse a raw byte slice as the corresponding Multiboot2 structure a safe manner. The BytesRef wrapper ensures basic memory guarantees for the underlying &[u8] slice, while DynSizedStructure can then be used to safely cast to the target type.

Generic parsing flow overview

The next figure is like the previous figure, but shows a more specific parsing flow by using types of the multiboot2 crate. Green shows the raw memory. Purple boxes refers to logic in multiboot2-common. Red components show structs from the multiboot2 crate.

Specific parsing flow overview

The last complex figure shows all traits and structs from multiboot2-common, their internal relation, and how consumers (multiboot2 and multiboot2-header) consume them. As this figure is quite complex, we recommend to first study the inner box (multiboot2-common) and then study how types from multiboot2 (orange) and multiboot2-header (green) interface with multiboot2-common.

Architecture overview

MSRV

The MSRV is 1.75.0 stable.

License & Contribution

See main README file.

Dependencies