qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Rewritten Linux kernel loader
Date: Fri, 18 May 2007 10:46:47 +0200	[thread overview]
Message-ID: <20070518084646.GY14071@os.inf.tu-dresden.de> (raw)
In-Reply-To: <464CC3F1.9040704@zytor.com>

Hi,

On Thu May 17, 2007 at 14:06:57 -0700, H. Peter Anvin wrote:
> +/* Generate an initial boot sector which sets state and jump to
> +   a specified vector */
> +static int generate_bootsect(uint32_t gpr[8], uint16_t segs[6], uint16_t ip)
> +{
> +    uint8_t bootsect[512], *p;
> +    int i;
> +
> +    if (bs_table[0] == NULL) {
> +	fprintf(stderr, "A disk image must be given for 'hda' when booting "
> +		"a Linux kernel\n");
> +	exit(1);
> +    }
> +
> +    memset(bootsect, 0, sizeof(bootsect));
> +
> +    /* Copy the MSDOS partition table if possible */
> +    bdrv_read(bs_table[0], 0, bootsect, 1);
> +
> +    /* Make sure we have a partition signature */
> +    bootsect[0x510] = 0x55;
> +    bootsect[0x511] = 0xaa;

These two should be decimal instead of hex.



Adam
-- 
Adam                 adam@os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/

  reply	other threads:[~2007-05-18  8:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-16 21:31 [Qemu-devel] Rewritten Linux kernel loader H. Peter Anvin
2007-05-17 15:14 ` Ed Swierk
2007-05-17 15:27 ` Paul Brook
2007-05-17 21:06 ` H. Peter Anvin
2007-05-18  8:46   ` Adam Lackorzynski [this message]
2007-05-18 16:35     ` H. Peter Anvin

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=20070518084646.GY14071@os.inf.tu-dresden.de \
    --to=adam@os.inf.tu-dresden.de \
    --cc=hpa@zytor.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).