Bona Fide OS Developer
View unanswered posts | View active topics It is currently Sun Feb 25, 2018 2:33 pm



Post new topic Reply to topic  [ 2 posts ] 
 How to connect bootloader and kernel? 
Author Message

Joined: Fri Aug 20, 2010 10:04 pm
Posts: 41
Post Re: How to connect bootloader and kernel?
I recommend doing a chain-loaded boot loader. Use grub to read the first block of your partition where you have placed a bootloader for that partition.

Your boot loader begins in real mode and loads-in the next stage.

Call int 13h with 42h in AH.

Pass it the DL value from when your boot sector was called.

http://www.ctyme.com/intr/rb-0715.htm

Oops I think the CIA is obsficating. (That link has be come garbage.) You can learn how to use it from my code. Maybe, it wasn't the CIA.

http://www.losethos.com/code/BootHD.html#l89

You will have to figure-out how to place your bootloader on the partition's first block. It's a lot easier if you figure-out how to patch your bootloader with the LBA of the next stage and it's size in blocks.

You might use FreeDOS or LoseThos to read and write RAW sectors to get you started until your own operating system can write the boot sector after locating the block address of your next stage. Why navagate a file system twice--your main operating system disk code can be used to patch your boot loader with LBA and block cnt.

My boot loader doesn't change out of real mode -- the next stage does that.

I also made a master-boot record boot loader which will boot the boot block of other partitions.


Sun Feb 13, 2011 9:56 pm
Profile
Site Admin

Joined: Fri Jul 24, 2009 10:02 pm
Posts: 247
Location: Las Vegas, NV, US
Post Re: How to connect bootloader and kernel?
Neomex, did you disappear or were we able to help you or both?


Mon Aug 22, 2011 12:52 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin and tweaked by the BF Team.