linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re : Newworld OF boot
@ 1999-11-04 23:48 Florent
  0 siblings, 0 replies; 7+ messages in thread
From: Florent @ 1999-11-04 23:48 UTC (permalink / raw)
  To: Ethan Benson; +Cc: linuxppc-dev


>>Has anyone succeeded in booting newworld macintoshes (ie the iMac or the B&W
>>G3) using OF ?
>
> no
>
>>I'm
>>sure there is a way to turn around.
>
> yup, we need a elf version of quik that works, then we can stick that
> on a tiny partition and not have to use msdosfs or hfs for the root
> filesystem
[...]
> let me know if you find out anything else, I want to fix this issue
> but it seems that everyone else just want to use bootx for eternity.
> it would be nice if you could find a way to make OF load a bootblock
> as that would be cleaner then a partition, if you can write code then
> perhaps fix the quik second stage loader (elf version) to work
> properly (it loads now but just says an error because it does not
> expect to be loaded like that)

I'm currently working on the second stage loader (version 2.0.0a). When it
is launched from OF, it detects the machine as a CHRP and fixes the root
partition as the second one (this part of the code seems to be a quick add).

Things I've changed :
-in main.c line 353: replaced fip->conf_part = 2; with my root partition
number.
-in disk.c line 59 : sprintf(bootdevice, "disk:0"); replaced disk:0 with hd
(or ultra0) to match the blueg3 firmware's aliases names.

Now it works better, but it fails when it tries to open /etc/quik.conf (call
to ext2fs_open() in file.c) : I get a Default Catch error and OF breaks.

Since the second stage loader relies on OF for raw disk access, and that
doesn't seems to work with newworld's OF, i think it will never boot this
way.
I think that there is no way else than make an OF-readable partition
containing the kernel and an elf program to load it...

I must boot MacOS to boot Linux, then I modify and compile quik, then I
reboot my computer to test it with OF, then it crashes, then I reboot under
MacOS, then Linux... I'm fed up with rebooting.


--
Il est maintenant temps de clore votre connection et de reprendre une vie
normale.
Mon e-mail : FloBo@iName.com (Florent Boudet)
Mon e-mail secondaire : FloBo@Rocketmail.com (je ne le regarde jamais)
Mon QG : http://www.multimania.com/flobo/

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re : Newworld OF boot
@ 1999-11-11  4:48 Florent
  1999-11-11 15:47 ` David Edelsohn
  0 siblings, 1 reply; 7+ messages in thread
From: Florent @ 1999-11-11  4:48 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 2100 bytes --]

> Marius Vollmer recently released "poof", an OF bootloader for NewWorld
> that apparently can read the kernel from ext2. I didn't test it nor I
> remember the URL, but a search on the linuxppc-usr mailing list archive
> should work.

Poof loads and boots perfectly on BlueG3, so it seems there's nothing more
to do.
It doesn't read the kernel from ext2 but from an OF-readable disk, or the
kernel may be included in poof's file.

> I think the new OF actually _can_ do raw block i/o since MacOS X Server
> bootloader will load and link the kernel from an UFS partition (which is
> obviously not supported by OF natively). I suggest you look at Darwin's
> SecondaryLoader source code on publicsource.apple.com. It contains a
> bunch of OF calls from the C code, some of them may give you some light
> on the matter.

It seems that the modified secondary quik bootloader doesn't really crashes
when using OF for raw disk access but in the middle of ext2fs'partition
opening code. And MacOS X server bootloader loads the kernel from the UFS
partition (even if the bootloader is on an HFS partition). But where is
Darwin's SecondaryLoader source code ? I've downloaded all Darwin files
containing the word "loader" but it doesn't seems to be here...

I have included an os chooser written in Forth that works with poof (you
must first install it). It's written for my configuration but it should be
easy to adapt since it's plain text and there is nothing else to do than
changing the partition numbers (and erase MacOS X from the list for those
who don't have it) To use it, you must first install poof, then copy
blueboot into an OF readable folder (like MacOS System Folder) and then
change the boot device (setenv boot-device hd:X,\\blueboot  where X is the
partition number containing blueboot, usually 5 if you put it into your
MacOS System folder).


--
Il est maintenant temps de clore votre connection et de reprendre une vie
normale.
Mon e-mail : FloBo@iName.com (Florent Boudet)
Mon e-mail secondaire : FloBo@Rocketmail.com (je ne le regarde jamais)
Mon QG : http://www.multimania.com/flobo/

[-- Attachment #2: blueboot --]
[-- Type: text/plain, Size: 1984 bytes --]

<CHRP-BOOT>\r<COMPATIBLE>\riMac,1 PowerMac1,1 PowerBook1,1\r</COMPATIBLE>\r<DESCRIPTION>\rMacROM for NewWorld.\r</DESCRIPTION>\r<BOOT-SCRIPT>\r: gotoscr " dev screen" evaluate ;\rgotoscr\r: crrr\r"     " swap dup 0a swap 0d swap 2! swap write drop\r"     " swap dup 0d swap 0a swap 2! swap write drop ;\r: clearrr "     " swap dup 0c swap 0c swap 2! swap write drop ;\r: printff write drop ;\r: macosxboot " boot hd:6,\\:tbxi" evaluate ;\r: linboot " boot hd:5,\\poof boot hd:5,\\vmlinux root=/dev/hda10 video=aty128fb;single" evaluate ;\r: macosboot " boot hd:5,\\:tbxi" evaluate ;\rcrrr\rcrrr\rcrrr\rcrrr "   ***************************************" printff\rcrrr "   *         Welcome to BlueBoot         *" printff\rcrrr "   *         ___________________         *" printff\rcrrr "   *                                     *" printff\rcrrr "   *                                     *" printff\rcrrr "   *          (M) MacOS 8.6              *" printff\rcrrr "   *          (X) MacOS X Server         *" printff\rcrrr "   *          (L) Linux                  *" printff\rcrrr "   *          (O) OpenFirmware           *" printff\rcrrr "   *                                     *" printff\rcrrr "   * Please press M-X-L-O to boot an OS  *" printff\rcrrr "   ***************************************" printff\rcrrr\rcrrr\rcrrr "                   ********************************************" printff\rcrrr "                   *   (c) the BlueBoot Team                  *" printff\rcrrr "                   *            FloBo and Jeko                *" printff\rcrrr "                   *                                          *" printff\rcrrr "                   *                    BlueBoot@iFrance.com  *" printff\rcrrr "                   ********************************************" printff\rkey dup dup\r6c = if ." Booting Linux..." cr linboot then\r6d = if ." Booting MacOS..." cr macosboot then\r78 = if ." Booting MacOS X Server..." cr macosxboot then\rcr ." end of BOOT-SCRIPT"\rclearrr\r</BOOT-SCRIPT>\r</CHRP-BOOT>\r

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re : Newworld OF boot
  1999-11-11  4:48 Re : Newworld OF boot Florent
@ 1999-11-11 15:47 ` David Edelsohn
  1999-11-11 16:01   ` Ethan Benson
  0 siblings, 1 reply; 7+ messages in thread
From: David Edelsohn @ 1999-11-11 15:47 UTC (permalink / raw)
  To: Florent; +Cc: Benjamin Herrenschmidt, linuxppc-dev


	What is the requirement for the OF booter reading the kernel from
a filesystem?  AIX piggybacks the kernel on the OF booter itself.  The
entire file is loaded by OF and then the booter decompresses and/or copies
the kernel to the location from which it takes control and relocates
itself to its final destination.  This may not be perfect, but it avoids
the problems of teaching the OF booter how to read partions and
filesystems. 

David

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re : Newworld OF boot
  1999-11-11 15:47 ` David Edelsohn
@ 1999-11-11 16:01   ` Ethan Benson
  1999-11-11 16:06     ` David Edelsohn
  0 siblings, 1 reply; 7+ messages in thread
From: Ethan Benson @ 1999-11-11 16:01 UTC (permalink / raw)
  To: David Edelsohn, Florent; +Cc: Benjamin Herrenschmidt, linuxppc-dev


On 11/11/99 David Edelsohn wrote:

>	What is the requirement for the OF booter reading the kernel from
>a filesystem?  AIX piggybacks the kernel on the OF booter itself.  The
>entire file is loaded by OF and then the booter decompresses and/or copies
>the kernel to the location from which it takes control and relocates
>itself to its final destination.  This may not be perfect, but it avoids
>the problems of teaching the OF booter how to read partions and
>filesystems.

because you have to recompile your booter every time you recompile 
the kernel, or keep the kernel in a nonstandard location.

also ultimately it would be nice for the booter to support multiple 
images, if the loader does not support the root filesystem you have 
to make this silly boot partition much larger then it need be.

if reading right from the ext2fs can be done it would simply be much 
nicer that way.

it should be possible since even apple managed to do it with their 
version of BootX (OSXS loader)



Best Regards,
Ethan Benson
To obtain my PGP key: http://www.alaska.net/~erbenson/pgp/

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re : Newworld OF boot
  1999-11-11 16:01   ` Ethan Benson
@ 1999-11-11 16:06     ` David Edelsohn
  1999-11-11 16:13       ` Ethan Benson
  1999-11-12 13:03       ` Gabriel Paubert
  0 siblings, 2 replies; 7+ messages in thread
From: David Edelsohn @ 1999-11-11 16:06 UTC (permalink / raw)
  To: Ethan Benson; +Cc: Florent, Benjamin Herrenschmidt, linuxppc-dev


>>>>> Ethan Benson writes:

Ethan> because you have to recompile your booter every time you recompile 
Ethan> the kernel, or keep the kernel in a nonstandard location.

	One does not need to recompile the booter, only rebuild the boot
file with new piggyback information.  If one piggybacks the kernel then
network booting becomes much simpler because the file loaded via BOOTP
contains all of the information to boot into the kernel.

David


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re : Newworld OF boot
  1999-11-11 16:06     ` David Edelsohn
@ 1999-11-11 16:13       ` Ethan Benson
  1999-11-12 13:03       ` Gabriel Paubert
  1 sibling, 0 replies; 7+ messages in thread
From: Ethan Benson @ 1999-11-11 16:13 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Florent, Benjamin Herrenschmidt, linuxppc-dev


On 11/11/99 David Edelsohn wrote:

>
>	One does not need to recompile the booter, only rebuild the boot
>file with new piggyback information.

whatever

>If one piggybacks the kernel then
>network booting becomes much simpler because the file loaded via BOOTP
>contains all of the information to boot into the kernel.

fine why can't we do it both ways? for local installs its more 
convenient to have the kernel in the standard place on a ext2fs, for 
netboots its easier to piggy back it, support both and we have an 
ideal bootloader.



Best Regards,
Ethan Benson
To obtain my PGP key: http://www.alaska.net/~erbenson/pgp/

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re : Newworld OF boot
  1999-11-11 16:06     ` David Edelsohn
  1999-11-11 16:13       ` Ethan Benson
@ 1999-11-12 13:03       ` Gabriel Paubert
  1 sibling, 0 replies; 7+ messages in thread
From: Gabriel Paubert @ 1999-11-12 13:03 UTC (permalink / raw)
  To: David Edelsohn
  Cc: Ethan Benson, Florent, Benjamin Herrenschmidt, linuxppc-dev




On Thu, 11 Nov 1999, David Edelsohn wrote:

> 
> >>>>> Ethan Benson writes:
> 
> Ethan> because you have to recompile your booter every time you recompile 
> Ethan> the kernel, or keep the kernel in a nonstandard location.
> 
> 	One does not need to recompile the booter, only rebuild the boot
> file with new piggyback information.  If one piggybacks the kernel then
> network booting becomes much simpler because the file loaded via BOOTP
> contains all of the information to boot into the kernel.

Indeed, that's fairly close to what I do for my MVME boards (which don't
have Open Firmware, or rather no more have it). The bootloader is compiled
with the -mrelocatable option because you never know where it will be
loaded on these machines (netboots load low, disk boots load close to the
top). The bootloader with the piggybacked compressed kernels: 

a) performs load time relocations where it has been loaded by firmware

b) analyzes residual data to find free memory

c) moves itself to the highest possible address as one big chunk,
allocates some stack space and initializes its own memory management.

d) performs again the load time relocations, clear the bss now that it
is guaranteed that it does not conflict with system data. Prior to this
point, no bss variable could be used and pointers were subject to
change, requiring very careful usagge of global variable and pointers.

e) perform some more initialization, on my boards it switches from PreP
to CHRP mappings and reallocates all PCI I/O and MMIO in a smarter way.

f) unzips the kernel and starts it.

Actually the code includes some possibly interesting features: 
- a simple memory management system,
- an x86 ROM BIOS emulator,

And the image is built using a linker script, no need for mkprep... I have
no machines wit OF (actually I do, but the MVME2600 OF is such a nest of
bugs), so I can't extend it to support OF although it should not be too
difficult. The patches for 2.2.12 can be found at

	ftp://vlab1.iram.es/pub/linux-2.2/

Actually I think that this code could even be extended to perform the last
linking step of the kernel depending on the machine (I already import a
few symbols from vmlinux in the bootloader, which for example clears the
bss,  but it could do other things too). 

	Gabriel.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1999-11-12 13:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-11-11  4:48 Re : Newworld OF boot Florent
1999-11-11 15:47 ` David Edelsohn
1999-11-11 16:01   ` Ethan Benson
1999-11-11 16:06     ` David Edelsohn
1999-11-11 16:13       ` Ethan Benson
1999-11-12 13:03       ` Gabriel Paubert
  -- strict thread matches above, loose matches on Subject: below --
1999-11-04 23:48 Florent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).