I don't understand this. Fancy bootloaders can leave parts of the computer in unexpected states, especially on non-PC architectures. Even grub on PCs can leave the text-mode cursor enabled or disabled depending on its configuration. U-Boot on ARM selects seemingly random states for even MMU and CPU features, varying from board to board. Some say "Never use U-Boot," and I believe them. If you are stuck with (users using) U-boot you have to reinitialize everything, just as if there was no fancy bootloader in the first place.Schol-R-LEA wrote:This leads to the next big decision: which Bootloader to use. There are a number of different standard bootloaders for x86, with the most prominent being grub. We strong recommend against Rolling Your Own Bootloader, but it is an option as well.
Then there's multiboot, which is all touchy-feely "nice", but it's impossible to do right. The ELF standard is vast, no bootloader can implement all of it, so different bootloaders will inevitably implement different parts. If your architecture precludes linking, you don't want ELF object format, or even if you write your own ELF linker, you're in trouble because, when you write the ELF symbols for multiboot into your kernel image, you may not have selected the same parts of ELF as whichever bootloaders your users choose to use.
For example, 9front has a toolchain older than ELF which is perfectly adequate for its own needs. "Multiboot support" is engineered into the kernel so it boots with grub, but it doesn't boot with syslinux. syslinux supports multiboot, so why doesn't it? syslinux's multiboot support must be different to grub's, so where's the "multi" in "multiboot"? pxelinux is part of the syslinux package, what if I want a boot menu on my diskless terminal?
Bootable forths make a stronger example. Linking one of these with gnu ld is a ridiculous proposition, sort-of like building a little dune buggy with a huge crane! A complete interactive forth can be built on a kernel of only some hundreds of lines of assembly language code, well under 1000. Why would you bother linking that? Why would you want to when it goes against the architecture of your system? I don't think it's even limited to forth, I'm starting to see how a more comfortable language & system could be built on such a tiny kernel without any more assembly language.