Zack's Kernel News

Extending Boot Support

Chao Peng said:

"Multiboot specification is an open standard that provides kernels with a uniform way to be booted by multiboot-compliant bootloaders (like grub).

This patch is trying to make [the] Linux ELF kernel image to be a multiboot-compliant OS so that it can be loaded by a multiboot-compliant bootloader. The benefit is eliminating the maintenance for realmode and decompression code and especially when the kernel is loaded in a virtual machine, the reducing for these code can greatly cut down the boot time."

Unfortunately, he said, the specification wasn't completely clear about how to handle 64-bit kernels. Also, in spite of the grub program supporting the ELF64 format, it was currently unable to read the memory address required to load the program.

But H. Peter Anvin put his foot down in a one-line email, saying, "As has been shown many times before, this is a really bad idea. Unless there is a real-life use case where this matters enormously, this is nacked with extreme prejudice."

As an alternative, Luis R. Rodriguez remarked, "something to consider, provided the issues with multiboot get resolved: If you want to boot Xen, you actually use the multiboot protocol, the last PVH boot patches had borrowed ideas from Multiboot to add an entry to Linux, only it was Xen'ified. What would be Multiboot 2 seemed flexible enough to allow all sorts of custom semantics and information stacked into a boot image. The last thought I had over this topic (before giving up) was – if we're going to add yet-another-entry (TM) why not add extend Multiboot 2 protocol with the semantics we need to boot any virtual environment and then add Multiboot 2 support entry on Linux? We could redirect any custom boot mechanism then to just use that given its flexibility."

H. Peter clarified his objection, saying, "Multiboot has a fundamentally broken assumption, which is to do certain work for the kernel in the bootloader. This is fundamentally a bad idea, because you always want to do things in the latest step possible during the boot process, being the most upgradeable, and have the interface as narrow as possible. Therefore, using Multiboot is actively a negative step. It is declared an 'Open Standard' but anything can be such declared; it really is a claim that 'everything should work like Grub'."

Daniel Kiper, creator of Multiboot2, took umbrage to H. Peter's criticism, and replied, "I can agree that they are not perfect (especially Multiboot proto is very inflexible). However, both protos try to standardize boot process. I think it is nice because right now almost every (new) kernel has [its] own boot protocol (some even support more then one, sic!). And it is [an]enormous task to support all of them in one boot loader. So, I think that [the] Multiboot protocols family (IMO, Multiboot2 is preferred today) are [a] good idea. Are they not perfect? Yes, but I do not think that proliferation of tons of incompatible boot protocols, each specific for one kernel, is better. So, if you think that we can fix something in Multiboot2 please tell us. If you think that it is unfixable, please tell us too. We can think about Multiboot3 too (ehhh… maybe this is not the best idea). Anyway, it would be nice if one day we have one common boot protocol for (almost) everybody."

The discussion looked like it might get violent, but instead it trailed off inconclusively. It seems clear that support for ELF64 is one of those features where you think you're just implementing a cool feature, but actually you're stepping into a lake of boiling lava. It seems that the underlying issues of boot protocols need to find some resolution, before developers will be able to comfortably add certain new boot-time features.

The Author

The Linux kernel mailing list comprises the core of Linux development activities. Traffic volumes are immense, often reaching 10,000 messages in a week, and keeping up to date with the entire scope of development is a virtually impossible task for one person. One of the few brave souls to take on this task is Zack Brown.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Kernel News

    Chronicler Zack Brown reports on the latest news, views, dilemmas, and developments within the Linux kernel community.

  • Kernel News

    Chronicler Zack Brown reports on the latest news, views, dilemmas, and developments within the Linux kernel community.

  • Kernel News

     

  • Kernel News

    Zack Brown looks at improving memory management, simplifying(ish) the Kernel Build System, and detecting firmware crashes.

  • Kernel News

    Chronicler Zack Brown reports on the latest news, views, dilemmas, and developments within the Linux kernel community.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News