1
1
mod chainloader;
2
- mod grub ;
2
+ mod limine ;
3
3
4
4
use alloc:: format;
5
5
use alloc:: vec:: Vec ;
@@ -16,9 +16,9 @@ pub fn run(mbi: &BootInformation) -> anyhow::Result<()> {
16
16
. name ( )
17
17
. map_err ( anyhow:: Error :: msg) ?;
18
18
19
- if bootloader. to_lowercase ( ) . contains ( "grub " ) {
20
- log:: info!( "loaded by grub " ) ;
21
- grub :: run ( mbi) ?;
19
+ if bootloader. to_lowercase ( ) . contains ( "limine " ) {
20
+ log:: info!( "loaded by Limine " ) ;
21
+ limine :: run ( mbi) ?;
22
22
} else {
23
23
log:: info!( "loaded by chainloader" ) ;
24
24
chainloader:: run ( mbi) ?;
@@ -78,6 +78,15 @@ pub(self) fn print_module_info(mbi: &BootInformation) -> anyhow::Result<()> {
78
78
}
79
79
let module = modules. first ( ) . unwrap ( ) ;
80
80
let module_cmdline = module. cmdline ( ) . map_err ( anyhow:: Error :: msg) ?;
81
+
82
+ let allowed_module_cmdlines = [ "Limine bootloader config" , "multiboot2_payload" ] ;
83
+ assert ! (
84
+ allowed_module_cmdlines
85
+ . iter( )
86
+ . any( |& str | module_cmdline == str ) ,
87
+ "The module cmdline must be one of {allowed_module_cmdlines:?} but is {module_cmdline}"
88
+ ) ;
89
+
81
90
println ! ( "Modules:" ) ;
82
91
println ! (
83
92
" 0x{:010x} - 0x{:010x} ({} B, cmdline='{}')" ,
@@ -86,13 +95,13 @@ pub(self) fn print_module_info(mbi: &BootInformation) -> anyhow::Result<()> {
86
95
module. module_size( ) ,
87
96
module_cmdline
88
97
) ;
89
- println ! ( " grub cfg passed as boot module:" ) ;
98
+ println ! ( " bootloader cfg passed as boot module:" ) ;
90
99
let grup_cfg_ptr = module. start_address ( ) as * const u32 as * const u8 ;
91
100
let grub_cfg =
92
101
unsafe { core:: slice:: from_raw_parts ( grup_cfg_ptr, module. module_size ( ) as usize ) } ;
93
102
94
- // In the GRUB bootflow case, we pass the config as module with it. This is
95
- // not done for the chainloaded case.
103
+ // In the Limine bootflow case, we pass the config as module with it. This
104
+ // is not done for the chainloaded case.
96
105
if let Ok ( str) = core:: str:: from_utf8 ( grub_cfg) {
97
106
println ! ( "=== file begin ===" ) ;
98
107
for line in str. lines ( ) {
0 commit comments