grub-devel
[Top][All Lists]
Advanced

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

Re: loadee relocation (Re: loader modules jumping back to kernel)


From: Robert Millan
Subject: Re: loadee relocation (Re: loader modules jumping back to kernel)
Date: Sat, 2 Aug 2008 00:45:20 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Fri, Aug 01, 2008 at 06:16:06PM +0200, Robert Millan wrote:
> On Fri, Aug 01, 2008 at 01:45:30AM +0200, Robert Millan wrote:
> > 
> >   - What to do about physical_entry_addr now?  My patch currently discards
> >     it, which I suppose is not what we want.
> 
> Fixed after some discussion with Bean on IRC.  This version of the patch
> should handle physical_entry_addr fine.

Then again, I still got spurious crashes when trying my code with:
ftp://ftp.netbsd.org/pub/NetBSD-daily/netbsd-4/200807310002Z/i386/binary/kernel/netbsd-GENERIC.gz

In case someone is curious, the problems that made me spend all day debugging
are:

  grub_multiboot_payload_entry_offset was defined with a 64-bit type but
  allocated with ".long 0" in loader.S, resulting in the first 4 bytes of
  grub_multiboot_real_boot being fucked up occasionally.

  %edi was off-by-one in the backward relocator, which was not usually a
  problem for invaders (what harm can one byte do?) but broke netbsd.

Lessons learned: gdb is your friend, and is definitely worth the hassle
of setting up for use in QEMU/GRUB.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."

Attachment: relocate_payload.diff
Description: Text Data


reply via email to

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