* aout support almost working now @ 2008-02-06 19:23 walt 2008-02-06 19:48 ` Bean 0 siblings, 1 reply; 5+ messages in thread From: walt @ 2008-02-06 19:23 UTC (permalink / raw) To: grub-devel 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? ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: aout support almost working now 2008-02-06 19:23 aout support almost working now walt @ 2008-02-06 19:48 ` Bean 2008-02-07 0:26 ` walt 0 siblings, 1 reply; 5+ messages in thread From: Bean @ 2008-02-06 19:48 UTC (permalink / raw) To: The development of GRUB 2 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 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: aout support almost working now 2008-02-06 19:48 ` Bean @ 2008-02-07 0:26 ` walt 2008-02-07 0:32 ` Robert Millan 0 siblings, 1 reply; 5+ messages in thread From: walt @ 2008-02-07 0:26 UTC (permalink / raw) To: grub-devel Bean wrote: > 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. 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. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: aout support almost working now 2008-02-07 0:26 ` walt @ 2008-02-07 0:32 ` Robert Millan 2008-02-07 13:42 ` walt 0 siblings, 1 reply; 5+ messages in thread From: Robert Millan @ 2008-02-07 0:32 UTC (permalink / raw) To: The development of GRUB 2 On Wed, Feb 06, 2008 at 04:26:15PM -0800, walt wrote: > >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 ? If he guessed right, you don't need to do anything special, and 0x80 will work for you. The patch is not correct because it breaks setups in which boot disk is not the first one. But that doesn't seem to affect you. -- Robert Millan <GPLv2> I know my rights; I want my phone call! <DRM> What use is a phone call… if you are unable to speak? (as seen on /.) ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: aout support almost working now 2008-02-07 0:32 ` Robert Millan @ 2008-02-07 13:42 ` walt 0 siblings, 0 replies; 5+ messages in thread From: walt @ 2008-02-07 13:42 UTC (permalink / raw) To: grub-devel On Thu, 2008-02-07 at 01:32 +0100, Robert Millan wrote: > On Wed, Feb 06, 2008 at 04:26:15PM -0800, walt wrote: > > >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 ? > > If he guessed right, you don't need to do anything special, and 0x80 > will work for you. > > The patch is not correct because it breaks setups in which boot disk is not > the first one. But that doesn't seem to affect you. Sorry to report that this patch changes nothing :o( Behavior is exactly the same. However, that particular section of code seems to be for multiboot kernels, and the FreeBSD kernel is not multiboot (yet). Could that be the problem? ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-02-07 13:42 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-02-06 19:23 aout support almost working now walt 2008-02-06 19:48 ` Bean 2008-02-07 0:26 ` walt 2008-02-07 0:32 ` Robert Millan 2008-02-07 13:42 ` walt
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.