Re: A C style compiler.

Francois-Rene Rideau <rideau@ens.fr>
4 May 1998 23:04:55 -0400

          From comp.compilers

Related articles
A C style compiler. Matthew.Webb@net1.demon.co.uk (Matthew Webb) (1998-04-29)
Re: A C style compiler. derekn@aimnet.com (1998-05-04)
Re: A C style compiler. rideau@ens.fr (Francois-Rene Rideau) (1998-05-04)
| List of all articles for this month |

From: Francois-Rene Rideau <rideau@ens.fr>
Newsgroups: comp.compilers
Followup-To: comp.os.misc
Date: 4 May 1998 23:04:55 -0400
Organization: Ecole Normale Superieure, Paris, France
References: 98-04-110
Keywords: practice

Matthew Webb <Matthew.Webb@net1.demon.co.uk> writes:
> I am writting a OS in assembly language but to speed up the main
> development of it I would like to create assembly 'macro'
> assembly/compiler. Basically I would like to go half way from assembly
> to C. I need to create my own format as it is a new OS and does not
> have a platform executable yet. [...]


I'd recommend you read my Linux Assembly-HOWTO
that tries to cover this subject among other things.
See any LDP FTP repository (such as ftp://sunsite.unc.edu/pub/Linux/docs/)
or web page (such as http://sunsite.unc.edu/LDP/) for HOWTOs.


I also have got a page precisely for would-be OS developers like you, at
http://www.tunes.org/~tunes/doc/Review/OSes.html


Our fine moderator remarked:
> [My advice is "don't do that", since it's entirely possible to write
> a small, tight OS predominantly in C, e.g. QNX. -John]


I can but agree with the advice: if your OS internals are going to be
compatible with C semantics, you'd better be coding in C, anyway, and
be using bits of inline assembly just in the right
architecture-dependent include files, as do everyone. See how do free
OSes like Linux, *BSD, VSTa.


I wouldn't cite QNX as an example, since it's commercial software, and
sources are not available for anyone; VSTa looks like an acceptable
free counterpart of it, though.


As for actual code meant to be included in OSes being developped,
check the Flux OS kit might help you a lot (check the page above).


Even if your OS internals are not going to be compatible with C
semantics, you might be better developping a compiler to C for a
language having the semantics you need, and using GCC inline assembly
in the same way in just the needed spots.


Sorry for the noise on comp.compilers (though the Assembly-HOWTO does
have a quote from comp.compilers!). Mind the followup-to: comp.os.misc
(but my next message will try to keep the on-topic part of this
track).


## Faré | VN: Уng-Vû Bân | Join the TUNES project! http://www.tunes.org/ ##
## FR: François-René Rideau | TUNES is a Useful, Not Expedient System ##
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.