[net.research] 'toy OS', most students would just manage to learn assembler

arnold@gatech.UUCP (Arnold Robbins) (04/06/84)

There is no excuse to teach an OS course to students who have never had
any exposure to assembly language.  After you have learned assembler for
one real machine, you can learn another machine very easily, since the concepts
are the same (given Von-Nueman machines), just the syntax is different.

To expect a student to both learn assembler and do an OS is unreasonable.
First teach 'em how to program in a high level language, then teach 'em
assmbler, then COBOL and ADA so they'll see how not to do it, then C, so
that they'll appreciate it, and THEN teach 'em how to write an OS.

Some schools also like to teach a "simple" assembler, like MIX, which is even
worse than not teaching anything.  You should teach people about real
machines; e.g. it is not too hard to write a simulator for the PDP-11,
even in Pascal!

Besides, who says an OS has to be written all in assembler anyway? (Lookout!
BIG BLUE is going to get me!!!!)  I can name at least one OS written in
a high level language, which is in use today (MULTICS... :-)

-- 
Arnold Robbins
CSNET: arnold@gatech		ARPA: arnold.gatech@CSNet-relay
UUCP:	...!{akgua,allegra,rlgvax,sb1,ut-sally}!gatech!arnold

"Look Bruce!  It's the Bat Signal!"

rej@cornell.UUCP (Ralph Johnson) (04/07/84)

There is no need to assume that a toy OS should be written in assembler,
nor that average students should not be exepected to read and understand
operating systems or to write their own from scratch.  At Cornell, writing
an operating system is an undergraduate level course.  The students start
by writing the lowest level process switching and interprocess communication
routines, write a process scheduler, and may write some of the higher levels,
timer permitting.  Although students are required to know assembler before
taking the course, all programming is in a high level language.  I haven't
taken of TAd the course, so I don't know too many details.

When I was an undergraduate at a school that did not teach any courses
like this, I read Per Brinch Hansen's "Architecture of a Concurrent Program".
I was so excited, it took, me months to recover.  I read the book from start
to finish a a few days, then kept rereading it to figure out in detail how
everything would work.  I haven't seen his latest book, but if it is like
the AoaCP than it would be very well suited for teaching undergraduates
about operating systems.  Looking back from my now august position ( :-))
I am amused by my response to the book, as it presents an extremely
simplified model of an operating system.  However, that is what you want
in an undergraduate textbook.

I suppose that some people will say that it is unreasonable to expect
students to write a real compiler, i.e., one that can compile programs that
will execute and do interesting things.  The arguments against writing
compilers are the same as those against operating systems, since both need
knowledge of assembly language, are very complicated programs, and so on.
Cornell has a class in which all students write a compiler (in PL/I, Pascal,
C, or whatever you want) for TOY, a "compile-only" language.  TOY is block
structured, allows procedures as data objects, has polymorphic data types,
but has limited I/O and arithmetic capabilities.  In other words, it has
lots of features that are hard to implement and leaves out the many easy to
implement features that are necessary to make a language easy to use.  Thus,
it is "compile-only", a language great for writing a compiler for, but
worthless for use in writing programs.  With a great deal of work, most
students are able to finish their TOY compiler in one semester.

One can argue that it is silly to teach undergratuates to write operating
systems and compilers, since most of them will never write either one.
However, writing concurrent and distributed systems is becoming more and
more common, and an operating system is a standard example.  A person who
is able to write an operating system will have learned all that is needed
to write other concurrent programs.  In the same way, most programs could
use better command languages.  The wide use of yacc in many Unix programs
shows how useful compiler technology can be.

Ralph Johnson  {decvax, ihnp4, harpo}!cornell!rej      rej@cornell