Bona Fide OS Developer
View unanswered posts | View active topics It is currently Thu Mar 28, 2024 12:23 pm



Post new topic Reply to topic  [ 3 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

Joined: Sun Sep 19, 2010 9:45 am
Posts: 29
Post Re: How to connect bootloader and kernel?
I use MS-DOS as bootloader because I want full MS-DOS compatibility in my 16/32/64-bit OS, native and emulated.

I also want to make kernel-mode drivers for other OSes so I can stop them and break through them to effectively turn them into bootloaders, and maybe return to them for things like setting video modes while I don't have drivers.

This could be a good start for doing that in Windows:
https://www.planet-source-code.com/vb/s ... 1&lngWId=1

_________________
Live Development (click image links for full size):
PC 1: ImagePC 2: Image


Mon Oct 28, 2019 10:29 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 32 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin and tweaked by the BF Team.