From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HoyFH-0007x3-KR for qemu-devel@nongnu.org; Fri, 18 May 2007 04:55:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HoyFE-0007uT-CV for qemu-devel@nongnu.org; Fri, 18 May 2007 04:55:31 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HoyFE-0007uP-6E for qemu-devel@nongnu.org; Fri, 18 May 2007 04:55:28 -0400 Received: from os.inf.tu-dresden.de ([141.76.48.99]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Hoy70-0007sL-MX for qemu-devel@nongnu.org; Fri, 18 May 2007 04:46:59 -0400 Date: Fri, 18 May 2007 10:46:47 +0200 From: Adam Lackorzynski Subject: Re: [Qemu-devel] Rewritten Linux kernel loader Message-ID: <20070518084646.GY14071@os.inf.tu-dresden.de> References: <464B783A.8050501@zytor.com> <464CC3F1.9040704@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <464CC3F1.9040704@zytor.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "H. Peter Anvin" Cc: qemu-devel@nongnu.org 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/