Re: Deep Bootloader Questions
Posted: Wed Dec 28, 2016 2:09 pm
Hi,
...When you get to load a 64-bit kernel, you will discover GRUB can't directly load it, and you will have to switch processor modes inside the kernel while pretending it's a 32-bit kernel, or have a pre-kernel module (incorrectly referred to as "kernel" in GRUB parlance) which sets up the environment and passes control to the kernel (incorrectly referred to as "module" in GRUB parlance).
...When you get to ACPI, you will discover that the kernel will have to search/probe the memory for ACPI tables even when booting from UEFI, where the firmware itself provides the relevant addresses (but GRUB doesn't make use of them (in case I am mistaken, the kernel will instead have to detect whether it has been booted from BIOS of UEFI)).
...When you get to make use of available physical memory, you will discover the kernel will have to detect whether it has been booted from BIOS or UEFI in order to interpret the memory map properly. The memory map returned from "int 0x15, eax=0xE820" and the memory map returned from UEFI are incompatible.
Honestly, this is by no means a full list, but rather some things I can think of currently. I'm sure you will sooner or later find more design decisions of GRUB which you will find to be inconvenient. This way you will know almost from the start some design decisions you should not copy in your bootloader. Another option, which should rather be intersected with tolerating GRUB for a while in the beginning, is not to be afraid of modifying the boot specification when you see design mistakes in it. Note: The problem is that the Multiboot specification is used by many operating systems and therefore it's hard to release a new version of it whenever a design mistake is spotted, while the boot specification for your OS can be changed at almost any time since it's used only for your OS.
Regards,
glauxosdever
You can just tolerate using GRUB for a while, until you get to a point where you can see most of the things GRUB doesn't do like you wanted. In fact you already see points of GRUB that are inconvenient for your design. Then...octacone wrote:I am aware that writing one is a difficult task. I don't think I will be doing another in lets say 10 years from now. It surely takes time, but that is the cost.
Looks like I can't escape GRUB. Thanks for your time.
...When you get to load a 64-bit kernel, you will discover GRUB can't directly load it, and you will have to switch processor modes inside the kernel while pretending it's a 32-bit kernel, or have a pre-kernel module (incorrectly referred to as "kernel" in GRUB parlance) which sets up the environment and passes control to the kernel (incorrectly referred to as "module" in GRUB parlance).
...When you get to ACPI, you will discover that the kernel will have to search/probe the memory for ACPI tables even when booting from UEFI, where the firmware itself provides the relevant addresses (but GRUB doesn't make use of them (in case I am mistaken, the kernel will instead have to detect whether it has been booted from BIOS of UEFI)).
...When you get to make use of available physical memory, you will discover the kernel will have to detect whether it has been booted from BIOS or UEFI in order to interpret the memory map properly. The memory map returned from "int 0x15, eax=0xE820" and the memory map returned from UEFI are incompatible.
Honestly, this is by no means a full list, but rather some things I can think of currently. I'm sure you will sooner or later find more design decisions of GRUB which you will find to be inconvenient. This way you will know almost from the start some design decisions you should not copy in your bootloader. Another option, which should rather be intersected with tolerating GRUB for a while in the beginning, is not to be afraid of modifying the boot specification when you see design mistakes in it. Note: The problem is that the Multiboot specification is used by many operating systems and therefore it's hard to release a new version of it whenever a design mistake is spotted, while the boot specification for your OS can be changed at almost any time since it's used only for your OS.
He could do it like KolibriOS does it. Have the bootloader display a menu describing graphics modes. As far as I know it's not possible with GRUB.Kevin wrote:Video mode switching is not a good reason for rolling your own bootloader - especially if you want to switch video modes at runtime.
Regards,
glauxosdever