OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 27, 2024 7:55 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Do I need multiboot2?
PostPosted: Tue Dec 26, 2023 11:03 am 
Offline
Member
Member
User avatar

Joined: Sun Jul 21, 2019 7:34 am
Posts: 300
Hi.
I am writing a simple 32-bit protected mode kernel and now I plan to start implementing memory management tools, for this I should refer to the information that GRUB gives me. I am currently using the multiboot specification of the first version and I am thinking whether it is worth implementing multiboot2 first. Should I use multiboot2 in my core? What will it give me?
Please advise how to solve this issue.


Top
 Profile  
 
 Post subject: Re: Do I need multiboot2?
PostPosted: Tue Dec 26, 2023 1:17 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
For memory management, the only thing Multiboot2 gives you that Multiboot doesn't is the relocatable header tag, which you can use to tell the bootloader it can load your kernel at a different address if the one you specified in your linker script isn't available. If you're not planning on using that tag, then Multiboot2 makes no real difference to your memory management. (UEFI doesn't guarantee memory will be available at 1MiB the way legacy BIOS does, so the relocatable header tag gives you a way to make your OS run on more PCs. However, you have to write the code to handle being loaded at a different address.)

In general, Multiboot2 gives you better UEFI support. Even if you don't use the relocatable header tag, it still gives you access to the EFI system table and the ACPI RSDP on UEFI PCs.


Top
 Profile  
 
 Post subject: Re: Do I need multiboot2?
PostPosted: Tue Dec 26, 2023 2:48 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 21, 2019 7:34 am
Posts: 300
Octocontrabass wrote:
UEFI doesn't guarantee memory will be available at 1MiB the way legacy BIOS does

Does GRUB boot the kernel using UEFI or BIOS? I would like to be sure that the BIOS will boot me, how can I ask GRUB for this?


Top
 Profile  
 
 Post subject: Re: Do I need multiboot2?
PostPosted: Tue Dec 26, 2023 3:29 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
mrjbom wrote:
Does GRUB boot the kernel using UEFI or BIOS?

GRUB uses whatever is available.

mrjbom wrote:
I would like to be sure that the BIOS will boot me, how can I ask GRUB for this?

GRUB doesn't control that. If you want to choose BIOS or UEFI, you have to use the firmware's boot menu. Some new PCs don't support BIOS.


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: SemrushBot [Bot] and 15 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