Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JMmki-0005v6-Mv for mharc-grub-devel@gnu.org; Wed, 06 Feb 2008 11:04:00 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMmkg-0005uO-Pr for grub-devel@gnu.org; Wed, 06 Feb 2008 11:03:58 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMmke-0005tn-OQ for grub-devel@gnu.org; Wed, 06 Feb 2008 11:03:57 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMmke-0005tk-JU for grub-devel@gnu.org; Wed, 06 Feb 2008 11:03:56 -0500 Received: from ti-out-0910.google.com ([209.85.142.187]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JMmke-00035l-6q for grub-devel@gnu.org; Wed, 06 Feb 2008 11:03:56 -0500 Received: by ti-out-0910.google.com with SMTP id a20so509556tia.10 for ; Wed, 06 Feb 2008 08:03:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=iR5OtPAQjz5KK/G7TZJ3hkhq6v6yOuzWTCLJqpWlql8=; b=vOxEJmpIlZOLq0ObCzVlfJoYyhHrs761M8RNQ3ArzN1f5n2jI5WvZYEN14IIHbvhqhdf3JN2QwQfMBQ+N6YTCt524cTfUrPtyHwv2zS95sgMi0mlJcV/zecOcvg0AVSqeacX9DFJXYmZ1Yiifs7GJUIK4m9IleDP68qiQZlpL+s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=mUzZVnMq6VexSqJwBDHvU5AI08QPSxL4iuMwB3OuCCLrgfBBJRneQwS6mjmkWgXNUHDzTw5L61Ds36mcBtn8cDhpcs2gMFi6aJnXjJYkiQcMzjlHVBv6zp1iYTwj+CyCgPI3XbMvGFWK4OU/rTYzlQexZ3/hE7a+sUhPHrneF5A= Received: by 10.110.43.18 with SMTP id q18mr5230374tiq.24.1202313832519; Wed, 06 Feb 2008 08:03:52 -0800 (PST) Received: by 10.110.62.19 with HTTP; Wed, 6 Feb 2008 08:03:52 -0800 (PST) Message-ID: Date: Thu, 7 Feb 2008 00:03:52 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <20080206153215.GA30816@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <87myqvzkqk.fsf@xs4all.nl> <20080124143306.GB8248@thorin> <20080124145317.GA9385@thorin> <1201193272.334.2.camel@k9.localnet> <20080124171206.GA1515@thorin> <20080206153215.GA30816@thorin> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: booting kernel of NetBSD (Re: UFS (FFS) support seems broken in grub2) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2008 16:03:58 -0000 On Feb 6, 2008 11:32 PM, Robert Millan wrote: > On Sat, Jan 26, 2008 at 11:01:49PM +0800, Bean wrote: > > > > * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Get physical > > address of entry. > > (grub_multiboot_load_elf64): Likewise. > > (grub_multiboot): Initialize mbi structure. > > > > > > diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c > > index fa6346e..2fd2b24 100644 > > --- a/loader/i386/pc/multiboot.c > > +++ b/loader/i386/pc/multiboot.c > > @@ -96,6 +96,7 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) > > { > > Elf32_Ehdr *ehdr = (Elf32_Ehdr *) buffer; > > Elf32_Phdr *phdr; > > + grub_addr_t real_entry = 0; > > I would suggest a more explicit name, like physical_entry_addr or so. That'd > make it easier to understand without the context of your mail and changelog > entry. > > > + grub_memset (mbi, 0, sizeof (struct grub_multiboot_info)); > > I wonder if it'd make sense to do this in grub_malloc(). This would save us > from similar bugs in the future (and have the advantage that memory handling > bugs would be exposed earlier). What do you think, is this idea too crazy? :-) > > (I would still add grub_memset here for now, though; makes no sense to delay > it) thanks for your advise, fix and committed. -- Bean