aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/i386/boot.txt
diff options
context:
space:
mode:
authorBernhard Walle <bwalle@suse.de>2007-05-02 13:27:10 -0400
committerAndi Kleen <andi@basil.nowhere.org>2007-05-02 13:27:10 -0400
commit8f9aeca7a081d81c4c9862be1e04f15b5ab5461f (patch)
tree49b802b90aca5b170aba5734ef99344a90426b01 /Documentation/i386/boot.txt
parent79e030114a8d97a1dcd593ab84fb986f8c91c536 (diff)
[PATCH] x86: add command line length to boot protocol
Because the command line is increased to 2048 characters after 2.6.21, it's not possible for boot loaders and userspace tools to determine the length of the command line the kernel can understand. The benefit of knowing the length is that users can be warned if the command line size is too long which prevents surprise if things don't work after bootup. This patch updates the boot protocol to contain a field called "cmdline_size" that contain the length of the command line (excluding the terminating zero). The patch also adds missing fields (of protocol version 2.05) to the x86_64 setup code. Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: H. Peter Anvin <hpa@zytor.com> Cc: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'Documentation/i386/boot.txt')
-rw-r--r--Documentation/i386/boot.txt23
1 files changed, 17 insertions, 6 deletions
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt
index 38fe1f03fb14..6498666ea330 100644
--- a/Documentation/i386/boot.txt
+++ b/Documentation/i386/boot.txt
@@ -2,7 +2,7 @@
2 ---------------------------- 2 ----------------------------
3 3
4 H. Peter Anvin <hpa@zytor.com> 4 H. Peter Anvin <hpa@zytor.com>
5 Last update 2007-01-26 5 Last update 2007-03-06
6 6
7On the i386 platform, the Linux kernel uses a rather complicated boot 7On the i386 platform, the Linux kernel uses a rather complicated boot
8convention. This has evolved partially due to historical aspects, as 8convention. This has evolved partially due to historical aspects, as
@@ -35,9 +35,13 @@ Protocol 2.03: (Kernel 2.4.18-pre1) Explicitly makes the highest possible
35 initrd address available to the bootloader. 35 initrd address available to the bootloader.
36 36
37Protocol 2.04: (Kernel 2.6.14) Extend the syssize field to four bytes. 37Protocol 2.04: (Kernel 2.6.14) Extend the syssize field to four bytes.
38
38Protocol 2.05: (Kernel 2.6.20) Make protected mode kernel relocatable. 39Protocol 2.05: (Kernel 2.6.20) Make protected mode kernel relocatable.
39 Introduce relocatable_kernel and kernel_alignment fields. 40 Introduce relocatable_kernel and kernel_alignment fields.
40 41
42Protocol 2.06: (Kernel 2.6.22) Added a field that contains the size of
43 the boot command line
44
41 45
42**** MEMORY LAYOUT 46**** MEMORY LAYOUT
43 47
@@ -133,6 +137,8 @@ Offset Proto Name Meaning
133022C/4 2.03+ initrd_addr_max Highest legal initrd address 137022C/4 2.03+ initrd_addr_max Highest legal initrd address
1340230/4 2.05+ kernel_alignment Physical addr alignment required for kernel 1380230/4 2.05+ kernel_alignment Physical addr alignment required for kernel
1350234/1 2.05+ relocatable_kernel Whether kernel is relocatable or not 1390234/1 2.05+ relocatable_kernel Whether kernel is relocatable or not
1400235/3 N/A pad2 Unused
1410238/4 2.06+ cmdline_size Maximum size of the kernel command line
136 142
137(1) For backwards compatibility, if the setup_sects field contains 0, the 143(1) For backwards compatibility, if the setup_sects field contains 0, the
138 real value is 4. 144 real value is 4.
@@ -233,6 +239,12 @@ filled out, however:
233 if your ramdisk is exactly 131072 bytes long and this field is 239 if your ramdisk is exactly 131072 bytes long and this field is
234 0x37FFFFFF, you can start your ramdisk at 0x37FE0000.) 240 0x37FFFFFF, you can start your ramdisk at 0x37FE0000.)
235 241
242 cmdline_size:
243 The maximum size of the command line without the terminating
244 zero. This means that the command line can contain at most
245 cmdline_size characters. With protocol version 2.05 and
246 earlier, the maximum size was 255.
247
236 248
237**** THE KERNEL COMMAND LINE 249**** THE KERNEL COMMAND LINE
238 250
@@ -241,11 +253,10 @@ loader to communicate with the kernel. Some of its options are also
241relevant to the boot loader itself, see "special command line options" 253relevant to the boot loader itself, see "special command line options"
242below. 254below.
243 255
244The kernel command line is a null-terminated string currently up to 256The kernel command line is a null-terminated string. The maximum
245255 characters long, plus the final null. A string that is too long 257length can be retrieved from the field cmdline_size. Before protocol
246will be automatically truncated by the kernel, a boot loader may allow 258version 2.06, the maximum was 255 characters. A string that is too
247a longer command line to be passed to permit future kernels to extend 259long will be automatically truncated by the kernel.
248this limit.
249 260
250If the boot protocol version is 2.02 or later, the address of the 261If the boot protocol version is 2.02 or later, the address of the
251kernel command line is given by the header field cmd_line_ptr (see 262kernel command line is given by the header field cmd_line_ptr (see