jasondyoungberg/limine-rs

Barebones example does not build

Closed this issue · 1 comments

I tried to compile the code and it does not because the get function is marked as unsafe and also the mmap print uses the wrong capitalization so that would again prevent it from compiling

The fix should be this i think

#[no_mangle]
extern "C" fn x86_64_barebones_main() -> ! {
    println!("Hello, rusty world!\n");

    let bootloader_info = BOOTLOADER_INFO
        .get_response()
        .get()
        .expect("barebones: recieved no bootloader info");

    println!(
        "bootloader: (name={}, version={})",
        bootloader_info.name.to_string().unwrap(),
        bootloader_info.version.to_string().unwrap()
    );

    let mmap_err = "barebones: recieved no mmap";
    let mmap = MMAP
        .get_response()
        .get()
        .expect(mmap_err)
        .mmap()
        .expect(mmap_err);
    println!("mmap: {:#x?}", MMAP);

    loop {}
}

Let me know if everything is ok