LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Ian Campbell <ijc@hellion.org.uk>
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCHv2 2/3] x86: add a crc32 checksum to the kernel image.
Date: Wed, 06 Feb 2008 13:06:16 -0800	[thread overview]
Message-ID: <47AA2148.3010408@zytor.com> (raw)
In-Reply-To: <1202331640-15610-3-git-send-email-ijc@hellion.org.uk>

Ian Campbell wrote:
> Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> ---
>  Documentation/i386/boot.txt |    7 +++
>  arch/x86/boot/tools/build.c |   88 ++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 94 insertions(+), 1 deletions(-)
> 
> diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt
> index b5f5ba1..b567fb5 100644
> --- a/Documentation/i386/boot.txt
> +++ b/Documentation/i386/boot.txt
> @@ -531,6 +531,13 @@ Protocol:	2.08+
>  
>    The length of the compressed payload.
>  
> +**** THE IMAGE CHECKSUM
> +
> +The CRC-32 is calculated over the entire file using an initial
> +remainder of 0xffffffff.  The checksum is appended to the file;
> +therefore the CRC of the file up to the limit specified in the syssize
> +field of the header is always 0.
> +


This doesn't specify that the image checksum is present only for boot 
protocol 2.08 or later, nor does it specify the characteristic 
polynomial (for CRC32 in particular, I realize the Autodin II polynomial 
is pretty close to universal, but it should at least state that it is used.)

>  **** THE KERNEL COMMAND LINE
>  
>  The kernel command line has become an important way for the boot
> diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c
> index b424874..2ba22e8 100644
> --- a/arch/x86/boot/tools/build.c
> +++ b/arch/x86/boot/tools/build.c
> @@ -50,6 +50,75 @@ typedef unsigned long  u32;
>  u8 buf[SETUP_SECT_MAX*512];
>  int is_big_kernel;
>  
> +/*----------------------------------------------------------------------*/
> +
> +static const unsigned int crctab32[] = {

Really should be "u32" rather than "unsigned int".

> +	0x00000000U, 0x77073096U, 0xee0e612cU, 0x990951baU, 0x076dc419U,

The "U"s are redundant.

	-hpa

  parent reply	other threads:[~2008-02-06 21:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-06 21:00 [PATCHv2 0/3] x86: boot protocol updates Ian Campbell
2008-02-06 21:00 ` [PATCHv2 1/3] x86: use ELF format in compressed images Ian Campbell
2008-02-06 21:00   ` [PATCHv2 2/3] x86: add a crc32 checksum to the kernel image Ian Campbell
2008-02-06 21:00     ` [PATCHv2 3/3] x86: bump image header to version 2.08 Ian Campbell
2008-02-06 21:06     ` H. Peter Anvin [this message]
2008-02-07  8:23       ` [PATCHv2 2/3] x86: add a crc32 checksum to the kernel image Ian Campbell

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=47AA2148.3010408@zytor.com \
    --to=hpa@zytor.com \
    --cc=ijc@hellion.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --subject='Re: [PATCHv2 2/3] x86: add a crc32 checksum to the kernel image.' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).