grub-devel
[Top][All Lists]
Advanced

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

Re: aout support almost working now


From: walt
Subject: Re: aout support almost working now
Date: Wed, 06 Feb 2008 16:26:15 -0800
User-agent: Thunderbird 3.0a1pre (X11/2008020604)

Bean wrote:
On Feb 7, 2008 3:23 AM, walt<address@hidden>  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.





reply via email to

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