OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Dec 08, 2021 1:02 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Modular kernel basic design question..
PostPosted: Fri Sep 17, 2021 8:35 am 
Offline

Joined: Thu May 30, 2013 5:17 am
Posts: 2
Hello There,
Am in mist of designing and writing up modular OS with ability to load and unload various modules once kernel loads up. Have written my own basic boot loader code to load up my custom OS . However researching further shows that I can also use GRUB2 as a boot loader. GRUB2 has various stock modules that it can load before booting my kernel. GRUB2 documentation mentions that it complies with multiboot 2 spec. Seems like once my kernel is booted I can use multiboot2 structure to locate and identify the modules that are loaded by GRUB2 boot loader.
Am wondering if I can take advantage of these modules that are loaded by GRUB2 in my kernel. or if I can access any functionality from these modules within my kernel.

Thanks in advance..


Top
 Profile  
 
 Post subject: Re: Modular kernel basic design question..
PostPosted: Fri Sep 17, 2021 8:52 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 3498
It sounds like you've mixed up GRUB modules and Multiboot modules.

GRUB modules are used by GRUB to do things like access different filesystems. GRUB includes GRUB modules.

Multiboot modules are whatever additional files you want the bootloader to put into memory before your kernel starts running. GRUB does not include Multiboot modules.


Top
 Profile  
 
 Post subject: Re: Modular kernel basic design question..
PostPosted: Fri Sep 17, 2021 9:25 am 
Offline

Joined: Thu May 30, 2013 5:17 am
Posts: 2
Yes you are correct.. sorry about mixup..I was referring to mutiboot2 compliant modules that GRUB2 can load.. Wondering if I can use that architecture and and if so are there any examples surrounding that anyone knows of.. thanks again..


Top
 Profile  
 
 Post subject: Re: Modular kernel basic design question..
PostPosted: Fri Sep 17, 2021 10:07 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 3498
I don't know of any examples, but Multiboot2 modules are extremely simple. The bootloader copies the file into memory and gives you a pointer to it. Your kernel is responsible for parsing the file's contents.

If you include the module alignment tag in your Multiboot header, the modules will be loaded at page-aligned addresses. You can then use paging to put your module's code and data at reasonable virtual addresses without having to copy the entire file elsewhere in memory.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 10 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