Bootloader Development Goals.

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
yByonic
Posts: 13
Joined: Mon Aug 24, 2020 2:25 pm

Bootloader Development Goals.

Post by yByonic »

Hello everyone! I'm thinking about developing an operating system and I had some doubts about bootloader development. From what I've read, using your own bootloader and a public one (like GRUB) doesn't make that much of a difference, and I don't have that much to lose by getting full project oversight in return. So, I went to investigate trying to know the goals of a bootloader (and in case I forget one, please remind me):
-Use identifier 0x55aa.
-Create a GDT.
-Switch from real mode to protected mode (32bits).
-Start the kernel.

Something I keep thinking about is the hard drive and file systems. When, in the future, the kernel jumps to other spaces on the hard drive, is it the bootloader that has to do "the request"? As a bootloader, is it necessary/recommended to work with file systems?
Please give your opinion. Thanks in advance.
Octocontrabass
Member
Member
Posts: 5512
Joined: Mon Mar 25, 2013 7:01 pm

Re: Bootloader Development Goals.

Post by Octocontrabass »

yByonic wrote:From what I've read, using your own bootloader and a public one (like GRUB) doesn't make that much of a difference,
It makes a big difference! GRUB is stable. If you write your own bootloader, you have to debug it too, and there will be bugs that only happen on real hardware.

Also, GRUB does the work of at least six bootloaders: BIOS hard/floppy disk, BIOS CD, BIOS PXE TFTP, UEFI disk, UEFI PXE TFTP, and UEFI PXE HTTP.
yByonic wrote:-Use identifier 0x55aa.
-Create a GDT.
-Switch from real mode to protected mode (32bits).
-Start the kernel.
-Load the kernel into memory.
-Get information from the firmware (memory map).
-Initialize the display.
yByonic wrote:When, in the future, the kernel jumps to other spaces on the hard drive, is it the bootloader that has to do "the request"?
Typically no, but you can do that if you really want to. I've heard of kernels that work this way before the storage drivers are loaded.
yByonic wrote:As a bootloader, is it necessary/recommended to work with file systems?
It's not necessary, but it is convenient. GRUB works with file systems.
Post Reply