Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site cornell.UUCP Path: utzoo!watmath!clyde!floyd!vax135!cornell!rej From: rej@cornell.UUCP (Ralph Johnson) Newsgroups: net.micro,net.research,net.cse Subject: Re: 'toy OS', most students would just manage to learn assembler Message-ID: <7350@cornell.UUCP> Date: Sat, 7-Apr-84 07:18:29 EST Article-I.D.: cornell.7350 Posted: Sat Apr 7 07:18:29 1984 Date-Received: Sun, 8-Apr-84 01:27:07 EST References: <2975@fortune.UUCP>, <5707@gatech.UUCP> Organization: Cornell Univ. CS Dept. Lines: 48 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