Skip to content

multiboot2_header: README.md #191

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

Closed
hwoy opened this issue Nov 25, 2023 · 2 comments · Fixed by #197
Closed

multiboot2_header: README.md #191

hwoy opened this issue Nov 25, 2023 · 2 comments · Fixed by #197
Assignees

Comments

@hwoy
Copy link

hwoy commented Nov 25, 2023

MULTIBOOT2_HDR is an address of array, not an array.

#[used]
#[no_mangle]
#[link_section = ".text.multiboot2_header"]
static MULTIBOOT2_HDR: &[u8; 64] = include_bytes!("mb2_hdr_dump.bin");

It should be below.

macrorules! mb2_hdr_bytes
{
  ()=>
  {
    include_bytes!("mb2_hdr_dump.bin")
  };
}

#[used]
#[no_mangle]
#[link_section = ".text.multiboot2_header"]
static MULTIBOOT2_HDR: [u8; 64] = *include_bytes!("mb2_hdr_dump.bin");
// or static MULTIBOOT2_HDR: [u8; mb2_hdr_bytes!().len()] = *mb2_hdr_bytes!();
@phip1611
Copy link
Member

Yes, looks sensible! Thanks!

@phip1611 phip1611 self-assigned this Nov 29, 2023
@hwoy
Copy link
Author

hwoy commented Nov 30, 2023

I think this part of document is important,
multiboot2_header was designed to generate multiboot2 header at run time not compile time.

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

Successfully merging a pull request may close this issue.

2 participants