Mailing List Archive

Kernel command line truncation
Using
kernel is 2.4.30
win32 syslinux 3.52
Preparing floppy under Windows XP SP2

1) Preparing boot floppy

======= syslinux.cfg content ======================
PROMPT 0
DISPLAY warning.txt
DEFAULT kernel
APPEND root=/dev/ram0 rw initrd=ukmrd.gz ramdisk_size=5000
bdev=/dev/fd0 ip=192.168.422.25 ipm=255.255.255.0 ipreq=n
ipg=192.168.42.1 ipdns=192.168.42.2 mnet=pcnet32
durl=http://KP/ukminstall
=============================================
After boot command line is truncated
mnet=pcnet32 durl=http://KP/ukminstall
variables are not passed to init

2) Preparing boot floppy with the win32 syslinux 3.52
and syslinux-3.52\com32\samples\linux.c32 module

======= syslinux.cfg content ======================
PROMPT 0
DISPLAY warning.txt
DEFAULT syslinux 3.52
APPEND kernel root=/dev/ram0 rw initrd=ukmrd.gz ramdisk_size=5000
bdev=/dev/fd0 ip=192.168.422.25 ipm=255.255.255.0 ipreq=n
ipg=192.168.42.1 ipdns=192.168.42.2 mnet=pcnet32
durl=http://KP/ukminstall
=============================================
After boot command line is also truncated
mnet=pcnet32 durl=http://KP/ukminstall
variables are not passed to init

Kernel parameters line is truncated at the edge of about 140 bytes


According to syslinux documentation
Changes in 3.08:
* Max command line changed to 1023 characters. Note that the
kernel proper still can only handle 255 characters without
patching, and COM16 binaries can only handle 125 characters.

Does it mean that under win32 it is impossible to pass 255 symbols to
the 2.4.30 kernel using syslinux?

_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX@zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.
Re: Kernel command line truncation [ In reply to ]
Firstname Surname wrote:
> Using
>
> According to syslinux documentation
> Changes in 3.08:
> * Max command line changed to 1023 characters. Note that the
> kernel proper still can only handle 255 characters without
> patching, and COM16 binaries can only handle 125 characters.
>
> Does it mean that under win32 it is impossible to pass 255 symbols to
> the 2.4.30 kernel using syslinux?
>

The 2.4.x kernel (why are you using something that ancient?) doesn't
support more than 255 characters on its command line, total.

-hpa

_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX@zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.
Re: Kernel command line truncation [ In reply to ]
Yes, I know that 2.4 kernel sereies has limitation of 255 symbols or
additional arguments.
(There are some difficulties in moving to 2.6 because of legasy
software that need to be supported)

But ... as I wrote the problem is that after kernel boot only about
130 symbols from syslinux.cfg APPEND directive are available. The rest
of the string from APPEND directive is truncated. The whole string in
APPEND directive is shorter then 255 symbols.
That is a very strange thing

2007/11/9, H. Peter Anvin <hpa@zytor.com>:
> Firstname Surname wrote:
> > Using
> >
> > According to syslinux documentation
> > Changes in 3.08:
> > * Max command line changed to 1023 characters. Note that the
> > kernel proper still can only handle 255 characters without
> > patching, and COM16 binaries can only handle 125 characters.
> >
> > Does it mean that under win32 it is impossible to pass 255 symbols to
> > the 2.4.30 kernel using syslinux?
> >
>
> The 2.4.x kernel (why are you using something that ancient?) doesn't
> support more than 255 characters on its command line, total.
>
> -hpa
>
> ______________________________​_________________
> SYSLINUX mailing list
> Submissions to SYSLINUX@zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/l​istinfo/syslinux
> Please do not send private replies to mailing list traffic.
>
>
_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX@zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.
Re: Kernel command line truncation [ In reply to ]
Firstname Surname wrote:
> Yes, I know that 2.4 kernel sereies has limitation of 255 symbols or
> additional arguments.
> (There are some difficulties in moving to 2.6 because of legasy
> software that need to be supported)
>
> But ... as I wrote the problem is that after kernel boot only about
> 130 symbols from syslinux.cfg APPEND directive are available. The rest
> of the string from APPEND directive is truncated. The whole string in
> APPEND directive is shorter then 255 symbols.
> That is a very strange thing
>

Don't have a good explanation for that at this time. What does
/proc/cmdline show?

-hpa

_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX@zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.
Re: Kernel command line truncation [ In reply to ]
You are right.
/proc/cmdline contains all parameters set in APPEND directive

I thought that it was syslinux bug
I was confused with the folowing code
=====================
; Copy the command line from high memory
mov si,cmd_line_here
mov cx,125 ; Max cmdline len (minus space and CR)
mov di,081h ; Offset in PSP for command line
mov al,' ' ; DOS command lines begin with a space
stosb
=====================
code from the comboot.inc


I checked kernel command line parameters through the environment
variables in init
And some of them that I had set in APPEND were missing.
I think the reason is in 2.4 kernel source linux\init\main.c
======================================
/*
* Boot command-line arguments
*/
#define MAX_INIT_ARGS 8
#define MAX_INIT_ENVS 8
======================================
Kernel limits the number of arguments and variables that are passed to init

Thanks a lot for advice!


2007/11/10, H. Peter Anvin <hpa@zytor.com>:
> Firstname Surname wrote:
> > Yes, I know that 2.4 kernel sereies has limitation of 255 symbols or
> > additional arguments.
> > (There are some difficulties in moving to 2.6 because of legasy
> > software that need to be supported)
> >
> > But ... as I wrote the problem is that after kernel boot only about
> > 130 symbols from syslinux.cfg APPEND directive are available. The rest
> > of the string from APPEND directive is truncated. The whole string in
> > APPEND directive is shorter then 255 symbols.
> > That is a very strange thing
> >
>
> Don't have a good explanation for that at this time. What does
> /proc/cmdline show?
>
> -hpa
>
> _______________________________________________
> SYSLINUX mailing list
> Submissions to SYSLINUX@zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux
> Please do not send private replies to mailing list traffic.
>
>

_______________________________________________
SYSLINUX mailing list
Submissions to SYSLINUX@zytor.com
Unsubscribe or set options at:
http://www.zytor.com/mailman/listinfo/syslinux
Please do not send private replies to mailing list traffic.