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.htmOops 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#l89You 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.