tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Scripting DDB in Forth?



Hello,

On Mon, 2 May 2016 15:00:15 +0300
Valery Ushakov <uwe%stderr.spb.ru@localhost> wrote:

> > > I've accidentally wrote a Forth for sh3 (long story).
> > 
> > What kind of accident makes you write something relatively non-trivial
> > without meaning to?
> 
> I guess the perceived "otherness" of Forth prevents people realizing
> how straightforward, if not trivial, a naive Forth really is (I'm not
> talking about smart inlining compilers and the like here).

Oh, I didn't mean it that way - I remember an entire Forth development
system fitting into an 8kB ROM. I was just wondering how even that
could happen by accident ;)

> > > 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.

FDTs are very much like OF device trees, and the API we're using is
very much like the one we use for real OF trees. OF_interpret() would
just complete it. Then again, you're right in that the only real uses
of OF_interpret() that I'm aware of are workarounds for OF bugs and
weirdnesses.
( *cough* Apple OF 1.0.5 *cough* )

> 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.

It would certainly be useful in ddb, and if that part could let you
access the device tree ( if there is one ) as well that would be nice
too.

> 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.

Didn't IBM release theirs a few years ago as well?

have fun
Michael


Home | Main Index | Thread Index | Old Index