[Novalug] /proc/cmdline size limitation?
Mark Smith
mark@winksmith.com
Thu Mar 6 23:31:25 EST 2008
so does that mean all of the arguments are used and not stored?
or not used and not stored?
is COMMAND_LINE_SIZE here the kernel command line? e.g.
initrd=/floppy root=...
On Thu, Mar 06, 2008 at 09:39:48PM -0500, DonJr wrote:
> On Fri, 2008-03-07 at 14:20 +1300, Mark Smith wrote:
> > what's the limit on the kernel command line parameters? namely,
> > i've noticed that the /proc/cmdline returns only the first 256 bytes
> > of the command line (FC4). if the line is longer than that, are
> > the contained parameters used by the kernel and only the first 256
> > bytes of it is recorded to be later shown to the user through
> > /proc/cmdline? or does the kernel only see the first 256 characters
> > and ignores the rest silently?
>
> The default maximun size depends on the ARCH the kernel is compiled for.
>
> cd /usr/src/linux/include
> rgrep "define COMMAND_LINE_SIZE" * | sort -u -t / -k 1,1
>
> asm/param.h:#define COMMAND_LINE_SIZE 1024
> asm-alpha/setup.h:#define COMMAND_LINE_SIZE 256
> asm-arm/setup.h:#define COMMAND_LINE_SIZE 1024
> asm-arm26/setup.h:#define COMMAND_LINE_SIZE 1024
> asm-cris/setup.h:#define COMMAND_LINE_SIZE 256
> asm-frv/param.h:#define COMMAND_LINE_SIZE 512
> asm-h8300/setup.h:#define COMMAND_LINE_SIZE 512
> asm-i386/param.h:#define COMMAND_LINE_SIZE 1024
> asm-ia64/setup.h:#define COMMAND_LINE_SIZE 1024
> asm-m32r/setup.h:#define COMMAND_LINE_SIZE (512)
> asm-m68k/setup.h:#define COMMAND_LINE_SIZE CL_SIZE
> asm-m68knommu/setup.h:#define COMMAND_LINE_SIZE 512
> asm-mips/setup.h:#define COMMAND_LINE_SIZE 256
> asm-parisc/setup.h:#define COMMAND_LINE_SIZE 1024
> asm-powerpc/setup.h:#define COMMAND_LINE_SIZE 1024
> asm-s390/setup.h:#define COMMAND_LINE_SIZE 896
> asm-sh/setup.h:#define COMMAND_LINE_SIZE 256
> asm-sh64/setup.h:#define COMMAND_LINE_SIZE 256
> asm-sparc/setup.h:#define COMMAND_LINE_SIZE 256
> asm-sparc64/setup.h:#define COMMAND_LINE_SIZE 1024
> asm-um/setup.h:#define COMMAND_LINE_SIZE 4096
> asm-v850/setup.h:#define COMMAND_LINE_SIZE 512
> asm-x86_64/setup.h:#define COMMAND_LINE_SIZE 1024
> asm-xtensa/setup.h:#define COMMAND_LINE_SIZE 256
>
> The MAX is also controlled/limited by the size of the memory block used
> to pass this information to the kernel in the first place.
>
> For i386 arch kernels this is a relative small size because the block
> used to pass this data can only exists in REAL MODE Address space.
--
Mark Smith
mark@winksmith.com
mark@tux.org
More information about the Novalug
mailing list