|
5 | 5 |
|
6 | 6 | Common helpers for the `multiboot2` and `multiboot2-header` crates.
|
7 | 7 |
|
8 |
| -## Architecture |
| 8 | +## Architecture Diagrams |
9 | 9 |
|
10 | 10 | The following figures, not displayable in `lib.rs` / on `docs.rs` unfortunately,
|
11 |
| -outline the design of this crate: |
12 |
| - |
13 |
| - |
14 |
| - |
15 |
| -Overview of Multiboot2 structures: Multiboot2 boot information, boot |
16 |
| -information tags, Multiboot2 headers, and Multiboot2 header tags all share the |
17 |
| -same technical foundation: They have a common header and a possible dynamic |
18 |
| -size, depending on the header. |
19 |
| - |
20 |
| - |
21 |
| - |
22 |
| -Overview of how raw bytes are modelled to be representable by high-level |
23 |
| -ABI-compatible rusty types. |
| 11 | +outline the design of this crate. In the following figure, you can see the |
| 12 | +four classes of Multiboot2 structures and their memory properties. The four |
| 13 | +kinds of Multiboot2 structures are boot information, boot information |
| 14 | +tags, header, and header tags. All share the same technical foundation: They |
| 15 | +have a common header and a possible dynamic size, depending on the header. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +In the next figure, you see how the types from `multiboot2-common` are used |
| 20 | +to parse a raw byte slice as the corresponding Multiboot2 structure a safe |
| 21 | +manner. The `BytesRef` wrapper ensures basic memory guarantees for the |
| 22 | +underlying `&[u8]` slice, while `DynSizedStructure` can then be used to |
| 23 | +safely cast to the target type. |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +The last complex figure shows all traits and structs from `multiboot2-common`, |
| 28 | +their internal relation, and how consumers (`multiboot2` and |
| 29 | +`multiboot2-header`) consume them. As this figure is quite complex, we recommend |
| 30 | +to first study the inner box (`multiboot2-common`) and then study how types from |
| 31 | +`multiboot2` (orange) and `multiboot2-header` (green) interface with |
| 32 | +`multiboot2-common`. |
| 33 | + |
| 34 | + |
24 | 35 |
|
25 | 36 | ## MSRV
|
26 | 37 |
|
|
0 commit comments