qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Rewritten Linux kernel loader


From: Adam Lackorzynski
Subject: Re: [Qemu-devel] Rewritten Linux kernel loader
Date: Fri, 18 May 2007 10:46:47 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

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                 address@hidden
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]