using forth for an OS 
Author Message
 using forth for an OS

This is intended as a reality check...
I will admit I am new to Forth, but have experience with Scheme and
other threaded int. languages, so I am picking it up quickly...

I want to write an OS on my PC in Forth.  I asked a question on the
comp.os.research group and got a rather snotty answer from the moderator
(a prof at ucsc I think).  He maintained that Forth was not an acceptable
language for an OS.  I see no reason why ANY language could not be used
at least for the higher level portions of it (OK, you probably couldnt
write int. routines in LOGO, but..).  I wrote him back about this and
his reply was:  Forth is essentialy an interperated language, and it is
good for embedded controll, but not for operating systems, and it has
problems with 32 bits.

Is this guy full of it?  Are there not OS's written in Forth?  I
KNOW there are some written in interperated languages.  The
OS is not for comercial use, just something I wish to do to learn
about the subject.  What's wrong with using Forth?

His sign-off was:    Good luck. I doubt you'll succede.

(I may just do it out of spite)



Wed, 19 Feb 1997 00:10:59 GMT  
 using forth for an OS

Quote:


>Subject: using forth for an OS
>Date: Fri, 2 Sep 1994 16:10:59 GMT
>This is intended as a reality check...
>I will admit I am new to Forth, but have experience with Scheme and
>other threaded int. languages, so I am picking it up quickly...
>I want to write an OS on my PC in Forth.  I asked a question on the
>comp.os.research group and got a rather snotty answer from the moderator
>(a prof at ucsc I think).  He maintained that Forth was not an acceptable
>language for an OS.  I see no reason why ANY language could not be used
>at least for the higher level portions of it (OK, you probably couldnt
>write int. routines in LOGO, but..).  I wrote him back about this and
>his reply was:  Forth is essentialy an interperated language, and it is
>good for embedded controll, but not for operating systems, and it has
>problems with 32 bits.
>Is this guy full of it?  Are there not OS's written in Forth?  I
>KNOW there are some written in interperated languages.  The
>OS is not for comercial use, just something I wish to do to learn
>about the subject.  What's wrong with using Forth?
>His sign-off was:    Good luck. I doubt you'll succede.
>(I may just do it out of spite)


What can I do to help?   ;-)




"When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl."  Wired 2.04



Tue, 18 Feb 1997 22:19:40 GMT  
 using forth for an OS
|> I wrote him back about this and
|> his reply was:  Forth is essentialy an interperated language, and it is
|> good for embedded controll, but not for operating systems, and it has
|> problems with 32 bits.

First of all, this is outdated: There are many native code
implementations around, and Forth has no problems with 32 bits. Why,
the only Forths I use are 32-bit Forths.

Secondly, I do not see what these items have to do with writing
operating systems (well, of course, being not good for operating
systems, has something to do with it, but I would expect some support
for such a statement). I do not see why a native code implementation
should be better for an OS (apart from speed) or why there should be
no OSs for 16-bit machines.

|> Is this guy full of it?  Are there not OS's written in Forth?

That depends on what you consider an OS. In many applications the
Forth system *is* the OS. It manages the I/O and it performs
multitasking. OK, some more modern concepts and some older ones like
memory protection may not be implemented in these systems, but I see
no reason why you could not build a new system that does these things.

|> (I may just do it out of spite)

Good luck, and have fun.

- anton
--
M. Anton Ertl                    Some things have to be seen to be believed



Wed, 19 Feb 1997 01:51:01 GMT  
 using forth for an OS

Quote:

>This is intended as a reality check...
>his reply was:  Forth is essentialy an interperated language, and it is
>good for embedded controll, but not for operating systems, and it has
>problems with 32 bits.

No problems with 32-bits ... there are lots of 32-bit Forths.

Forth is usually implemented as an interactive environment, but
the code is not "interpreted" in the same sense as Basic code
is "interpreted."  In addition, there is no reason why Forth
*has* to be implemented as an interactive, interpretive environment;
native code compilers for Forth do exist.

As for operating systems, if you mean an OS in the sense of UNIX
which must support a heterogeneous mixture of tools and applications
with diverse origins and philosophies, then it wouldn't be my first
choice either. However, Forth has been very successful in turnkey
situations where the device drivers, operating system, and
application(s) are all written in Forth.

Ray Duncan, LMI



Wed, 19 Feb 1997 12:28:14 GMT  
 using forth for an OS

Quote:

>Subject: using forth for an OS
>Date: Fri, 2 Sep 1994 16:10:59 GMT

>This is intended as a reality check...
>I will admit I am new to Forth, but have experience with Scheme and
>other threaded int. languages, so I am picking it up quickly...

>I want to write an OS on my PC in Forth.  I asked a question on the
>comp.os.research group and got a rather snotty answer from the moderator
>(a prof at ucsc I think).  He maintained that Forth was not an acceptable
>language for an OS.  I see no reason why ANY language could not be used
>at least for the higher level portions of it (OK, you probably couldnt
>write int. routines in LOGO, but..).  I wrote him back about this and
>his reply was:  Forth is essentialy an interperated language, and it is
>good for embedded controll, but not for operating systems, and it has
>problems with 32 bits.

Wow, no wonder you need a reality check, what crap!  In a typical human
reflex he is rationalizing away his ignorance, and his inacurate
statements demonstrate this.  Many Forth compilers compile to
native machine code and thus have no inner interpreter.  Even
Forth systems with some style of threaded interpretation may
introduce less overhead that the constructs introduced by other
languages.  One of the reasons that Forth IS good for embedded
control is that is easy for Forth to provide the OS as part
of the Forth.  Many Forth systems are the OS in both embedded
applications and development systems.  There were many 32 bit
Forth systems a decade ago, and 32 bits is common today.  Maybe
this guy retired from the real world so long ago that he is ignorant  
and is only minimally prepared to rationalize away things that
don't fit his closed world view.

Quote:
>Is this guy full of it?  Are there not OS's written in Forth?  I
>KNOW there are some written in interperated languages.  The
>OS is not for comercial use, just something I wish to do to learn
>about the subject.  What's wrong with using Forth?

One of the problems is dealing with people like the one you
describe above.

Quote:
>His sign-off was:    Good luck. I doubt you'll succede.

>(I may just do it out of spite)


There are vendors here in this newsgroup who provide professional
quality embedded applications and development environments where
Forth provides the OS.  If you are new to Forth it will be difficult
for you to write professional quality stuff.  There is nothing
preventing you from writing an OS in Forth, except this guy's
ignorant opinion.

Jeff (if its not written in C or C++ it isn't an OS) Fox  
Ultra Technology



Wed, 19 Feb 1997 15:16:20 GMT  
 using forth for an OS
There's no question that a block-based Forth is its own
operating system, including editing facilities. One can either
build on that, using the blocks and write a file manager for
the blocks, or one can duplicate an operating system. Of course
you must define what you want in your operating system. It
would be quite a project to include everything in, say MSDOS,
but how long did it take to develop that system?

You might want to look at our book, "Forth, a Text and
Reference", now out of print but available from Miller
Microcomputer Systems in Natick, MA. We gave several examples,
including designing an editor and a file manager in Forth.

If you call them, you might want to speak with{*filter*} Miller. He
designed a Forth for the old Trash-80 to replace its own dos,
and he upgraded it to work with the IBM when it came out using
CP/M before MSDOS was available.

Not only can you write an OS using Forth, it has been done many
times. The OSs may have been relatively special purpose, and
primitive by UNIX standards, but they were operating systems
nevertheless.

Further as to including machine code, most modern Forths let
you include assembler instructions in word definitions so that
they compile to machine code, optimized for your purpose. Even
without that, Forth is very unlike a normal interpreted
language, since the word definitions, once loaded simply
contain instructions to jump from one set of machine codes to
another. Forth is therefore extremely fast relative to most
other languages, including most compiled languages. Your
instructor's comment that it an interpreted language is
strictly correct, since it is called a threaded interpreted
language, but it is most certainly not an interpreted language
in the sense of BASIC, since it does compile to set of jumping
instructions telling where to go in the machine code kernel for
the language.

Good luck. I suspect that you will find quite a few here who
will be willing to help you with your project, if for no other
reason than to prove a would be computer science expert how
wrong he is.

Mahlon Kelly.



Wed, 19 Feb 1997 22:50:16 GMT  
 using forth for an OS
If you're using an interpreted forth you'll have to write some of
the words in assembly in order to get at special registers,
instructions, and things like interrupt. (Every OS has some
assembly for this.)

You may need assembly for some time critical issues. Or C. I
suspect there may be a layer where assembly is too complicated
but speed too critical to use an interpreter.

You have to be careful to protect OS stacks from the user. Also
unless you're going to force the user to run Forth, you need to
construct the process switch carefully.

The biggest issue is speed versus programmability. Every cycle the
operating system uses the user is denied. The same for every byte.
But if the OS is broken, every cycle and byte are useless anyway.

(I think it's insufferably smug to declare an OS can't be done
in language XYZ. When I was in school, every OS and major applications
was written in assembly, because high level languages were too
'inefficient.' Doesn't mean you'll be successful, but I wish you
luck.)

(If you've never done systems programming, read up on it, and take
your time. These programmers get $$$ for a reason.)
--

alyfan landes to fela lathere theode.   |             Cupertino, California
                  ... ond lof-gearnost. | (xxx)xxx-xxxx               95013



Thu, 20 Feb 1997 04:06:21 GMT  
 using forth for an OS


writes:

Quote:
>...I asked a question on the
>comp.os.research group and got a rather snotty answer from the moderator
>(a prof at ucsc I think).  He maintained that Forth was not an acceptable
>language for an OS...

Tell your prof to switch on his Sun sparcstation. While it's booting type
[STOP] + "A". At the ">" prompt type "N" [CR]. Then type "WORDS" Oh, look!
Forth!




Fri, 21 Feb 1997 04:06:32 GMT  
 using forth for an OS

Quote:
>There's no question that a block-based Forth is its own
>operating system, including editing facilities. One can either
>instructor's comment that it an interpreted language is
>strictly correct, since it is called a threaded interpreted
>language, but it is most certainly not an interpreted language
>in the sense of BASIC, since it does compile to set of jumping
>instructions telling where to go in the machine code kernel for
>the language.

Just to clarify things, the person who told me it couldn't be done
is NOT my instructor, not is he an instructor at UCLA.  He is
the moderator of the comp.os.higher.edu.snobs.research Usenet group...>
-andy


Fri, 21 Feb 1997 11:04:08 GMT  
 using forth for an OS
Some years ago MPE wrote an operating system in Forth for a client. It had
a Unix style file system, multitasking and the usual features. The reason
we were commissioned to do this was to avoid the run-time costs for
an embedded OS. People *hate* paying run-time licenses! Nowadays, the cost
of a commercial OS is much lower than it used to be.
--

MicroProcessor Engineering Ltd. - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 703 631441, fax: +44 703 339691


Fri, 21 Feb 1997 16:46:17 GMT  
 using forth for an OS

Quote:

>Is this guy full of it?  

   Yes definately. But perhaps massively uninformed would be a
better term.

Quote:
>Are there not OS's written in Forth?  

   One of the first things I learned about Forth was that it was
its own operating system. Early versions were called "stand alone"
and they ran on mini-computers that only had a boot ROM, a disk
drive and a tiny bit of RAM. The selling point of Forth was that
it let you use a new mini-computer for useful work a year or two
before the conventional disk operating was written and debugged.
   Most of the versions of Forth published for the IBM-PC are
"captive" since for the past 10 years when you used a PC you really
wanted to use MS-DOS. Perhaps someone will send you a copy of a
PD stand alone Forth for the IBM-PC (fig Forth?), but I don't have
one in my collection. There are commercial versions of stand alone
Forth available, and their vendors will probably reply to your
message.

Quote:
>  What's wrong with using Forth [as an operating system]?

   You have to make all the decisions about what an operating
system is and write the code. You will have to write your own
editor. You will have to decide what track the disk directory
is on. There are thousands of little things like that for you
to do. If it is your goal to write these things yourself, then
Forth is the best way to do it. If you want to use some of the
usual things that you find in other operating systems, then
you'll get started much faster by using a captive Forth.

Quote:

>His sign-off was:    Good luck. I doubt you'll succede.

>(I may just do it out of spite)

    Don't do it out of spite, do it as a homework problem in
computer science. The first lession is Forth is whatever you
want it to be. It could be an intepreter or a compilier, but
it is usually a little bit of both and not really either. It
can operate easily on 16 bits, 32 bits or 64 bits at your
choice. An 8 bit Forth would be hard to do since you'd only
have 256 addresses. Two of them could be stacks of unlimited
depth, tho.
    Right after I found out that Forth was its own operating
system, I decided that Forth was a combination assembler and
de{*filter*} for a processor that didn't exist. The first task
of a Forth developer is to write an assembler for a real
processor. Fortunately this has already been done for you.
Now when I hear a statement that Forth can't do something,
I ask "can it be done in assembler?". Since the answer to
that is always yes, but it would take too long, I know the
job can be done with Forth. It is much faster to write a
program in Forth even when some of it needs to be done in
assembler.

--



Wed, 19 Feb 1997 21:16:36 GMT  
 using forth for an OS
Someone asked for operating systems written in Forth. I know of one --- Forth!
You can write a Forth in Forth, using a meta-compiler. I would like to say that
Forth in itself can be seen on as an operating system.

In fact, I've been spending my summer writing a pretty small portable
multi-tasking Forth that will, evenutally, do just that. My first task is to
finish a fairly portable Forth shell environment to replace bash under Unix and
*yuck* DCL under VMS. From there, I will create a meta-compiler and start
coding on a native Forth system. It will probably be crafted to run one of my
ancient Sun 3/60s, but porting it shouldn't be that much of a hazzle, given
certain knowledge in assembler --- the assembler in the meta-compiler will
probably be interchangable, in some way.

If anyone want more information about my small system, I can answer questsions



Sun, 23 Feb 1997 16:08:48 GMT  
 using forth for an OS
:     Let he who is without sin cast the first stone. Forth programmers
: do not contribute to code for large scale operating systems. In fact
: most of them ignore such things if they even know what they are. This
: is a good thing, but it doesn't keep computer scientists well informed.
: Actually it is fanatical Forth-a-holics (such as myself) who retired
: from the real world. Operating systems use terms such as B+trees and
: Berkely fast file systems. Someday I'll find out what a B+tree is and
: why a Berkely file system is faster than MS-DOS. Then I'll be able to
: decide if they work better than Forth blocks and screens. Probably
: not.

But there is no reason to think that those things are not intelligent?
Do you suffer from prejudices?

:     So how do we inform computer scientists that their elaborate
: schemes are useless and should be abandonded? What articles have
: been publised in computer science journals showing how the latest
: spiffy algorithm can be coded more efficiently in Forth than in
: C++ ? How can we tear these guys away from their intercontential
: wide area networks with distributed multi-processors and show them
: how they can read e-mail with 16k bytes of RAM using Forth code?

To my opinion, it does not make too much sense to use only the internal
CPU cache.
Perhaps we should show them, how they can use theire multi-processors
more efficiently or how they can exploit the limited capacities of then
WAN better?

I think, Forthers too often ignore the thoughts and the work done by
the rest of the world, saying: 'In principle, we could do it better'.
We should think about the possibilities to integrate and use the whole
stuff and knowledge in our Forth environment and than produce better  
applications. Perhaps, a B+-tree is useful for something?

- Joerg



Mon, 24 Feb 1997 00:00:38 GMT  
 using forth for an OS
Quote:


>>This is intended as a reality check...
    [ snip ]
>>I want to write an OS on my PC in Forth.  I asked a question on the
>>comp.os.research group and got a rather snotty answer from the moderator
>>(a prof at ucsc I think).  He maintained that Forth was not an acceptable
>>language for an OS.  [ snip ]          I wrote him back about this and
>>his reply was:  Forth is essentialy an interperated language, and it is
>>good for embedded controll, but not for operating systems, and it has
>>problems with 32 bits.

>Wow, no wonder you need a reality check, what crap!  In a typical human
>reflex he is rationalizing away his ignorance, and his inacurate
>statements demonstrate this.  [ snip ]   There were many 32 bit
>Forth systems a decade ago, and 32 bits is common today.  Maybe
>this guy retired from the real world so long ago that he is ignorant  
>and is only minimally prepared to rationalize away things that
>don't fit his closed world view.

    Let he who is without sin cast the first stone. Forth programmers
do not contribute to code for large scale operating systems. In fact
most of them ignore such things if they even know what they are. This
is a good thing, but it doesn't keep computer scientists well informed.
Actually it is fanatical Forth-a-holics (such as myself) who retired
from the real world. Operating systems use terms such as B+trees and
Berkely fast file systems. Someday I'll find out what a B+tree is and
why a Berkely file system is faster than MS-DOS. Then I'll be able to
decide if they work better than Forth blocks and screens. Probably
not.
    So how do we inform computer scientists that their elaborate
schemes are useless and should be abandonded? What articles have
been publised in computer science journals showing how the latest
spiffy algorithm can be coded more efficiently in Forth than in
C++ ? How can we tear these guys away from their intercontential
wide area networks with distributed multi-processors and show them
how they can read e-mail with 16k bytes of RAM using Forth code?

--



Sun, 23 Feb 1997 21:58:58 GMT  
 using forth for an OS

Quote:
Coughlin) writes:
>    So how do we inform computer scientists that their elaborate
>schemes are useless and should be abandonded? What articles have
>been publised in computer science journals showing how the latest
>spiffy algorithm can be coded more efficiently in Forth than in
>C++ ? How can we tear these guys away from their intercontential
>wide area networks with distributed multi-processors and show them
>how they can read e-mail with 16k bytes of RAM using Forth code?

Great questions!  The responsibility rests on every one of us who has done
something we're proud of to find a forum & publicize it!  These countless
papers and articles on C, C++ etc. were mostly written by plain folks like
us, some of whom were also blessed by having corporate PR folks to edit
"engineerese" into English.  But magazines also have editors capable of
doing this, and willing if the material looks provocative and credible.  I
have offered before, and herewith do so again, to help anyone with a good
story to tell to find a good forum to tell it in.  I have had a fair
number of articles published, and know a lot of the mags and editors.
Let's let them hear from us!!


Mon, 24 Feb 1997 01:51:02 GMT  
 
 [ 15 post ] 

 Relevant Pages 

1. FORTH/OS OS/4th

2. Q:Using REXX under OS/2 how can you change an OS/2 window size

3. Using os.system and os.popen from pythonwin under Windows NT

4. os._exit(), os.kill(os.getpid(), 9)

5. Another thought about Forth OS

6. A Forth for Palm OS

7. Forth as OS

8. Newbie Forth OS question

9. A IBM-PC Compatible Forth OS

10. MANIFESTO: A Forth/OS should be based on an ExoKernel architecture

11. IBM OS/360 Mainframe Forth

12. Where to get a BE-OS forth?

 

 
Powered by phpBB® Forum Software