comp.lang.ada
 help / color / mirror / Atom feed
From: pmartin@alsys.com (Pascal Martin @lone)
Subject: Re: Why couldn't an operating system be written in ada
Date: 1996/07/30
Date: 1996-07-30T00:00:00+00:00	[thread overview]
Message-ID: <DvD8M3.8su@thomsoft.com> (raw)
In-Reply-To: 31F37B86.41C67EA6@escmail.orl.mmc.com



Let be a little technical here, and come back to the original point.

Alsys, then Thomson Software Products, have almost always implemented the
Ada runtime for bare targets in (a subset of) Ada. This is what I know as
the closest approximation of an OS.

The Ada standard assumes the following ressources as granted: tasking, heap,
exceptions, io (too name a few).

One of the purpose of the OS is to provide tasking, so breaking the "egg and
chicken" problem imply prohibiting use of the tasking within the OS kernel
code. Not a big problem by itself, but a new set of tasking primitives will
have to be defined for kernel internal use. A good point could be using
a (very) simplified implementation of protected records.

The Ada heap is a nice but complicated piece of code. It could be reused for
an OS, except that it does not comply with MMU or DMA requirements. A lower
memory management level is to be implemented (and the Ada heap should be
rebuilt on top of it). The Ada heap is also protected against concurrency.
This is nice to have, but depends on the Ada tasking internals. Some
adaptations would be required.

One problem is the Ada type system. An OS constantly switch from one level
of abstraction to another: for example, it reads a disk block, and then
understands it as a directory content. With its strong type system, Ada is
not comfortable at that (any comment ??). With its weak type system, C let
the user do all the mistakes he never wanted to do. An usual solution is
to make extensive use of System.Address: programming in Ada with a C style.
Not only it is as unsafe as C, but Ada make things a little more ugly than C.
The best work-around I have ever found is using array-of-bytes buffers and
then use the address clause to map a more typed view. Looks too much like C.
Beware of aliasing and alignment problems !

What we need in an OS would be a language with some controled 'type morphing'
features. Modula 2 included some basic morphing (with its predefined 'generic'
types: BYTE, WORD, ..). A good academic subject ?

Exceptions are good for many things. I would promote use of exceptions in
an OS. But the Ada 95 exceptions raise multiple concerns when STORAGE_ERROR
is raised, because the exception occurence stuff may require use of dynamic
structures. This is a huge problem in an OS which must survive to memory
ressources limitations. So I would recommend using only a subset of the
exceptions features.

If you look back at these restrictions, you will find out that most of them
imply using a specific, reduced, implementation of the runtime. But each
compiler comes with its own (specific) runtime, and runtime interfaces.
Any solution will be compiler-specific and involve building your own 'Ada'
environment (runtime) first. This is not really Ada anymore. This environment
will be the lower layer of the OS kernel. The rest of the OS (drivers, file
systems, network, ..) could be built on top of it.

In France the SOL project intended to build a Unix clone in Pascal (ISO
version). The founding came from the French ministry of defense, because
of export restriction on US products. Eventually, SOL came to life, but
they was forced to define their own variant of Pascal (and managed to get
it adopted as an AFNOR standard--the French equivalent of ANSI), so they
could still claim using a 'standard' Pascal. SOL was not really better
than Unix version 7, and could not keep on competing with BSD. This is
a dead thing now. A lesson to learn ?

The final lesson is Ada has never been designed for such a purpose, obviously.
This has probably never been part of the DOD requirements, anyway.

Pascal Martin.





  parent reply	other threads:[~1996-07-30  0:00 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-15  0:00 Why couldn't an operating system be written in ada Robert C. Leif, Ph.D.
1996-07-17  0:00 ` Mark McKinney
1996-07-20  0:00   ` Michael Feldman
1996-07-22  0:00     ` Theodore E. Dennison
1996-07-22  0:00       ` Larry Kilgallen
1996-07-30  0:00       ` Pascal Martin @lone [this message]
1996-08-01  0:00         ` Bob Kitzberger
1996-08-03  0:00           ` Pascal Martin @lone
1996-07-17  0:00 ` wfranck
1996-07-22  0:00   ` Felicia R. Rosemond (214)-462-5371 ple1 SE
1996-07-29  0:00     ` Wallace E. Owen
1996-07-17  0:00 ` wfranck
  -- strict thread matches above, loose matches on Subject: below --
1996-07-19  0:00 Marin David Condic, 407.796.8997, M/S 731-93
1996-07-15  0:00 Simon Johnston
1996-07-13  0:00 Mark McKinney
1996-07-15  0:00 ` Nasser Abbasi
1996-07-15  0:00   ` Robert Dewar
1996-07-17  0:00     ` Randy Greene
1996-07-17  0:00   ` Hannes Haug
1996-07-15  0:00 ` Jon S Anthony
1996-07-15  0:00   ` Brian Rogoff
1996-07-15  0:00   ` Mark Eichin
1996-07-16  0:00   ` Jon S Anthony
2019-03-02 16:07   ` Optikos
2019-03-03 22:14     ` russ lyttle
1996-07-15  0:00 ` David Wheeler
1996-07-15  0:00   ` Michael Levasseur
1996-07-25  0:00     ` Greg Harvey
1996-07-26  0:00       ` Kent Mitchell
1996-07-16  0:00   ` Poutanen Olavi
2019-01-10 23:38 ` cenci.br
2019-01-10 23:54   ` Lucretia
2019-04-07  1:55   ` Nick Roberts
2019-04-07  4:32     ` Optikos
2019-04-07 10:35       ` Nick Roberts
2019-04-07 14:06         ` Optikos
2019-01-14 11:26 ` George Shapovalov
2019-02-25  2:25   ` russ lyttle
2019-03-09 18:43     ` Norman Worth
2019-02-25 21:56 ` Rabican
2019-02-26  8:46   ` Niklas Holsti
2019-02-26  9:30     ` Dmitry A. Kazakov
2019-02-26 23:32       ` lyttlec
2019-02-27  2:00         ` Dennis Lee Bieber
2019-02-27  6:20           ` russ lyttle
2019-02-27  8:26             ` Dmitry A. Kazakov
2019-02-27 13:54               ` russ lyttle
2019-02-27 15:55                 ` Dmitry A. Kazakov
2019-02-27 16:46                   ` russ lyttle
2019-02-27 23:52                   ` Randy Brukardt
2019-02-27  8:20         ` Dmitry A. Kazakov
2019-02-27 14:06           ` russ lyttle
2019-02-27 14:23             ` Niklas Holsti
2019-02-27 16:01             ` Dmitry A. Kazakov
2019-02-27 17:04               ` russ lyttle
2019-02-27 17:29                 ` Dmitry A. Kazakov
2019-03-09 18:46         ` Norman Worth
2019-02-26 23:13     ` lyttlec
2019-02-27 19:10       ` Shark8
2019-02-27 19:51         ` russ lyttle
2019-02-27 22:12           ` Niklas Holsti
2019-03-01 15:07             ` fabien.chouteau
2019-02-27 10:47 ` Patrick Jakubowski
2019-02-28  6:23   ` G. B.
2019-02-28  8:28     ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox