All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bean <bean123ch@gmail.com>
To: "The development of GRUB 2" <grub-devel@gnu.org>
Subject: Re: aout support almost working now
Date: Thu, 7 Feb 2008 03:48:20 +0800	[thread overview]
Message-ID: <ca0f59980802061148y666800a4ob1dd5b3dc1698cb7@mail.gmail.com> (raw)
In-Reply-To: <fod1dq$frc$1@ger.gmane.org>

On Feb 7, 2008 3:23 AM, walt <wa1ter@myrealbox.com> 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



  reply	other threads:[~2008-02-06 19:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-06 19:23 aout support almost working now walt
2008-02-06 19:48 ` Bean [this message]
2008-02-07  0:26   ` walt
2008-02-07  0:32     ` Robert Millan
2008-02-07 13:42       ` walt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ca0f59980802061148y666800a4ob1dd5b3dc1698cb7@mail.gmail.com \
    --to=bean123ch@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.