views:

268

answers:

6

I know that C is the standard programming language for operating system development, but out of curiosity I was wondering what preceded it. What was the main programming language used for operating system development before C?

+2  A: 

That depends. The Amiga OS for example was originally written to a certain extent in BCPL, and you would imagine that many ancient operating systems were written in pure assembly language.

CP/M (which is kind of MS-DOS' predecessor) was written in PL/M, but MS-DOS was written in assembly for performance reasons. Here is something on MS-DOS: http://www.patersontech.com/Dos/Byte/InsideDos.htm

(Edited, not sure where I picked up this Fortran garbage.)

EboMike
This the first time I've heard anybody suggest that CP/M was written in Fortran. Substantial parts were clearly written in assembly language (i.e., I'm *sure* no compiler ever generated that code). It's generally believed that CP/M was written in PL/M (which I believe is probably correct, though I can't point to source code to prove it).
Jerry Coffin
I believe many popular computers had operating systems that were developed in assembly. C64 and Apple II, for example. The operating systems and software were simple enough in those days that completely writing most software in assembly was considered the norm. Especially when the OS only had to implement drivers for the single hardware spec that the machines came in.
Merlyn Morgan-Graham
-1, FORTRAN lacks meaningful pointer arithmetic which makes it useless for system programming as far as I know
aaa
@Jerry Yep. CP/M was originally programmed in PL/M to run on 8080 micros http://en.wikipedia.org/wiki/PL/M
belisarius
@belisarius: While I think it probably was, an article on Wikipedia hardly strikes me as proof.
Jerry Coffin
Is this a wind-up? And why are people up-voting it? This place is becoming a cesspit of misinformation. CP/M wasn't and couldn't have been written in Fortran and 30seconds on google would prove that this assertion is absolute rubbish. The Amiga OS came out years after C gained widespread popularity.
Dipstick
@chris Post is being voted down (it was voted up first), which at least shows that community is able to filter incorrect answers.
aaa
@aaa - yes, but now one about forth is being voted up.
Dipstick
@EboMike - Think I spotted the source of the confusion. Turns out that PL/M was itself written in fortran - so only one step removed.http://www.cpm.z80.de/source.html
Dipstick
Thanks Chris, that makes sense! I saw the Fortran info when I dug into the origins of MS-DOS for this post and didn't really double-check the info. I sure got the rabid SO crowd on my case :) I was an Amiga and ZX Spectrum person myself back in the days and didn't care much about the DOS world. Well, lesson learned.
EboMike
+8  A: 

There were a lot of systems before C was used for Unix (1969...). Here's a sparse timeline. Click on each system for details. Most early systems would be implemented in assembler. A notable exception (not listed in the timeline) was the ahead-of-its-time 1961 B5000 with an O/S written in ALGOL.

joe snyder
+1 for mentioning the B5000. My first real programming job was for crime and criminal information system targeted at the B5900.
JeremyP
+3  A: 

There were many 16-bit Forth systems where the interpreter and (fairly primitive) OS layer were written in Forth.

The original Mac OS was written in a mix of 68k ASM and a slightly extended Pascal.

ADA has been used to write several OS's.

But I'd guess that the dominant language used for OS development prior to C was IBM 360 assembly language.

hotpaw2
If anyone wants to peep how it was to develop a mainframe OS in assembler, this is the book: http://www.amazon.com/OPERATING-SYSTEMS-STUART-DONOVAN-MADNICK/dp/B000OFTIBI - Read it only for historical curiosity :D
belisarius
The original Mac OS was written entirely in assembler. That machine was extremely memory-bound. (It was a very nice assembler, though. And Pascal was available for applications from the beginning, and used for prototyping.)
Potatoswatter
Also, Apple used Forth until the Intel switch. Open Firmware is a superior system to EFI…
Potatoswatter
@hotpaw2: Please name one significant OS that was written in forth before c became widespread. The only time forth moved out of its niche environment was when the 8-bit 6502 was in common use in home PCs (Apple, BBC micro, Commodore etc) as the 6502 struggled to support compiled languages due to its 256 byte stack limit (and some other architectural limitations). The Jupiter ace actually had forth built in as its main user environment because it had insufficient memory for Basic, but the forth used must have been written in assembler not forth.
Dipstick
@chris: He said primitive systems, not popular general-purpose home operating systems. But thanks for naming one of the latter. As for "must have been written in assembler not forth"… it's called bootstrapping, and Forth works cross-platform quite well as it doesn't distinguish between compiling a function and generating data.
Potatoswatter
+1  A: 

Operating systems "want" to be written in assembler. If you're starting from scratch, once you have the interrupt routines done, you can just keep on going and not get around to a high-level language interface.

Furthermore, assemblers like to evolve. Once you've covered the specified instruction set, it's convenient to add alias names for instructions that serve multiple purposes. Next come pseudo-instructions that can alias a couple machine instructions. Then it's nice to have an extensible facility for writing macro subroutines, to generate arbitrary sections of code that look like instructions. (Unlike C macros, this often may allow flow control and script-like programming.) Then, there are scoping rules to ensure identifiers are only used in a particular context.

Bit by bit, languages evolve. C didn't pop out of thin air. It was preceded by a generation or two of languages (Algol, BCPL) that evolved from high-level assemblers. Many platform-specific assembly languages were in fact reasonably nice. IBM still makes a mean assembler. (Of course, before that were not-so-nice assemblers, and before that were punch cards and toggle switches.)

More recently, GNU as has given assembly a bit of a bad name by being relatively primitive. Don't believe the scare tactics, though.

Potatoswatter
I think you are describing compiler bootstrapping and development. This does not necessarily need to mean that operating systems development would need a similar "bootstrapping". Often new operating system development starts with cross-compiler running on an existing platform. Also in many cases this is the final for developing operating systems, as it makes no sense to create a native compiler for the said OS.
Schedler
@Schedler: I'm trying to convey that operating systems aren't necessarily written in the latest language, and that assembler can even be expedient. Bootstrapping is bringing a machine to state-of-the-art functionality as fast as possible. What I'm talking about is the original evolution.
Potatoswatter
Having used several fabulous macro assemblers back in the day (including one family that used to be a product of my company back when having a product that ran on a PDP-11 under RT-11 meant something to some folks), GNU `as` feels hardly better than just coding directly in Motorola S-Records for the UV EPROM programmer. (Sorry, the old codger streak is showing again.)
RBerteig
Yes, well the GNU assembler was really intended more as a back end for the C compiler than a serious assembler for humans.
JeremyP
+2  A: 

Burroughs was one of the first to use something other than assembler for OS development. They chose a dialect of Algol.

In 1965 Multics(Project MAC, funded by ARPA) design began and PL/I was chosen to develop the OS. In 1969 Multics was opened for use at MIT, but there were frustrations and Bell Labs withdrew from Project MAC. Ken Thompson, Dennis Ritchie, Doug McIlroy, and J. F. Ossanna continued to seek the holy grail and Unics (later Unix) development began.

Multics History

Multics Failure?

Unix v. Multics

dbasnett
Good and concise review, pointing to pre-PC era
belisarius
A: 

During the 1970's "Cold War" there was an effort to use the data security and parallel processing features of ALGOL 68 to create Secure/Capability based operating systems:

Cambridge CAP computer - All procedures constituting the operating system were written in ALGOL 68C, although a number of other closely associated protected procedures - such as a paginator - are written in BCPL. c.f. microsoft

Flex machine - The hardware was custom and microprogrammable, with an operating system, (modular) compiler, editor, garbage collector and filing system all written in Algol 68RS. A Linux port of this Algol68RS can be downloaded from compile can be downloaded from Sourceforge:algol68toc.

/* Interestingly portions of DRA's algebraically specified abstract machine Ten15 is still available, also from Sourceforge:TenDRA (for minux) or http://www.ten15.org/. Ten15 serves as DRA's intermediate language for compilers, and evolved to support C and Ada. Apparently an attempt was made to port FreeBSD/Unix using the TenDRA C compiler */

ICL VME - S3 programming language was the implementation language of the operating system VME. S3 was based on ALGOL 68 but with data types and operators aligned to those offered by the ICL 2900 Series. This OS is still in use as a Linux VM, and has some 100,000 users.

The Soviet Era computers Эльбрус-1 (Elbrus-1) and Эльбрус-2 were created using high-level language uЭль-76 (AL-76), rather than the traditional assembly. uЭль-76 resembles Algol-68, The main difference is the dynamic binding types in uЭль-76 supported at the hardware level. uЭль-76 is used for application, job control, system programming c.f. e2k-spec.

Maybe the US military was doing something similar somewhere. Anyone?

NevilleDNZ