Multiboot Info issues in Rust

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
tux7k
Posts: 1
Joined: Fri Mar 29, 2024 6:26 pm

Multiboot Info issues in Rust

Post by tux7k »

This morning I started working on a "kernel" in Rust. I cloned the rust-barebones-kernel repo by thepowersgang on GitHub. After getting IDT working, I went ahead and started working on Multiboot2 info struct parsing. The value that gets passed on for the pointer is equal to 0x9500 on QEMU, which I believe is the physical address. When trying to use this value to parse it into a struct, I just get a page fault and nothing else. After doing some research I figured I might have to add the kernel base (located at 0xFFFFFFFF80000000), which does "work" but leads to crazy values in the multiboot tag struct (type: 129920, size: 2147549183).

Here is my code in a gist (sorry if gists are not accepted, first time posting here)

Thanks for any help y'all can give :D
Octocontrabass
Member
Member
Posts: 5418
Joined: Mon Mar 25, 2013 7:01 pm

Re: Multiboot Info issues in Rust

Post by Octocontrabass »

Multiboot and Multiboot2 have different boot information formats. You're trying to parse Multiboot2 boot information, but your bootloader is giving you Multiboot boot information.
Post Reply