From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JMuaa-0000Ia-Rq for mharc-grub-devel@gnu.org; Wed, 06 Feb 2008 19:26:04 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMuaZ-0000Gl-8b for grub-devel@gnu.org; Wed, 06 Feb 2008 19:26:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMuaY-0000Fd-Dn for grub-devel@gnu.org; Wed, 06 Feb 2008 19:26:02 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMuaY-0000FM-6P for grub-devel@gnu.org; Wed, 06 Feb 2008 19:26:02 -0500 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JMuaX-00022K-On for grub-devel@gnu.org; Wed, 06 Feb 2008 19:26:02 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JMuaN-0004gp-Gp for grub-devel@gnu.org; Thu, 07 Feb 2008 00:25:51 +0000 Received: from adsl-69-234-217-207.dsl.irvnca.pacbell.net ([69.234.217.207]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Feb 2008 00:25:51 +0000 Received: from wa1ter by adsl-69-234-217-207.dsl.irvnca.pacbell.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Feb 2008 00:25:51 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: grub-devel@gnu.org From: walt Date: Wed, 06 Feb 2008 16:26:15 -0800 Organization: none Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: adsl-69-234-217-207.dsl.irvnca.pacbell.net User-Agent: Thunderbird 3.0a1pre (X11/2008020604) In-Reply-To: Sender: news X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Subject: Re: aout support almost working now 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: Thu, 07 Feb 2008 00:26:03 -0000 Bean wrote: > On Feb 7, 2008 3:23 AM, walt wrote: >> With Bean's last two commits I can almost replace legacy with grub2 >> at least on x86. I have still one problem with the aout support that >> Bean posted as a patch on Jan 27. >> >> Using legacy, which loads the FreeBSD /boot/loader as the 'kernel', >> loader then reads its config files from the /boot directory so it >> knows what parameters to pass to the real kernel and also what menu >> items to show the user. >> >> Using grub2 with Bean's aout patch, I can load /boot/loader and >> then boot it successfully, but it seems that 'loader' can't find >> its config files in the /boot directory. This is what it prints: >> >> Can't work out which disk we are booting from. >> Guessed BIOS device 0xffffffff not found by probes, >> defaulting to disk0: can't load "kernel". >> >> At least on my machine, disk0 is the floppy drive and loader does >> actually go to try to read it before printing the error messages >> I listed, and then it drops to its interactive prompt. >> >> By examining the loader's variables it's clear that it never found >> its usual config files in /boot. >> >> BTW, I did set 'root' and 'prefix' to point at the correct partition >> before booting the loader. >> >> Any ideas what else to try? > > i think the %edx should be set before jumping to code, try this patch: > > diff --git a/kern/i386/loader.S b/kern/i386/loader.S > index 266f4ef..88f3045 100644 > --- a/kern/i386/loader.S > +++ b/kern/i386/loader.S > @@ -137,6 +137,7 @@ FUNCTION(grub_multiboot_real_boot) > cli > > /* Move the magic value into eax and jump to the kernel. */ > + movl $0x80, %edx > movl $MULTIBOOT_MAGIC2,%eax > popl %ecx > jmp *%ecx > @@ -159,6 +160,7 @@ FUNCTION(grub_multiboot2_real_boot) > cli > > /* Move the magic value into eax and jump to the kernel. */ > + movl $0x80, %edx > movl $MULTIBOOT2_BOOTLOADER_MAGIC,%eax > popl %ecx > jmp *%ecx > > Please note that this is not a proper patch, it assume booting from > the (hd0,0,a). you can adjust the value of %edx if you boot from other > partition. Sorry, I don't know what adjustment to make. I did find a macro for MULTIBOOT_INFO_DISK_INFO but it's never actually used anywhere :o/ I'm trying to load (hd0,3,a) -- can you show me the right value for %edx ? Thanks.