Re: A C style compiler.

Francois-Rene Rideau <>
4 May 1998 23:04:55 -0400

          From comp.compilers

Related articles
A C style compiler. (Matthew Webb) (1998-04-29)
Re: A C style compiler. (1998-05-04)
Re: A C style compiler. (Francois-Rene Rideau) (1998-05-04)
| List of all articles for this month |

From: Francois-Rene Rideau <>
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 <> 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
or web page (such as for HOWTOs.

I also have got a page precisely for would-be OS developers like you, at

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

## Faré | VN: Уng-Vû Bân | Join the TUNES project! ##
## 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.