blkdev in oftree

Axel Dörfler mol-devel@lists.maconlinux.org
Wed, 22 Oct 2003 18:51:18 +0200 CEST


Samuel Rydh <samuel@ibrium.se> wrote:
> However, after a closer look at the of-mol source code, I noticed 
> that
> the open/read/write methods of the mol-blk node are not connected
> to the underlying infrastructure (I was pretty certain I had
> implemented this, but the code is indeed not there...). The
> pseudo filesystem (which contains files explicitly exported from
> the molrc file) is supported though.
> 
> The of-mol implementation is currently used to boot MacOS 9
> and linux (yaboot). In the former case, special support code
> is used to find and load the boot image (the newworld ROM).
> In the yaboot case, everything of interest resides in the
> pseudo filesystem.

MacOS X doesn't need OpenFirmware to start? It does all the hardware 
recognition by itself after the boot loader was started?

> Adding OF functionality to the mol-blk node should be
> simple enough; the infrastructure (like opening device specs)
> is already present. It is mostly a question about associating
> ihandles with the the corresponding device spec (or file spec
> for that matter). The best solution would probably be to
> use ihandles internally rather than a filesystem/fd pair.
> I intend to address this issue shortly.

I am looking forward to this :-)
Is it possible to let the OF run in real mode (MSR[IR/DR]=0)? I am 
looking for a way to continue to have the OF functional after the OS is 
running.
Normally, the OF should maintain a list of translations needed to run 
it (when it's in virtual mode, at least, although I think it always 
should do it). If it's in real mode, I hope to be able to use the 
memory/available property to find out which range should stay 
untouched. How would I do it with MOL?

> > BTW is it possible to get a prompt at OpenFirmware level?
> No. Only the client side of OF is implemented (no forth
> interpreting).

I think yaboot uses forth code at least in some place (dunno if it's 
needed, though).

> At the moment, the linux mode is currently the "generic boot"
> mode so abusing it is quite OK. There is also a --elf mode
> which can be used, but it might need some tweaking. Anyway,
> I intend to rename the linux mode to 'generic' or 'ofboot' and
> just let the --linux switch invoke the default linux config
> file.

Is the "yaboot" boot loader name hardcoded into MOL? I think I changed 
the OF variables, and it still looked for it, but maybe I've just 
overlooked something else.

> In any case, to boot a complete OS, one normally has to add
> some MOL driver to the OS although I guess one theoretically
> could run it without custom drivers if one configure the
> device tree to include somethings like
> 
> i) The gc/heathrow interrupt controller
> ii) Framebuffer using OF
> iii) The emulated OHCI USB controller for disk access
> iv) Keyboard access through the VIA chip
> 
> Whether the OS can cope with this hardware set is another story
> entirely...

Sure, it's just a very nice shell for debugging the hardware dependend 
part of an OS, so it would be a very convenient tool to develop an OS.
Anyway, thanks for your answers!

Bye,
   Axel.