Subject: Re: Fixing Multiboot
To: Julio M. Merino Vidal <>
From: Quentin Garnier <>
List: tech-kern
Date: 10/24/2006 16:33:37
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Oct 23, 2006 at 09:46:39PM +0200, Julio M. Merino Vidal wrote:
> A while ago someone fixed the i386 kernel linker script to generate
> the proper physical addresses for the segments in the binary image.
> This change allowed the use of unpatched GRUB to boot NetBSD kernels
> using the Multiboot option.  Unfortunately the fix was incomplete
> because ksyms do not work with unpatched GRUB (which means "broken"
> ddb and no lkms).  That's basically because of some nasty tricks used
> in our Multiboot code.
> The attached patch fixes this issue by dealing with the ksyms in the
> Multiboot case in a cleaner way.  (Yes, martin@, I finally implemented
> your suggestions!  Or at least I think so.)  What it does is correctly
> copy the symbol table after the kernel (without having to reserve
> space beforehand, which is what unpatched GRUB did not do) and gets
> rid of the need to generate a fake minimal ELF image to get ksyms_init
> working.  The result is a simpler implementation.
> The patch still needs some cleanup and testing in the non-Multiboot
> case which I'll do tomorrow or so.  But in the meantime I'd like to
> hear comments about the proposed solution.

The kern_ksyms.c part looks fine to me.

Quentin Garnier - -
"You could have made it, spitting out benchmarks
Owe it to yourself not to fail"
Amplifico, Spitting Out Benchmarks, Hometakes Vol. 2, 2005.

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.5 (NetBSD)