Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiboot cleanup #57

Open
brho opened this issue Apr 10, 2019 · 0 comments
Open

Multiboot cleanup #57

brho opened this issue Apr 10, 2019 · 0 comments

Comments

@brho
Copy link
Owner

brho commented Apr 10, 2019

Dan mentioned that multiboot's tables can be anywhere in memory - let alone an initrd. Right now, we don't use an initrd, and we copy-out the command line. But if we ever want to bother with an initrd, we'll need to account for that when bootstrapping the memory allocator.

Additionally, our current process of iterating over the MBI free regions is technically unsafe, since a dastardly bootloader could have put the tables right after our kernel image. You can't write to any RAM outside of your kernel image (to include the BSS) and still read the MBI. Multiboot's structures sit in memory that it marks FREE. Thanks.

The simplest fix is to copy-in the fixed-size multitboot info, into the BSS. I'd consider making an array of memory-map info structs too, and even making fake RESERVED ones for things like the initrd.

This won't be a big deal until / if we use an initrd, since in practice the tables themselves are out of harms way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant