multiboot2
Hello I was looking into multiboot2 specifications and have some suggestions:
1) double the size of flags. 8 features per category seems to be few. it could even be made completely expandable by the following format:
<magic>
<number of flag dwords>
<dword1 as defined in current draft>
<dword2 as defined in current draft, next packet of flags>
...
<checksum>
2) "All undefined flags *should* be set to zero for future use. "
IMO in this place all OSes should be required to follow this rule in current terminology it would be "must"
3) "The physical address to which the boot loader should jump in order to start running the operating system."
In current terminology should make no real sense here
4) "This tag should contain a string that enables operating systems to distinguish between different bootloaders and different versions of the same bootloader."
Parsing strings may be difficult. Perhaps we could include a version tag with a format dependent on bootloader and optionally a requirement that higher numbers are newer versions?
5)memory map: "The order of memory maps is not guaranteed but a boot loader should sort the items based on the starting addresses. "
I don't like the optionality of this rule if it's included in specifications it should be either required or dropped altogether. Otherwise we risk to have OSes which rely on sorting and bootloaders which doesn't sort. I'm personally for making it mandatory for reasons similar to next entry
6) memory map. "<!> Tags of this type should be omitted on architectures where the OS is able to retrieve this information from firmware. (Doing do will encourage OS portability across bootloaders, and simplify GRUB development and maintenance.) "
This contradicts the goal of easier OS developement and may result in semi-compatible OS and bootloaders. Additionally I think that eliminating the necessity of use of firmware from OS is a good thing and allows easier porting between architectures differing only by firmware
7) Command line tag. I propose to reserve the identifier 0x0005 for command line and make it the same format as "Boot Loader Name" but arguments shouldn't include kernel image name. This way we would prevent OSes from trying to access this file by bootloader-specific name. In addition in both "Boot Loader Name" and "Command-line" we should specify the encoding to be utf-8
Signature · 2 lines
Regards Vladimir 'phcoder' Serbinenko
phcoder wrote:
[...]
Quoted 6 lines
4) "This tag should contain a string that enables operating systems to distinguish between different bootloaders and different versions of the same bootloader."
Parsing strings may be difficult. Perhaps we could include a version tag with a format dependent on bootloader and optionally a requirement that higher numbers are newer versions?
By my understanding, the name is defined by the bootloader. All Grub has to do is check if it starts with "GRUB" (or whatever name/capitalization we define), and skip otherwise. If, for example, it starts with "LILO", we can skip the entire tag and not worry about parsing LILO's version numbers.
With that, you also don't need to worry about "higher numbers are newer version", as we can determine our own versioning, and load appropriate features.
Quoted 6 lines
7) Command line tag. I propose to reserve the identifier
0x0005for command line and make it the same format as "Boot Loader Name" but arguments shouldn't include kernel image name. This way we would prevent OSes from trying to access this file by bootloader-specific name. In addition in both "Boot Loader Name" and "Command-line" we should specify the encoding to be utf-8
I'm not really understanding what you're saying here. Are you proposing that the OS lets us know what command-line options it allows, for use in tab completion? Or that they're listing the default command line (for editing perhaps?) Or am I thinking in the wrong direction here?
Signature · 1 line
Sic non confunctus, non reficiat.
In 4 and 7 I meant parameters passed from the bootloader to the OS.
Quoted 3 lines
With that, you also don't need to worry about "higher numbers are newer version", as we can determine our own versioning, and load appropriate features.
With that we can avoid alternative bootloaders with version passing like 13b5.1.1rc2 Which would be an unnecessary hassle for the OS to parse.
Quoted 5 lines
I'm not really understanding what you're saying here. Are you proposing that the OS lets us know what command-line options it allows, for use in tab completion? Or that they're listing the default command line (for editing perhaps?) Or am I thinking in the wrong direction here?
Yes you're. I mean command line parameters. E.g. if you launch the kernel like
multiboot /mykernel root=myroot debug=ttyS0
Then kernel should be able to know what's passed after the kernel name I propose it to be exported as a tag 0x0005 and contents "root=myroot debug=ttyS0" as a NUL-terminated UTF-8 string
Signature · 2 lines
Regards Vladimir 'phcoder' Serbinenko
These issues still remain
Quoted 21 lines · phcoder
Hello I was looking into multiboot2 specifications and have some suggestions:
1) double the size of flags. 8 features per category seems to be few. it could even be made completely expandable by the following format:
<magic>
<number of flag dwords>
<dword1 as defined in current draft>
<dword2 as defined in current draft, next packet of flags>
...
<checksum>
2) "All undefined flags *should* be set to zero for future use. "
IMO in this place all OSes should be required to follow this rule in current terminology it would be "must"
3) "The physical address to which the boot loader should jump in order to start running the operating system."
In current terminology should make no real sense here
4) "This tag should contain a string that enables operating systems to distinguish between different bootloaders and different versions of the same bootloader."
Parsing strings may be difficult. Perhaps we could include a version tag with a format dependent on bootloader and optionally a requirement that higher numbers are newer versions?
5)memory map: "The order of memory maps is not guaranteed but a boot loader should sort the items based on the starting addresses. "
I don't like the optionality of this rule if it's included in specifications it should be either required or dropped altogether. Otherwise we risk to have OSes which rely on sorting and bootloaders which doesn't sort. I'm personally for making it mandatory for reasons similar to next entry
6) memory map. "<!> Tags of this type should be omitted on architectures where the OS is able to retrieve this information from firmware. (Doing do will encourage OS portability across bootloaders, and simplify GRUB development and maintenance.) "
This contradicts the goal of easier OS developement and may result in semi-compatible OS and bootloaders. Additionally I think that eliminating the necessity of use of firmware from OS is a good thing and allows easier porting between architectures differing only by firmware
7) Command line tag. I propose to reserve the identifier0x0005for command line and make it the same format as "Boot Loader Name" but arguments shouldn't include kernel image name. This way we would prevent OSes from trying to access this file by bootloader-specific name. In addition in both "Boot Loader Name" and "Command-line" we should specify the encoding to be utf-8
Signature · 2 lines
Regards Vladimir 'phcoder' Serbinenko
Quoted 6 lines · On Monday 06 April 2009 08:34:23 phcoder wrote:
These issues still remain
Quoted 3 lines · phcoder
Hello I was looking into multiboot2 specifications and have some suggestions:
1) double the size of flags. 8 features per category seems to be few.
I do not agree on this. As you can see, most bits are still undefined after over 10-year usage of the Multiboot Specification. I do not want to change it without any real issue.
Quoted 8 lines
Quoted 8 lines
it
could even be made completely expandable by the following format:
<magic>
<number of flag dwords>
<dword1 as defined in current draft>
<dword2 as defined in current draft, next packet of flags>
...
<checksum>
This (i.e. a variable Multiboot header) has been raised several times on this list, and my conclusion is that it is not desirable.
Quoted 3 lines
Quoted 3 lines
2) "All undefined flags *should* be set to zero for future use. " IMO in this place all OSes should be required to follow this rule in current terminology it would be "must"
I agree.
Quoted 3 lines
Quoted 3 lines
3) "The physical address to which the boot loader should jump in order to start running the operating system."
In current terminology should make no real sense here
This is not an italic "should". Just a natural use of English wording.
Quoted 6 lines
Quoted 6 lines
4) "This tag should contain a string that enables operating systems to distinguish between different bootloaders and different versions of the same bootloader."
Parsing strings may be difficult. Perhaps we could include a version tag with a format dependent on bootloader and optionally a requirement that higher numbers are newer versions?
I do not think so. The purpose of this tag is for human reading only. For example, you might want to examine what boot loader booted up your operating system. So, as long as it is readable for human, that's okay. IMO, operating systems must not change behaviors based on this tag.
Quoted 7 lines
Quoted 7 lines
5)memory map: "The order of memory maps is not guaranteed but a boot loader should sort the items based on the starting addresses. " I don't like the optionality of this rule if it's included in specifications it should be either required or dropped altogether. Otherwise we risk to have OSes which rely on sorting and bootloaders which doesn't sort. I'm personally for making it mandatory for reasons similar to next entry
There's a good reason to make it optional. If you see GRUB only, you will think that this behavior should be always implemented, but some boot loaders are more nervous about the code size, so they want to skip as many features as they can. In fact, AFAIK, Etherboot didn't implement sorting in its Multiboot support.
Quoted 8 lines
Quoted 8 lines
6) memory map. "<!> Tags of this type should be omitted on architectures where the OS is able to retrieve this information from firmware. (Doing do will encourage OS portability across bootloaders, and simplify GRUB development and maintenance.) "
This contradicts the goal of easier OS developement and may result in semi-compatible OS and bootloaders. Additionally I think that eliminating the necessity of use of firmware from OS is a good thing and allows easier porting between architectures differing only by firmware
It is hard for me to say which is better.
In reality, every OS needs to interact with underlying firmware more or less to be functional (power control, interrupt handling, etc.). So giving a memory map does not eliminate the necessity of interactions with firmware anyway.
From another viewpoint, a boot loader can declare a part of memory for its own use, even after transferring control to an operating system, by specifying a memory map explicitly. So it can be useful to provide a memory map, even on an architecture which offers support for retrieving a memory map easily.
Quoted 6 lines
Quoted 6 lines
7) Command line tag. I propose to reserve the identifier
0x0005for command line and make it the same format as "Boot Loader Name" but arguments shouldn't include kernel image name. This way we would prevent OSes from trying to access this file by bootloader-specific name. In addition in both "Boot Loader Name" and "Command-line" we should specify the encoding to be utf-8
Seemingly, someone made a bad change on the draft, so the information is lost:
http://grub.enbug.org/MultibootDraft?action=diff&rev2=23&rev1=22
Hollis's idea was to use the same format as for modules to give information about an OS image. A part of this change must be reverted. It is wrong to adopt the spec to the implementation.
BTW, I agree that the command line should not include a filename.
Regards,
Okuji
Quoted 4 lines · Yoshinori K. Okuji
Quoted 1 line
Quoted 1 line
1) double the size of flags. 8 features per category seems to be few.
I do not agree on this. As you can see, most bits are still undefined after over 10-year usage of the Multiboot Specification. I do not want to change it without any real issue.
The difference is that multiboot2 is meant to be portable
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
3) "The physical address to which the boot loader should jump in order to start running the operating system."
In current terminology should make no real sense hereThis is not an italic "should". Just a natural use of English wording.
Ok
Quoted 10 lines
Quoted 7 lines
Quoted 7 lines
4) "This tag should contain a string that enables operating systems to distinguish between different bootloaders and different versions of the same bootloader."
Parsing strings may be difficult. Perhaps we could include a version tag with a format dependent on bootloader and optionally a requirement that higher numbers are newer versions?I do not think so. The purpose of this tag is for human reading only. For example, you might want to examine what boot loader booted up your operating system. So, as long as it is readable for human, that's okay. IMO, operating systems must not change behaviors based on this tag.
Ok
Quoted 10 lines
Quoted 7 lines
Quoted 7 lines
5)memory map: "The order of memory maps is not guaranteed but a boot loader should sort the items based on the starting addresses. " I don't like the optionality of this rule if it's included in specifications it should be either required or dropped altogether. Otherwise we risk to have OSes which rely on sorting and bootloaders which doesn't sort. I'm personally for making it mandatory for reasons similar to next entry
There's a good reason to make it optional. If you see GRUB only, you will think that this behavior should be always implemented, but some boot loaders are more nervous about the code size, so they want to skip as many features as they can. In fact, AFAIK, Etherboot didn't implement sorting in its Multiboot support.
What I want is to avoid is the bitrot as with multiboot1 when due to different issues some kernels boot only with some booters. Such a situation defeats the purpose of the standard
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
6) memory map. "<!> Tags of this type should be omitted on architectures where the OS is able to retrieve this information from firmware. (Doing do will encourage OS portability across bootloaders, and simplify GRUB development and maintenance.) "
This contradicts the goal of easier OS developement and may result in semi-compatible OS and bootloaders. Additionally I think that eliminating the necessity of use of firmware from OS is a good thing and allows easier porting between architectures differing only by firmware
Quoted 4 lines
It is hard for me to say which is better.
In reality, every OS needs to interact with underlying firmware more or less to be functional (power control, interrupt handling, etc.). So giving a memory map does not eliminate the necessity of interactions with firmware anyway.
This isn't entirely true. Most of OS use their own firmware-independent drivers for most devices. If it doesn't recognize the firmware perhaps some functionality will be disabled but at least OS will be able to boot. This isn't the case with a lot of current OSes specifically targetting one or another firmware but I hope it will vhange in the future because of advent of alternative firmwares.
Furthermore different firmwares may implement the same interfaces. A major example is EFI, coreboot and BIOS implementing ACPI. If we add a tag pointing to RSDP then the kernel won't need to know whether it's on EFI, BIOS or coreboot.
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
7) Command line tag. I propose to reserve the identifier
0x0005for command line and make it the same format as "Boot Loader Name" but arguments shouldn't include kernel image name. This way we would prevent OSes from trying to access this file by bootloader-specific name. In addition in both "Boot Loader Name" and "Command-line" we should specify the encoding to be utf-8
Quoted 6 lines
Seemingly, someone made a bad change on the draft, so the information is lost:
http://grub.enbug.org/MultibootDraft?action=diff&rev2=23&rev1=22
Hollis's idea was to use the same format as for modules to give information about an OS image. A part of this change must be reverted. It is wrong to adopt the spec to the implementation.
It's ok with me. Quick look through the code suggests that probably kernel tag is created with type MODULE and that it also has an additional field type. I will check it tomorrow but it looks like a bug somewhere And what about encoding?
Quoted 11 lines
BTW, I agree that the command line should not include a filename.
Regards,
Okuji_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 2 lines
Regards Vladimir 'phcoder' Serbinenko
Quoted 8 lines · On Tuesday 07 April 2009 10:18:30 phcoder wrote:
Quoted 5 lines · Yoshinori K. Okuji
Quoted 1 line
Quoted 1 line
1) double the size of flags. 8 features per category seems to be few.
I do not agree on this. As you can see, most bits are still undefined after over 10-year usage of the Multiboot Specification. I do not want to change it without any real issue.
The difference is that multiboot2 is meant to be portable
Yes, but so?
Quoted 9 lines
Quoted 5 lines
There's a good reason to make it optional. If you see GRUB only, you will think that this behavior should be always implemented, but some boot loaders are more nervous about the code size, so they want to skip as many features as they can. In fact, AFAIK, Etherboot didn't implement sorting in its Multiboot support.
What I want is to avoid is the bitrot as with multiboot1 when due to different issues some kernels boot only with some booters. Such a situation defeats the purpose of the standard
Not really. Even with the most strict spec possible, it is always possible to depend on implementation details which are not part of the spec. So, if an OS image does boot only with some implementations, it is a fault in the OS image, and the OS image should be fixed.
Quoted 12 lines
Quoted 12 lines
Quoted 9 lines
Quoted 9 lines
6) memory map. "<!> Tags of this type should be omitted on architectures where the OS is able to retrieve this information from firmware. (Doing do will encourage OS portability across bootloaders, and simplify GRUB development and maintenance.) "
This contradicts the goal of easier OS developement and may result in semi-compatible OS and bootloaders. Additionally I think that eliminating the necessity of use of firmware from OS is a good thing and allows easier porting between architectures differing only by firmwareIt is hard for me to say which is better.
Quoted 7 lines
Quoted 4 lines
In reality, every OS needs to interact with underlying firmware more or less to be functional (power control, interrupt handling, etc.). So giving a memory map does not eliminate the necessity of interactions with firmware anyway.
This isn't entirely true. Most of OS use their own firmware-independent drivers for most devices.
For device drivers, yes. For other things, not always. For instance, on Alpha, you need to use the firmware to enter the privileged mode. AFAIK, no other choice.
From my point of view, the conclusion should be based on whether a boot loader may want to provide a memory map different from what firmware thinks. If yes, we have a good reason to make it required. If no, not much.
Quoted 5 lines
Quoted 5 lines
Seemingly, someone made a bad change on the draft, so the information is lost:
http://grub.enbug.org/MultibootDraft?action=diff&rev2=23&rev1=22
Quoted 8 lines
Quoted 3 lines
Hollis's idea was to use the same format as for modules to give information about an OS image. A part of this change must be reverted. It is wrong to adopt the spec to the implementation.
It's ok with me. Quick look through the code suggests that probably kernel tag is created with type MODULE and that it also has an additional field type. I will check it tomorrow but it looks like a bug somewhere
Hmm.
Quoted 1 line
And what about encoding?
Fine for me.
Regards,
Okuji
Quoted 9 lines · Yoshinori K. Okuji
Quoted 6 lines · On Tuesday 07 April 2009 10:18:30 phcoder wrote:
Quoted 4 lines · Yoshinori K. Okuji
Quoted 1 line
Quoted 1 line
1) double the size of flags. 8 features per category seems to be few.
I do not agree on this. As you can see, most bits are still undefined after over 10-year usage of the Multiboot Specification. I do not want to change it without any real issue.
The difference is that multiboot2 is meant to be portable
Yes, but so?
On some platforms the number of features may be bigger
Quoted 2 lines
Not really. Even with the most strict spec possible, it is always possible to depend on implementation details which are not part of the spec. So, if an OS image does boot only with some implementations, it is a fault in the OS image, and the OS image should be fixed.
I agree but specification should make such things less likely
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 9 lines
Quoted 9 lines
6) memory map. "<!> Tags of this type should be omitted on architectures where the OS is able to retrieve this information from firmware. (Doing do will encourage OS portability across bootloaders, and simplify GRUB development and maintenance.) "
This contradicts the goal of easier OS developement and may result in semi-compatible OS and bootloaders. Additionally I think that eliminating the necessity of use of firmware from OS is a good thing and allows easier porting between architectures differing only by firmwareIt is hard for me to say which is better.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
In reality, every OS needs to interact with underlying firmware more or less to be functional (power control, interrupt handling, etc.). So giving a memory map does not eliminate the necessity of interactions with firmware anyway.
This isn't entirely true. Most of OS use their own firmware-independent drivers for most devices.
For device drivers, yes. For other things, not always. For instance, on Alpha, you need to use the firmware to enter the privileged mode. AFAIK, no other choice.
I don't know about alpha but on i386 cpu kernel needs only 4 things from
the bootloader to be totally firmware-independent: memory map,
framebuffer info, rsdp and smbios address. So I propose to add tags for 3 last things and make memory map required. This would encourage creation of OS working on all branches of i386 including coreboot I think on many platforms it's possible to pass some number of parameters to make it firmware-independent too
Quoted 2 lines
From my point of view, the conclusion should be based on whether a boot loader may want to provide a memory map different from what firmware thinks.
Badram? Creepy firmwares?
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Seemingly, someone made a bad change on the draft, so the information is lost:
http://grub.enbug.org/MultibootDraft?action=diff&rev2=23&rev1=22
Hollis's idea was to use the same format as for modules to give information about an OS image. A part of this change must be reverted. It is wrong to adopt the spec to the implementation.
Quoted 7 lines
Quoted 4 lines
It's ok with me. Quick look through the code suggests that probably kernel tag is created with type MODULE and that it also has an additional field type. I will check it tomorrow but it looks like a bug somewhere
Hmm.
Implementation in grub2 matches neither version of the draft.
Quoted 3 lines
Quoted 1 line
And what about encoding?
Fine for me.
I updated the multibootdraft
Quoted 9 lines
Regards,
Okuji_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 2 lines
Regards Vladimir 'phcoder' Serbinenko
Quoted 13 lines · phcoder
Quoted 12 lines · Yoshinori K. Okuji
Quoted 10 lines · On Tuesday 07 April 2009 10:18:30 phcoder wrote:
Quoted 7 lines · Yoshinori K. Okuji
Quoted 2 lines
Quoted 2 lines
1) double the size of flags. 8 features per category seems to be few.
I do not agree on this. As you can see, most bits are still undefined after over 10-year usage of the Multiboot Specification. I do not want to
change it without any real issue.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
The difference is that multiboot2 is meant to be portable
Yes, but so?
On some platforms the number of features may be bigger
Additionally this format is hard to extend in cross-platform way. Let's say we define new header on powerpc which takes bytes x to x+10 and a tag for i386 which takes bytes x to x+12 then we want to define a new crossplatform tag. Where to we put it? Why not just use the same format for multiboot header and multiboot info? It will make the job of bootloader easier (handling one format instead of 2).
Quoted 7 lines
Quoted 6 lines
Not really. Even with the most strict spec possible, it is always possible to depend on implementation details which are not part of the spec. So, if an OS image does boot only with some implementations, it is a fault in the OS image, and the OS image should be fixed.
I agree but specification should make such things less likely
Recently we experienced the problem with OSes assuming different details about specification. Of course it's bugs but bugs which are difficult to find. Standard is here to decrease developpement time, not increase it.
Quoted 26 lines
Quoted 19 lines
Quoted 19 lines
Quoted 18 lines
Quoted 10 lines
Quoted 10 lines
6) memory map. "<!> Tags of this type should be omitted on architectures where the OS is able to retrieve this information from firmware. (Doing do will encourage OS portability across bootloaders, and simplify GRUB development and maintenance.) "
This contradicts the goal of easier OS developement and may result in semi-compatible OS and bootloaders. Additionally I think that eliminating the necessity of use of firmware from OS is a good thing and allows easier porting between architectures differing only by firmwareIt is hard for me to say which is better.
In reality, every OS needs to interact with underlying firmware more or less to be functional (power control, interrupt handling, etc.). So giving a memory map does not eliminate the necessity of interactions with
firmware anyway.Quoted 6 lines
Quoted 2 lines
This isn't entirely true. Most of OS use their own firmware-independent drivers for most devices.
For device drivers, yes. For other things, not always. For instance, on Alpha, you need to use the firmware to enter the privileged mode. AFAIK, no other choice.
Quoted 5 lines
I don't know about alpha but on i386 cpu kernel needs only 4 things from the bootloader to be totally firmware-independent: memory map, framebuffer info, rsdp and smbios address. So I propose to add tags for 3 last things and make memory map required. This would encourage creation of OS working on all branches of i386 including coreboot
What about reserving a tag which will contain a copy of smbios anchor and another for containing a copy of rsdp?
Quoted 7 lines
I think on many platforms it's possible to pass some number of parameters to make it firmware-independent too
Quoted 3 lines
From my point of view, the conclusion should be based on whether a boot loader may want to provide a memory map different from what firmware thinks.
Badram? Creepy firmwares?
Implementing memory map passing from bootloader side is cheap - bootloader needs to know it anyway.
Quoted 16 lines
Quoted 9 lines
Regards,
Okuji_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel--
Regards
Vladimir 'phcoder' Serbinenko
Signature · 4 lines
Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git