Bona Fide OS Development
http://forums.osdever.net/

How to connect bootloader and kernel?
http://forums.osdever.net/viewtopic.php?f=4&t=899
Page 1 of 1

Author:  losethos [ Sun Feb 13, 2011 9:56 pm ]
Post subject:  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.

Author:  brenden [ Mon Aug 22, 2011 12:52 pm ]
Post subject:  Re: How to connect bootloader and kernel?

Neomex, did you disappear or were we able to help you or both?

Author:  ~ [ Mon Oct 28, 2019 10:29 am ]
Post subject:  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

Page 1 of 1 All times are UTC - 6 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/