ankitbehera2670 wrote:
hi I am following the meaty os tutorial. I am currently using grub as the bootloader but I want to use a custom bootloader for my os. As i am new to this I have no idea about how to do that. Please help me!
Make sure you code your bootloader for 16 bit real mode (you'd be surprised how many people think it'll run in 32 bit protected mode just because they wrote "[bits32]"!) You'll probably want to set all your segments to 0 and start your code with "org 7c00h".
You'll want to familiarize yourself with Ralf Brown:
http://www.ctyme.com/rbrown.htmThe BIOS will give you your drive number in the dl register; use that when calling the BIOS disk read function (int 13h function 2 or 42h).
Load sectors for whatever runs next (2nd stage bootloader, kernel startup program, kernel itself).
You probably want to be in protected mode before loading your kernel: remap the PIC, setup a GDT, set the PM bit in CR0, and far jump to your PM code.