grub-devel
[Top][All Lists]
Advanced

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

Re: booting kernel of NetBSD (Re: UFS (FFS) support seems broken in grub


From: Robert Millan
Subject: Re: booting kernel of NetBSD (Re: UFS (FFS) support seems broken in grub2)
Date: Wed, 6 Feb 2008 16:32:16 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

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)

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)




reply via email to

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