I can't really find a definite answer anywhere and I'd like to know.
I made my own bootloader and a mini-kernel in assembly for learning purposes and I'd like to continue in C (though I need minimal amount assembly for the entry point).
The "Bare Bones" tutorial shows how to use GRUB and I think steps outlined by it aren't relevant for a custom bootloader.
Thanks in advance
How to force linker to include kernel entry point before C?
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: How to force linker to include kernel entry point before
Add ELF support to your custom bootloader.
...Or, if you really want to use a flat binary, put the entry point code in a separate section and then use your linker script to put that section first in the binary. The Bare Bones tutorial already does this with the multiboot header, so you can use that as an example.
...Or, if you really want to use a flat binary, put the entry point code in a separate section and then use your linker script to put that section first in the binary. The Bare Bones tutorial already does this with the multiboot header, so you can use that as an example.
Re: How to force linker to include kernel entry point before
I thought of doing that, but I want the bootloader to be as simple as possible.Octocontrabass wrote:Add ELF support to your custom bootloader.
...Or, if you really want to use a flat binary, put the entry point code in a separate section and then use your linker script to put that section first in the binary. The Bare Bones tutorial already does this with the multiboot header, so you can use that as an example.
The second approach sounds better to me, I'll look into it. Thanks!