Brendan wrote:A boot loader (that is not a "boot manager") should have no use for any scripting language.
Get a physical memory map, load some files, find some ACPI tables, setup a video mode, then pass control to the first loaded file. You'd need something to determine which video mode/s are supported (maybe some field's in the first file's header) and something to determine which files to load from where (e.g. "starting LBA" and "number of sectors" fields in the boot loader itself, that are set when the boot loader is installed).
Of course it's not quite that simple (e.g. you'd want to collect a bit more information than that, and have a standardised way to pass all the information to the first loaded file). However, if you start adding all sorts of unnecessary complexity (scripting languages? modules? a C library? Why not slap a Tetris clone in it in case the user gets bored? No, how about a web browser! Yeah, with flash; and java too so people can play Minecraft! Woot), then you'll end up with something like GRUB2 instead of something clean and efficient.
Cheers,
Brendan
A modern OS inherently needs a boot manager of some description. Whether it be to support multiple side by side kernels (as done by Linux), or resilient upgrades (e.g. where a "checkpoint" of the system state is taken before starting the upgrade, and if there is an issue with the upgrade one can always just boot from that checkpoint)
You argue that they're two separate jobs; on UEFI, this can easily be the case (because UEFI supports passing command line arguments to applications); however, when booted from the BIOS, there is clearly no clean way to pass the information. Besides; your proposal pretty much requires running the whole boot manager in real mode.
Maybe scripting is unnecessary; but at some point some configuration language probably will. This is all something that should probably be worked on once there are more solid foundations
---
I'm going to add to this:
I don't see a single loader being able to satisfy everyone's needs. I'd much rather see a simple "runtime" upon which said loader can be written.
There might be a BIOS chainloader application, a Multiboot loader application, a Linux loader application, plus new OSes could define their own. In that way, it's kind of an abstraction of what the various boot environments (BIOS, UEFI, bare metal, etc) provide.
The more familiar that runtime can be made, the better; thats why I propose the majority of it be the ISO C standard API: It's relatively slim and relatively complete.
On top of that could be added the necessary domain-specific functionality: an ELF loader, for example (for loading applications); perhaps routines for setting up page tables in a specific manner, then a final routine to enable it and jump to a specified address.
The runtime itself need not provide a boot menu. I'm going to suggest that the BIOS bootloader "backend" just load a specific file - but, because the BIOS doesn't provide a boot menu function of its own - that file be a boot manager.
The same boot manager could be used on bare metal systems as the platform boot manager. On UEFI, it can simply be ignored (because UEFI provides one already); instead, you'd just pass the application you want to run (and any arguments to it) straight to the runtime.