@@ -46,25 +46,25 @@ use multiboot2_header::{HeaderTagFlag, HeaderTagISA, MbiTagType, RelocatableHead
46
46
47
47
/// Small example that creates a Multiboot2 header and parses it afterwards.
48
48
fn main () {
49
- // We create a Multiboot2 header during runtime here. A practical example is that your
50
- // program gets the header from a file and parses it afterwards.
51
- let mb2_hdr_bytes = Multiboot2HeaderBuilder :: new (HeaderTagISA :: I386 )
52
- . relocatable_tag (RelocatableHeaderTag :: new (
53
- HeaderTagFlag :: Required ,
54
- 0x1337 ,
55
- 0xdeadbeef ,
56
- 4096 ,
57
- RelocatableHeaderTagPreference :: None ,
58
- ))
59
- . information_request_tag (
60
- InformationRequestHeaderTagBuilder :: new (HeaderTagFlag :: Required )
61
- . add_irs (& [MbiTagType :: Cmdline , MbiTagType :: BootLoaderName ]),
62
- )
63
- . build ();
64
-
65
- // Cast bytes in vector to Multiboot2 information structure
66
- let mb2_hdr = unsafe { Multiboot2Header :: from_addr (mb2_hdr_bytes . as_ptr (). cast ()) };
67
- println! (" {:#?}" , mb2_hdr );
49
+ // We create a Multiboot2 header during runtime here. A practical example is that your
50
+ // program gets the header from a file and parses it afterwards.
51
+ let mb2_hdr_bytes = Multiboot2HeaderBuilder :: new (HeaderTagISA :: I386 )
52
+ . relocatable_tag (RelocatableHeaderTag :: new (
53
+ HeaderTagFlag :: Required ,
54
+ 0x1337 ,
55
+ 0xdeadbeef ,
56
+ 4096 ,
57
+ RelocatableHeaderTagPreference :: None ,
58
+ ))
59
+ . information_request_tag (
60
+ InformationRequestHeaderTagBuilder :: new (HeaderTagFlag :: Required )
61
+ . add_irs (& [MbiTagType :: Cmdline , MbiTagType :: BootLoaderName ]),
62
+ )
63
+ . build ();
64
+
65
+ // Cast bytes in vector to Multiboot2 information structure
66
+ let mb2_hdr = unsafe { Multiboot2Header :: from_addr (mb2_hdr_bytes . as_ptr (). cast ()) };
67
+ println! (" {:#?}" , mb2_hdr );
68
68
}
69
69
```
70
70
@@ -85,7 +85,7 @@ bytes of the ELF. See Multiboot2 specification.
85
85
86
86
## MSRV
87
87
88
- The MSRV is 1.81 .0 stable.
88
+ The MSRV is 1.85 .0 stable.
89
89
90
90
## License & Contribution
91
91
0 commit comments