[OpenBIOS] Re: OpenFirmware and Mac-on-Linux

Samuel Rydh samuel at ibrium.se
Sun Oct 26 14:39:52 CET 2003


On Sat, Oct 25, 2003 at 02:45:19PM +0200, Stefan Reinauer wrote:
> >Yes, I think so. I'm not sure exactly how much work is involved but
> >I will give it a go (it is not necessary to do a full OF implementation
> >right away...).
> >
> I can have a look on integrating the MOL OF functionality into 
> BeginAgain, but for putting BeginAgain into MOL I'd prefer if you could 
> try this first.

Certainly. I don't think putting the MOL OF code directly into
BeginAgain is such a good idea, at least not the current incarnation
of the of-mol code. My thought was to add the BeginAgain kernel
to of-mol and then gradually start to use it for OF client services
and for user interaction.

> >For MOL, the device tree is loaded from a config file (for MacOS, it is
> >essentially a copy of a "real" device tree). Bus probing and
> >similar things are not needed (although one could implement this
> >if one really wants to). Cloning the device tree at OF startup is 
> >sufficient
> >(just like most parts of the device tree is hardcoded in ROM in most 
> >machines).
> >
> Ah.. these device tree files I have seen. It's a really quick way of 
> setting resources up for different kinds of systems. Are the different
> device trees needed for different purposes/machines?

Yes, different device trees are used for different purposes.

The Mac OS 9 device-tree originates from a B&W G3. Since only
certain PCI-bridges and interrupt controllers are suppoerted by
the OS, I have to use those in the device-tree. MacOS 9 also
expects certain legacy hardware to be present (the via-cuda for
instance).

In general, I prefer to use virtual MOL hardware rather then emulated
real-world hardware since this is much more efficient (the MOL OS side
driver just makes "system calls" to MOL rather than accessing hardware
through PCI register).

The Mac OS X device tree has essentially been built from scratch. It
contains more virtual MOL hardware than the Mac OS 9 tree. Since OSX
is a much more open architecture, it is possible to write custom MOL
drivers for things like interrupt controllers so there is no need
to emulate any hardware at all.

> Or is it just a matter of emulating the 
> kind of machine that you have Mol running on? 

No, MOL is completely hardware independent (except that 601 based
CPUs are unsupported).

> Do you have scripts for cloning the device tree in OpenFirmware?

No, not in OpenFirmware. Under linux, a copy of the
device tree is available under /proc/device-tree so it is just a matter
of reformatting things into a format more suitable for MOL.

> The device tree should actually be hardcoded for all onboard devices 
> and only expansion cards like PCI should be dynamically added.

Yes, this is essentially what MOL does. Only a few minor tweaks are
done to the device tree at startup (MOL supports three parallell
virtual network cards, but typically only a single one is used).

> In BeginAgain I've implemented a plugin 
> system that allows to emulate PCI cards in a simple manner. I planned to 
> do the Framebuffer output this way, but since OpenBIOS lacks a PCI 
> driver and a framebuffer driver you get nothing but a black window that 
> you can write to with lowlevel functions..
> 
> If you don't disagree I'd like to move this discussion to 
> openbios at lists.openbios.org in future. 

Sure.

/Samuel



More information about the OpenBIOS mailing list