OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 25, 2024 11:17 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: loading a kernel?
PostPosted: Thu Mar 07, 2002 12:17 pm 
Could anyone shed some light on the steps to load a kernel image from a bootloader? Prior to the filesystem presence in memory, there's no way to locate a file on the system. I know that GRUB/LILO/Minix Loader can do this, but they are all hairy due to features/flexibility and what not. If possible, anyone could outline simple steps/tricks to load kernel image into memory? Thanks.


Top
  
 
 Post subject: Re: loading a kernel?
PostPosted: Thu Mar 07, 2002 4:55 pm 
I can't give you step-by-step instructions, but here's a link to a well commented bootsector that loads a kernel off a floppy:

http://www.execpc.com/~geezer/johnfine/bootf02.zip

If you do find info on how how to do it(that's not just some code) please put up a link to it on this message board.

K.J.


Top
  
 
 Post subject: Re: loading a kernel?
PostPosted: Tue Mar 12, 2002 10:36 am 
The way minix and linux (I think) do it is to patch the disk address of the kernel into the bootloader. Then the bootloader doesn't need to know about the filesystem. That works fine unless the disk is fragmented and the kernel gets split into multiple segments...  :-/


Top
  
 
 Post subject: Re: loading a kernel?
PostPosted: Tue Mar 12, 2002 1:13 pm 
The way minix and linux (I think) do it is to patch the disk address of the kernel into the bootloader. Then the bootloader doesn't need to know about the filesystem. That works fine unless the disk is fragmented and the kernel gets split into multiple segments...

I know that GRUB doesn't do this, but I'm not sure about LILO or the Minix loader.

K.J.


Top
  
 
 Post subject: Re: loading a kernel?
PostPosted: Tue Mar 12, 2002 9:16 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 22, 2004 11:00 pm
Posts: 1076
grub reads file systems, and is the best way to go.

lilo on the other hand, has a patched adderss that gets written into it each time you change the kernel (really BAD way of doing it!), which is why linux users have to update lilo each time they build a new kernel! (ouch)

i know the freebsd loader (btx) does not require this.

go with grub!

_________________
-- Stu --


Top
 Profile  
 
 Post subject: Re: loading a kernel?
PostPosted: Tue Mar 12, 2002 10:08 pm 
I have to agree about GRUB, it is a cool loader!


Top
  
 
 Post subject: Re: loading a kernel?
PostPosted: Tue Mar 12, 2002 10:57 pm 
BTW, can GRUB relocate ELF files? My kernel gets loaded with a couple of shared libraries, does GRUB support this? I've almost done the loader for it, but I guess GRUB would be better..


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot], RayanMargham and 229 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