Re: [PATCH][TAKE 4] THE LINUX/I386 BOOT PROTOCOL - Breaking the 256 limit

Alon Bar-Lev
2006-05-06T10:28:48Z

[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]

H. Peter Anvin wrote:
> John Coffman wrote:
>> At 02:57 PM Friday 5/5/2006, H. Peter Anvin wrote:
>> Okay, let me ask this:
>>
>>> If the *kernel* limit is modified, but the LILO limit is not, what
>>> will happen? This is the real crux of the matter.
>>
>> The length of the kernel command line will be limited by the size of
>> the boot loader buffer. LILO always inserts a NUL terminator.
>>
>> --John
>>
>> P.S. The LILO command line buffer has always been 1 sector (512
>> bytes); however, only the first half is actually used for the command
>> line. No kernel can do any harm by setting "boot_cmdline[511] = 0;"
>> for any version of LILO back to version 20 (and probably before).
>>
>
> Okay... **DOES ANYONE HAVE ANY ACTUAL EVIDENCE TO THE CONTRARY???**, and
> if so, **WHAT ARE THE DETAILS**?
>
> All I've heard so far is hearsay. "X said that Y had said..."
>
> -hpa
>
>

So here is an updated patch. Notice that I've removed the
redundant COMMAND_LINE_SIZE from param.h of i386 to make it
closer to other architectures. It was required in the past
to allow a boot loader to know the COMMAND_LINE_SIZE, but
LILO, GRUB, syslinux have a local definition for this, and
is not required in boot protocol >= 2.02 since a boot loader
can pass any null terminated string.

Best Regards,
Alon Bar-Lev.

[-- Attachment #2: linux-2.6.17-rc3-x86-command-line.patch --]
[-- Type: text/plain, Size: 1274 bytes --]

diff -urNp linux-2.6.17-rc3/include/asm-i386/param.h linux-2.6.17-rc3.new/include/asm-i386/param.h
--- linux-2.6.17-rc3/include/asm-i386/param.h 2006-03-20 07:53:29.000000000 +0200
+++ linux-2.6.17-rc3.new/include/asm-i386/param.h 2006-05-06 12:38:32.000000000 +0300
@@ -19,6 +19,5 @@
#endif

#define MAXHOSTNAMELEN 64 /* max length of hostname */
-#define COMMAND_LINE_SIZE 256

#endif
diff -urNp linux-2.6.17-rc3/include/asm-i386/setup.h linux-2.6.17-rc3.new/include/asm-i386/setup.h
--- linux-2.6.17-rc3/include/asm-i386/setup.h 2006-05-06 12:35:09.000000000 +0300
+++ linux-2.6.17-rc3.new/include/asm-i386/setup.h 2006-05-06 12:38:44.000000000 +0300
@@ -15,7 +15,7 @@
#define MAX_NONPAE_PFN (1 << 20)

#define PARAM_SIZE 4096
-#define COMMAND_LINE_SIZE 256
+#define COMMAND_LINE_SIZE 2048

#define OLD_CL_MAGIC_ADDR 0x90020
#define OLD_CL_MAGIC 0xA33F
diff -urNp linux-2.6.17-rc3/include/asm-ia64/setup.h linux-2.6.17-rc3.new/include/asm-ia64/setup.h
--- linux-2.6.17-rc3/include/asm-ia64/setup.h 2006-03-20 07:53:29.000000000 +0200
+++ linux-2.6.17-rc3.new/include/asm-ia64/setup.h 2006-05-06 12:40:32.000000000 +0300
@@ -1,6 +1,6 @@
#ifndef __IA64_SETUP_H
#define __IA64_SETUP_H

-#define COMMAND_LINE_SIZE 512
+#define COMMAND_LINE_SIZE 2048

#endif