rust-osdev / multiboot2

Rusty wrappers for Multiboot2.
Apache License 2.0
112 stars 56 forks source link

multiboot2-header: construct header at build time [call for contribution] #198

Open phip1611 opened 10 months ago

phip1611 commented 10 months ago

It would be awesome to construct multiboot2-headers at runtime with macros.

For reference: That's how you write a header in assembly language: https://github.com/rust-osdev/multiboot2/blob/main/integration-test/bins/multiboot2_payload/src/multiboot2_header.S

an-owl commented 5 months ago

I wrote a macro for my own project here feel free to use it. There are examples in the tests module and documentation in lib.rs. It does have a couple of quirks and issues, some that can be fixed easily and one which is a huge pain to deal with.

I did also consider adding a "native" argument for the architecture to get the macro to resolve the arch itself, but with the huge selection of i386 or MIPS I think the user can handle this themselves.

phip1611 commented 5 months ago

Thanks @an-owl - that's awesome!