Skip to content

Multiboot cleanup #57

@brho

Description

@brho

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions