Hello!
So, as you can see above, I'm wondering if GRUB2 can load/boot a flat-binary kernel.
At this time, I'm compiling my kernel as ELF, but I would like to compile it as flat-binary in the future.
So, can GRUB2 boot a flat-binary kernel?
If yes, how? (I already googled a lot, but couln'd find anything helpful)
So long,
tuxid.
Can GRUB2 boot a flat-binary kernel?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Can GRUB2 boot a flat-binary kernel?
Care to explain why? You're probably making things more difficult for yourself than needed.tuxid wrote:But I would like to compile it as flat-binary in the future.
It's called the a.out kludge.If yes, how?
Re: Can GRUB2 boot a flat-binary kernel?
Yes. Your flat-binary just needs the multiboot header, 4-byte aligned in the first 8192 bytes of the file.
Although, flat-binary is kind of a pain since you don't get the benefits of an actual executable format (tools for examining the binary, bss section not stored as literal zeros in the file, easy access to debug symbols, virtual address space placement of sections).
Although, flat-binary is kind of a pain since you don't get the benefits of an actual executable format (tools for examining the binary, bss section not stored as literal zeros in the file, easy access to debug symbols, virtual address space placement of sections).
Re: Can GRUB2 boot a flat-binary kernel?
Combuster wrote:Care to explain why? You're probably making things more difficult for yourself than needed.
Explaintion ist pretty simple, I'm just always searching for a challenge (one reason why I began to develop a OS) and/or other techniques to solve a problem, hahaRusky wrote:Yes. Your flat-binary just needs the multiboot header, 4-byte aligned in the first 8192 bytes of the file.
Although, flat-binary is kind of a pain since you don't get the benefits of an actual executable format (tools for examining the binary, bss section not stored as literal zeros in the file, easy access to debug symbols, virtual address space placement of sections).
But you guys got some good points, so I will stay with ELF in the future, as I got my kernel up & running with it.
(Maybe I'm going to switch to a flat-binary-kernel at a later point.)
@Rusky: Of course I got a multiboot header, also with the header adress-fields set. Got surely something wrong there.