OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 1:32 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: GNU LD max-page-size for Multiboot2 header on elf64
PostPosted: Mon Aug 02, 2021 8:53 am 
Offline

Joined: Mon Aug 02, 2021 8:41 am
Posts: 1
I am using the following bit of assembly to insert a Multiboot2 header to my kernel:
Code:
.set LENGTH, (header_end - header_start)
.set ARCH, 0
.set MAGIC, 0xE85250D6
.set CHECKSUM, -(MAGIC + ARCH + LENGTH)

.section .multiboot
header_start:
    .int MAGIC /* Magic number */
    .int ARCH /* x86 protected mode */
    .int LENGTH /* Header length */
    .int CHECKSUM /* Multiboot2 checksum */
    /* Set the end flag */
    .word 0 /* Type */
    .word 0 /* Flag */
    .int 8 /* Size */
header_end:


I am using binutils 2.37 to assemble and link the kernel (cross-compiled to the x86_64-elf target).
The kernel thus formed fails the multiboot2 test:
Code:
grub-file --is-x86-multiboot2 build/simple-os.bin || echo "Not multiboot 2"


The Wiki mentions an issue here: https://wiki.osdev.org/Multiboot#Multiboot_2.
The fix suggested is to set the max-page-size while linking.
What would be the correct size to set?


Top
 Profile  
 
 Post subject: Re: GNU LD max-page-size for Multiboot2 header on elf64
PostPosted: Thu Aug 05, 2021 8:08 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5143
Set it to the smallest page size: 0x1000.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Amazonbot [bot], Google [Bot], scippie, SemrushBot [Bot] and 159 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