OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 3:08 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to force linker to include kernel entry point before C?
PostPosted: Mon Oct 25, 2021 12:16 pm 
Offline
Member
Member

Joined: Sat Oct 23, 2021 5:36 am
Posts: 26
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 :D


Top
 Profile  
 
 Post subject: Re: How to force linker to include kernel entry point before
PostPosted: Mon Oct 25, 2021 12:21 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5103
Add ELF support to your custom bootloader. :P

...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.


Top
 Profile  
 
 Post subject: Re: How to force linker to include kernel entry point before
PostPosted: Mon Oct 25, 2021 12:58 pm 
Offline
Member
Member

Joined: Sat Oct 23, 2021 5:36 am
Posts: 26
Octocontrabass wrote:
Add ELF support to your custom bootloader. :P

...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.


I thought of doing that, but I want the bootloader to be as simple as possible.

The second approach sounds better to me, I'll look into it. Thanks! :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 175 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group