OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 18, 2024 5:00 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [SOLVED] Can't load module with GRUB2
PostPosted: Sat Sep 09, 2017 10:33 am 
Offline
Member
Member

Joined: Sun Sep 06, 2015 5:40 am
Posts: 47
I am trying to load a module (a flat binary file) using GRUB2. I have put the file I want to load at the root of the ISO and then modified my grub.cfg to:
Code:
...
  multiboot2 /boot/kernel.bin
  module /test_program.bin
  boot
...


I am then trying to read the information about this module using the multiboot2 crate (my OS is written in Rust) with this code (just to test the number of modules loaded):
Code:
    let boot_info = unsafe { multiboot2::load(multiboot_ptr) };
    println!("Detected {} modules", boot_info.module_tags().count());


This reports that 0 modules have been loaded. I am fairly sure the parsing of the multiboot header is working as intended, as I am using it for page frame allocation etc. successfully. Thanks in advance!

_________________
OS on Github | My Rust ACPI library


Last edited by isaacwoods on Sat Sep 09, 2017 12:56 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Can't load module with GRUB2
PostPosted: Sat Sep 09, 2017 11:59 am 
Offline
Member
Member

Joined: Fri Aug 19, 2016 10:28 pm
Posts: 360
Try "module2" instead of "module" may be.


Top
 Profile  
 
 Post subject: Re: Can't load module with GRUB2
PostPosted: Sat Sep 09, 2017 12:56 pm 
Offline
Member
Member

Joined: Sun Sep 06, 2015 5:40 am
Posts: 47
That works! Thanks very much, albeit at the cost of making me feel a little stupid :oops:

_________________
OS on Github | My Rust ACPI library


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: belliash, Google [Bot] and 372 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group