tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Scripting DDB in Forth?
On Mon, 2 May 2016, Valery Ushakov wrote:
> On Mon, May 02, 2016 at 00:59:06 -0400, Michael wrote:
>
> > On Mon, 2 May 2016 04:59:32 +0300
> > Valery Ushakov <uwe%stderr.spb.ru@localhost> wrote:
> > > I thought it might be interesting to put it into the kernel so that
> > > it can be hooked into DDB.
> >
> > I'm afraid my first thought was OF_interpret() on machines that have
> > OF-like device trees but no OF.
>
> I'm not sure I understand. OF_interpret() by itself is not that
> useful unless you have the real OF device tree you can talk to. But
> if you don't care about the abstraction / OOP layer of OF and just
> need ability to execute some code dynamically, then I don't see why
> not.
You can use OF_interpret() to access the underlying Forth engine for for
firmware that has it. However nowadays IEEE-1275 device trees are use by
firmware written in C without Forth engines. Of course the problem with
that is once the OS boots the ability of the firmware to allocate memory
is severely limited.
> Or we can port real OF perhaps? OpenBIOS is GPLv2, but since it will
> not be part of the kernel, that's not an issue. Also, Sun did release
> OpenBOOT under BSD'ish license, if you want to be a purist about the
> licensing and don't mind doing extra work.
OpenBOOT is very SPARC-centric. There's lots of SPARC assembly code
throughout.
Firmworks put together Open Firmware, which is an IEEE-1275 implemenation
released under a BSD license, but last time I looked it seemed mostly
focused on ARM CPUs.
As far as that goes, about 10 years ago I threw together an IEEE-1275
implementation based on the pForth engine. Since the kernel is written in
C, it's more easily portable. I probably have the code lying around
somewhere.
Eduardo
Home |
Main Index |
Thread Index |
Old Index