Seemingly corrupt Multiboot info structure?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
torii
Posts: 14
Joined: Sun Feb 02, 2025 5:59 pm
GitHub: https://github.com/Toriiiiiiiiii
Contact:

Seemingly corrupt Multiboot info structure?

Post by torii »

Hi all, its been a while since I last posted anything here.
I am working on parsing a Multiboot1 info header in my kernel, however some of the information is seemingly corrupt.
I believe I am checking against the correct bits in the flags field, however this is the only thing I can think of that explains it.

Certain fields, such as framebuffer information and boot device information appears to be invalid. I have attached a screenshot of the output, and the link to my kernel's source code. Any help solving this would be appreciated! :D

https://github.com/Toriiiiiiiiii/Solkern
mb issues.png
mb issues.png (4.04 KiB) Viewed 2649 times
Writing bad code since 2019
Image Image
User avatar
iansjack
Member
Member
Posts: 4811
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Seemingly corrupt Multiboot info structure?

Post by iansjack »

Code: Select all

uint32_t vbe_mode; 
uint32_t vbe_interface_seg;
uint32_t vbe_interface_off;
uint32_t vbe_interface_len;
These should be uint16_t.
torii
Posts: 14
Joined: Sun Feb 02, 2025 5:59 pm
GitHub: https://github.com/Toriiiiiiiiii
Contact:

Re: Seemingly corrupt Multiboot info structure?

Post by torii »

I can confirm that after changing this, I am still receiving a similar output - the framebuffer appears more reasonable but the boot drive fields do not appear correct.
Writing bad code since 2019
Image Image
torii
Posts: 14
Joined: Sun Feb 02, 2025 5:59 pm
GitHub: https://github.com/Toriiiiiiiiii
Contact:

Re: Seemingly corrupt Multiboot info structure?

Post by torii »

ugh never mind, turns out i was greatly misinterpreting drive numbers. I was loading the image as a cdrom with grub, which explains the drive number assignment of 0xe0. Im still not entirely sure why the partition number is 0xff though, I would've thought it would be 0x00?
Writing bad code since 2019
Image Image
User avatar
iansjack
Member
Member
Posts: 4811
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Seemingly corrupt Multiboot info structure?

Post by iansjack »

I don't know the authoritative answer to that, but I'm guessing that - as cd roms don't have partitions - it's setting the partition numbers all to -1.
Octocontrabass
Member
Member
Posts: 5873
Joined: Mon Mar 25, 2013 7:01 pm

Re: Seemingly corrupt Multiboot info structure?

Post by Octocontrabass »

torii wrote: Wed Jun 25, 2025 1:37 pmIm still not entirely sure why the partition number is 0xff though, I would've thought it would be 0x00?
The spec says unused partition bytes will be set to 0xFF. Optical discs usually aren't partitioned.
Post Reply