Unix and C

Doug McDonald mcdonald at aries.scs.uiuc.edu
Fri Nov 9 02:24:13 AEST 1990


In article <1990Nov8.100816.6004 at ericsson.se> epames at eos.ericsson.se writes:
>>
>Of course the whole of Unix cannot be written in C but only a small
>percentage need be written in assembler. 

It is true that an OS cannot be written entirely 100% in conformant 
ANSI C in general. However, for some processors it probably CAN
be written in an UNHOSTED ANSI C with the only "extension" being that
you can be sure that you know exactly what constructs like

*((volatile unsigned char *)12345) = 6789; 

will in fact do (down to the coding level, such as how the mov instruction
would be used. Perhaps a couple of pragmas would help.

Some PDP-11 processors are probably in this class. I can think of only one
obvious problem - many have a Processor Status register that requires
special instructions to access.

Processors that have special IO instructions of course exist - there
indeed C alone cannot an operating system create.


Doug McDonald



More information about the Comp.lang.c mailing list