diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-05-11 19:06:23 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-05-11 20:45:05 -0400 |
commit | d297366ba692faf1f0384811a6ff0b20c3470b1b (patch) | |
tree | 08a041463badb70f45491fdbceb0c54a5ab5597d /Documentation/x86 | |
parent | 37ba7ab5e33cebc25c68fffe33e9f21e7c2014e8 (diff) |
x86: document new bzImage fields
Document the new bzImage fields for kernel memory placement.
[ Impact: adds documentation ]
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'Documentation/x86')
-rw-r--r-- | Documentation/x86/boot.txt | 69 |
1 files changed, 65 insertions, 4 deletions
diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt index e0203662f9e9..cf8dfc70a118 100644 --- a/Documentation/x86/boot.txt +++ b/Documentation/x86/boot.txt | |||
@@ -50,6 +50,11 @@ Protocol 2.08: (Kernel 2.6.26) Added crc32 checksum and ELF format | |||
50 | Protocol 2.09: (Kernel 2.6.26) Added a field of 64-bit physical | 50 | Protocol 2.09: (Kernel 2.6.26) Added a field of 64-bit physical |
51 | pointer to single linked list of struct setup_data. | 51 | pointer to single linked list of struct setup_data. |
52 | 52 | ||
53 | Protocol 2.10: (Kernel 2.6.31) A protocol for relaxed alignment | ||
54 | beyond the kernel_alignment added, new init_size and | ||
55 | pref_address fields. | ||
56 | |||
57 | |||
53 | **** MEMORY LAYOUT | 58 | **** MEMORY LAYOUT |
54 | 59 | ||
55 | The traditional memory map for the kernel loader, used for Image or | 60 | The traditional memory map for the kernel loader, used for Image or |
@@ -173,7 +178,7 @@ Offset Proto Name Meaning | |||
173 | 022C/4 2.03+ ramdisk_max Highest legal initrd address | 178 | 022C/4 2.03+ ramdisk_max Highest legal initrd address |
174 | 0230/4 2.05+ kernel_alignment Physical addr alignment required for kernel | 179 | 0230/4 2.05+ kernel_alignment Physical addr alignment required for kernel |
175 | 0234/1 2.05+ relocatable_kernel Whether kernel is relocatable or not | 180 | 0234/1 2.05+ relocatable_kernel Whether kernel is relocatable or not |
176 | 0235/1 N/A pad2 Unused | 181 | 0235/1 2.10+ min_alignment Minimum alignment, as a power of two |
177 | 0236/2 N/A pad3 Unused | 182 | 0236/2 N/A pad3 Unused |
178 | 0238/4 2.06+ cmdline_size Maximum size of the kernel command line | 183 | 0238/4 2.06+ cmdline_size Maximum size of the kernel command line |
179 | 023C/4 2.07+ hardware_subarch Hardware subarchitecture | 184 | 023C/4 2.07+ hardware_subarch Hardware subarchitecture |
@@ -182,6 +187,8 @@ Offset Proto Name Meaning | |||
182 | 024C/4 2.08+ payload_length Length of kernel payload | 187 | 024C/4 2.08+ payload_length Length of kernel payload |
183 | 0250/8 2.09+ setup_data 64-bit physical pointer to linked list | 188 | 0250/8 2.09+ setup_data 64-bit physical pointer to linked list |
184 | of struct setup_data | 189 | of struct setup_data |
190 | 0258/8 2.10+ pref_address Preferred loading address | ||
191 | 0260/4 2.10+ init_size Linear memory required during initialization | ||
185 | 192 | ||
186 | (1) For backwards compatibility, if the setup_sects field contains 0, the | 193 | (1) For backwards compatibility, if the setup_sects field contains 0, the |
187 | real value is 4. | 194 | real value is 4. |
@@ -482,11 +489,19 @@ Protocol: 2.03+ | |||
482 | 0x37FFFFFF, you can start your ramdisk at 0x37FE0000.) | 489 | 0x37FFFFFF, you can start your ramdisk at 0x37FE0000.) |
483 | 490 | ||
484 | Field name: kernel_alignment | 491 | Field name: kernel_alignment |
485 | Type: read (reloc) | 492 | Type: read/modify (reloc) |
486 | Offset/size: 0x230/4 | 493 | Offset/size: 0x230/4 |
487 | Protocol: 2.05+ | 494 | Protocol: 2.05+ (read), 2.10+ (modify) |
495 | |||
496 | Alignment unit required by the kernel (if relocatable_kernel is | ||
497 | true.) A relocatable kernel that is loaded at an alignment | ||
498 | incompatible with the value in this field will be realigned during | ||
499 | kernel initialization. | ||
488 | 500 | ||
489 | Alignment unit required by the kernel (if relocatable_kernel is true.) | 501 | Starting with protocol version 2.10, this reflects the kernel |
502 | alignment preferred for optimal performance; it is possible for the | ||
503 | loader to modify this field to permit a lesser alignment. See the | ||
504 | min_alignment and pref_address field below. | ||
490 | 505 | ||
491 | Field name: relocatable_kernel | 506 | Field name: relocatable_kernel |
492 | Type: read (reloc) | 507 | Type: read (reloc) |
@@ -498,6 +513,22 @@ Protocol: 2.05+ | |||
498 | After loading, the boot loader must set the code32_start field to | 513 | After loading, the boot loader must set the code32_start field to |
499 | point to the loaded code, or to a boot loader hook. | 514 | point to the loaded code, or to a boot loader hook. |
500 | 515 | ||
516 | Field name: min_alignment | ||
517 | Type: read (reloc) | ||
518 | Offset/size: 0x235/1 | ||
519 | Protocol: 2.10+ | ||
520 | |||
521 | This field, if nonzero, indicates as a power of two the minimum | ||
522 | alignment required, as opposed to preferred, by the kernel to boot. | ||
523 | If a boot loader makes use of this field, it should update the | ||
524 | kernel_alignment field with the alignment unit desired; typically: | ||
525 | |||
526 | kernel_alignment = 1 << min_alignment | ||
527 | |||
528 | There may be a considerable performance cost with an excessively | ||
529 | misaligned kernel. Therefore, a loader should typically try each | ||
530 | power-of-two alignment from kernel_alignment down to this alignment. | ||
531 | |||
501 | Field name: cmdline_size | 532 | Field name: cmdline_size |
502 | Type: read | 533 | Type: read |
503 | Offset/size: 0x238/4 | 534 | Offset/size: 0x238/4 |
@@ -582,6 +613,36 @@ Protocol: 2.09+ | |||
582 | sure to consider the case where the linked list already contains | 613 | sure to consider the case where the linked list already contains |
583 | entries. | 614 | entries. |
584 | 615 | ||
616 | Field name: pref_address | ||
617 | Type: read (reloc) | ||
618 | Offset/size: 0x258/8 | ||
619 | Protocol: 2.10+ | ||
620 | |||
621 | This field, if nonzero, represents a preferred load address for the | ||
622 | kernel. A relocating bootloader should attempt to load at this | ||
623 | address if possible. | ||
624 | |||
625 | A non-relocatable kernel will unconditionally move itself and to run | ||
626 | at this address. | ||
627 | |||
628 | Field name: init_size | ||
629 | Type: read | ||
630 | Offset/size: 0x25c/4 | ||
631 | |||
632 | This field indicates the amount of linear contiguous memory starting | ||
633 | at the kernel runtime start address that the kernel needs before it | ||
634 | is capable of examining its memory map. This is not the same thing | ||
635 | as the total amount of memory the kernel needs to boot, but it can | ||
636 | be used by a relocating boot loader to help select a safe load | ||
637 | address for the kernel. | ||
638 | |||
639 | The kernel runtime start address is determined by the following algorithm: | ||
640 | |||
641 | if (relocatable_kernel) | ||
642 | runtime_start = align_up(load_address, kernel_alignment) | ||
643 | else | ||
644 | runtime_start = pref_address | ||
645 | |||
585 | 646 | ||
586 | **** THE IMAGE CHECKSUM | 647 | **** THE IMAGE CHECKSUM |
587 | 648 | ||