OSDev.org

The Place to Start for Operating System Developers
It is currently Mon Sep 16, 2019 11:15 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Kernel Larger than 14 MB linker script
PostPosted: Mon Aug 12, 2019 5:48 pm 
Offline

Joined: Sun Aug 11, 2019 5:36 pm
Posts: 2
Hi,

There is a hold between the guaranteed 14MB if exist and rest of the free memory.
How would one write a linker script so say a kernel larger than 14 MB can be loaded at 1M location as it will be necessary to let linker aware of the hole.

I am no master of linker script. Only way I can think of is to do trail and error and find out where is the approximate cutoff of 14 MB in code. Then setup a section at the cutoff and advance the location counter to accommodate the hole. But this method is tedious. May I ask is there any other way or we should just not load at 1M if kernel is larger than 14 MB?


Top
 Profile  
 
 Post subject: Re: Kernel Larger than 14 MB linker script
PostPosted: Mon Aug 12, 2019 10:12 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 239
Not even my Linux kernel is that large. If my kernel was so large that it caused problems with the available physical memory, I think I would go with a loader kernel. That is, create a second kernel that sets up paging and then jumps to the original kernel. The original kernel is then a normal ELF executable, only with a really high .text address. If the original kernel is loaded as module or initrd, GRUB (or whatever) will be able to put it wherever it fits. And using virtual memory means even the kernel itself does not really need to care where it was loaded.

Anyway, I don't think that a linker script is the right way to address this.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 6 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