From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JMqFy-0002o3-60 for mharc-grub-devel@gnu.org; Wed, 06 Feb 2008 14:48:30 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMqFv-0002n0-Ms for grub-devel@gnu.org; Wed, 06 Feb 2008 14:48:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMqFr-0002m5-8P for grub-devel@gnu.org; Wed, 06 Feb 2008 14:48:27 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMqFr-0002m2-3G for grub-devel@gnu.org; Wed, 06 Feb 2008 14:48:23 -0500 Received: from ti-out-0910.google.com ([209.85.142.184]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JMqFq-0001tM-K8 for grub-devel@gnu.org; Wed, 06 Feb 2008 14:48:22 -0500 Received: by ti-out-0910.google.com with SMTP id a20so594784tia.10 for ; Wed, 06 Feb 2008 11:48:20 -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=gotAAEVpwAbYBPG4AlxHtdwryKh15iUIYCte9UajTK0=; b=io8wycQFpN7s6Hbnb3OFA0siO6EeTzNKmw0XAZ31SICrv/q1U0rx2+L1JBYmpAtjnCa9A7Zq0sIYTOMMPig22yszT4s2qiORQ0bVTJvAFXHR6nnK1Nc0dCVh2qv6ay2rnhrDHDEdKGoHG5oQ51VhGorZ6btLEmVMKnXbb3GxRrE= 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=U79qfkgW9BPMF152hAlFttHG6VzmfRmkmWoZPfiLtXdYgS0uf30lJWHVl+2OiE7FKbyIYc9n+TZVdtKLCYKOPoeragLtBFB8ANXIW8cTEP237G7qDjP/xFkS4hmf0OijG+y/GX0Vvw5o/Xupg2tjjeG1T0/oJHOcG+uYG8wixB0= Received: by 10.110.31.11 with SMTP id e11mr5540853tie.56.1202327300320; Wed, 06 Feb 2008 11:48:20 -0800 (PST) Received: by 10.110.62.19 with HTTP; Wed, 6 Feb 2008 11:48:20 -0800 (PST) Message-ID: Date: Thu, 7 Feb 2008 03:48:20 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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: Wed, 06 Feb 2008 19:48:28 -0000 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. -- Bean