waf examples: how to modify linker flags/how to process generated exe.

Karel Gardas karel.gardas at centrum.cz
Mon Nov 23 18:31:42 UTC 2020


I'm slowly researching amd64 BSP multiboot domain and I'm curious if it
is possible based on waf BSP's options to change either (or both)
linker/gcc linking options (E.g. to add -z max-page-size=1000) and or
process generated exe by other tool like objcopy (to create elf32 from

My findings so far:

- GRUB is able to load 64bit ELF for both multiboot and multiboot2

- GRUB is able to load 32bit ELF generated from 64bit for multiboot

- Qemu supports multiboot only (not multiboot2!)

- Qemu is picky and supports only 32bit ELF for multiboot load

Caveat: by "load" I mean (in case of GRUB) that multiboot or multiboot2
command invoked with <elf file> parameter executes without complain from
GRUB itself. Also that grub-file --is-x86-multiboot(2) <file> exits with
0 result which signals GRUB claims that's multiboot(2) file.

Note: all my experiments so far are "how the heck to put multiboot(2)
header into RTEMS AMD64 BSP exe and make GRUB or Qemu or even both
happy" category. So it's just the first step for now. Putting multiboot
header into elf and in recognizable way...

For this, knowing some examples how to modify waf/wscript of the bsp
would be great to have...


More information about the devel mailing list