public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@in.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	alon.barlev@gmail.com, ak@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86_64, i386: Add command line length to boot protocol
Date: Wed, 7 Mar 2007 15:35:45 +0530	[thread overview]
Message-ID: <20070307100545.GA9807@in.ibm.com> (raw)
In-Reply-To: <20070306181430.GB3151@strauss.suse.de>

On Tue, Mar 06, 2007 at 07:14:30PM +0100, Bernhard Walle wrote:
> 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 makes sense to me. It can be used in kexec bootloader to warn user
if command line size exceeds than supported by kernel.

> 
> 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.

Today I have posted the x86_64 relocatable kernel patches which also fill
in missing 2.05 fields for x86_64.

[..]
>  #define SIG1	0xAA55
> @@ -81,7 +82,7 @@ start:
>  # This is the setup header, and it must start at %cs:2 (old 0x9020:2)
> 
>  		.ascii	"HdrS"		# header signature
> -		.word	0x0205		# header version number (>= 0x0105)
> +		.word	0x0206		# header version number (>= 0x0105)
>  					# or else old loadlin-1.5 will fail)
>  realmode_swtch:	.word	0, 0		# default_switch, SETUPSEG
>  start_sys_seg:	.word	SYSSEG
> @@ -171,6 +172,10 @@ relocatable_kernel:    .byte 0
>  pad2:			.byte 0
>  pad3:			.word 0
> 
> +cmdline_size:   .long   COMMAND_LINE_SIZE-1     #length of the command line,
> +                                                #added with boot protocol
> +                                                #version 2.06
> +

I think you will not require more than two bytes to represent supported
command line size so you can use replace pad3 and use these two bytes. These
were anyway padding bytes to be used for other requirements.

[..]
>  					# or else old loadlin-1.5 will fail)
>  realmode_swtch:	.word	0, 0		# default_switch, SETUPSEG
>  start_sys_seg:	.word	SYSSEG
> @@ -155,6 +156,18 @@ cmd_line_ptr:	.long 0			# (Header versio
>  					# low memory 0x10000 or higher.
> 
>  ramdisk_max:	.long 0xffffffff
> +
> +kernel_alignment:  .long CONFIG_PHYSICAL_START 	#physical addr alignment
> +						#(not relocatable =>
> +						#fixed start == alignment)
> +

This is wrong. CONFIG_PHYSICAL_START is not alignment. On x86_64 alignment
required is 2MB. (0x200000).

Thanks
Vivek

  parent reply	other threads:[~2007-03-07 10:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-06 18:14 [PATCH] x86_64, i386: Add command line length to boot protocol Bernhard Walle
2007-03-06 18:21 ` Dave Jones
2007-03-12 10:43   ` Pavel Machek
2007-03-12 20:55     ` Dave Jones
2007-03-12 23:12       ` Pavel Machek
2007-03-12 23:39         ` Dave Jones
2007-03-06 21:46 ` Alon Bar-Lev
2007-03-07 10:05 ` Vivek Goyal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-02-13 16:49 Bernhard Walle
2007-02-04 18:05 Bernhard Walle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070307100545.GA9807@in.ibm.com \
    --to=vgoyal@in.ibm.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alon.barlev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox