comp.lang.ada
 help / color / mirror / Atom feed
From: "Marven Lee" <mehs60@dsl.pipex.com>
Subject: Re: For the AdaOS folks
Date: Sun, 2 Jan 2005 15:09:36 -0000
Date: 2005-01-02T15:09:36+00:00	[thread overview]
Message-ID: <33qh7eF42pn2fU1@individual.net> (raw)
In-Reply-To: b1hBd.44026$nV.1358305@news20.bellglobal.com

Warren W. Gay VE3WWG wrote:
> Marven Lee wrote:
>> In Mach it's called "migrating threads".
>
> Yes, I've seen references to this in the Mach
> literature.

Yes, and from your other post you've already found the
paper on migrating threads in Mach.

http://www.brynosaurus.com/pub.html

It is interesting to note that he wrote some libraries and
apps on AmigaOS.  I think he works for Microsoft now.



>> You can end up with a microkernel that only handles cross-domain
>> calls.  Everything else, including what you normally think
>> a microkernel should at least include,
>
> I'm glad you said "normally" here. ;-)
>
>> such as memory management,
>> scheduling and IPC can be implemented outside of the microkernel.
>
> Exokernel?

No, I'd still call it a microkernel or perhaps a trampoline.

It would be a bit like Ingo Molnar's 4GB kernel / 4GB user
patch for Linux.

http://lkml.org/lkml/2003/7/8/246

This moved the kernel from the top 1GB of every process
into a 4GB address space of its own.  a 16MB trampoline
(microkernel) exists at the top of every address space
to transfer syscalls and interrupts into the address space
that the Linux kernel resides in.

In some ways this is similar to a single server Linux personality
running on a microkernel like L4Linux. I think the difference
between the trampoline and L4Linux can be summed up as
L4 uses an active object model and the trampoline/migrating
threads uses a passive object model.

I'm not sure if or why the 4G4G in Linux needs 16MB, it
can be done in less than a page of code and a few bytes of data.
The trampoline should take up something in the region of 8KB
of the address space.

You could replace Linux with Mach as the personality.  Yes,
it sounds a bit wierd having Mach run on top of a microkernel
or trampoline.   Although Mach would be running as a single
server personality this doesn't stop multiple servers existing, they
just have to make cross-domain calls into the Mach personality
to make use of Mach's IPC.  It is single server only from the
point of view of cross-domain calls through the trampoline
microkernel.

So you can think of this trampoline/microkernel as a fancy
syscall redirection mechanism that moves a kernel from
kernel-mode in all address spaces to its own address space.

The trampoline copies small messages in registers, if
you want to copy more then you have to change functions
in the personality such as copy_to_user() and copy_from_user()
to map pages from the application process into the personality
and copy the data from there.



By using a more sophisticated trampoline that keeps track
of what protection domains a thread has permission to
migrate to you can have a multiserver cross-domain call
mechanism.  The trampoline would require more storage
space than the simple single server approach.

I've dug up an old thread from alt.os.development where
KVP describes a single server trampoline and I follow
up with a rough idea of how to implement a
trampoline-microkernel that supports multiple servers.

http://tinyurl.com/6gb5b

That was an old posting of mine and I'd probably change the
"activation" structure around a bit.  I'd more likely use
array indices to reference other activations instead of pointers.
I'd also change some of the needed system calls as well.



Onto AmigaOS.  Let me make this clear from the outset
to any Amigans reading that what I'm about to write below isn't
about  how to add memory protection to AmigaOS, it's only
about how the structure of AmigaOS relates to microkernels
that make use of cross-domain calls / migrating threads.

I always think of migrating threads in terms of AmigaOS.
AmigaOS didn't have any protection and divided everything
into shared libraries.  But the libraries weren't like those
in other operating systems, they were more like the subsystems
of a kernel.  Ideally they should have been placed in their
own address spaces/protection domains and a cross-domain
call should have been used to access them.

The core library of AmigaOS, exec.library would become
a server, just like Mach in the above single server example.
All other libraries, including devices which are more or less
libraries with their own thread would also become servers.

It would be as if the a trampoline microkernel had replaced
the library jump tables it used.  In an earlier post in this
thread Dennis Lee Bieber said everything was done with
message ports, from my point of view I'd say everthing
was done with library calls.  After all the message passing
was done by library calls to exec.library.

In effect what they should be is, "Protected Shared Libraries."  *

I had wondered if anyone in the Amiga community had come up
with similar ideas and found this in a 1997 newsgroup posting
entitled  "p-OS & Multiprocessing"...


Michael van Elst wrote:
> Jeroen T. Vermeulen wrote:
>> One major problem is that the Amiga's shared libraries act as
>> OOP-style objects, matching responsibilities to context much more
>> elegantly than other OSs do (where process ID is everything).  A
>> process conceptually switches to a different protection domain when
>> it calls a library function.
>
> Correct. That's why a protected AmigaOS must support protection
> domains not only for processes but also for libraries. That's a
> generalization of the UNIX model. There you have protection domains
> for each process plus one protection domain for the kernel which is
> mainly a huge library. In AmigaOS every library would need its own
> protection domain and context switches must be as lightweight as
> possible.


I also like the way each thread in AmigaOS has access to exec.library.
Each thread could call the exec.library functions OpenLibrary() and
CloseLibrary() to load a library into memory and obtain a handle to
access it.  A similar way could be used for loading modules in a
system that uses cross-domain calls/migrating threads except that
it would need to create a stack in a server for a thread to use when
it has called into the server.

These "protected shared libraries" (PSLs from now on) needn't be
global to the entire system.  You could have global PSLs for
the memory manager, the filesystem, networking and GUI.  Per-
user PSLs for things like a clipboard and desktop.  Finally you
could have per application private PSLs so as to decompose
an application into a number of PSLs.



> I've never been too keen on the single address space systems.

I like the way you can pass areas of memory between address
spaces without having to search for a suitable place to stick
it in the destination address space, they can use the same
region of the address space in each address space.  This might
also be useful when copying data through a series of address
spaces.  I don't think having pointers meaning the same thing
in different address spaces is a benefit though, especially
in messages where a pointer could point outside a message
without any error checking.




Now for some suggested reading...

"High Performance Cross Address Space Communication"
and "Lightweight Remote Procedure Call" by B.Bershad.
One of the older papers that other papers cite.

"Evolving Mach 3.0 to a Migrating Thread Model" and
"Microkernels Should Support Passive Objects" by
B.Ford & J.Lepreau.  The second one puts forward
some reasons why microkernels should use migrating
threads.

Sun's "Spring nucleus, A Microkernel for Objects"
by G. Hamilton.  They took the idea of Doors from
Spring and later added them to Solaris.


The "Pebble Operating System"
http://www.bell-labs.com/project/pebble/

has a few papers, "The Pebble Component-Based Operating
System" is the main one.

"The Mungi Single-Address-Space Operating System"
by G.Heiser.  Although I think it runs on top of L4
it has a "protected procedure call" mechanism called PDX.

There is also the Grasshopper kernel but I'm not sure
what the main research papers on it are called.

* "Protected Shared Libraries" by A.Banerju and D.L. Cohn.

Then there are kernel-less systems that have some
similarities to cross-domain calls.

"Anonymous RPC" by C.Yarvin et al.  Imagine the Amiga's
shared libraries randomly scattered around a 64-bit address
space.  Imagine also that the Amiga library jump tables
are execute-only and not readable, and that it was running
on a RISC chip with instruction-alignment constraints.
Then you've got a idea of what "Anonymous RPC" and
probablistic memory protection is about.

"Implementing Operating Systems without Kernels" and
"Efficient Cross-domain Mechanisms for Building
Kernel-less Operating Systems" by D.Probert and J.Bruno.
I read it some time ago, I think it is more or less about
the trampoline/microkernel being implemented in hardware.




Marv









  parent reply	other threads:[~2005-01-02 15:09 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-27  5:09 For the AdaOS folks Wes Groleau
2004-12-27 10:56 ` Florian Weimer
2004-12-27 12:50   ` Georg Bauhaus
2004-12-27 13:12     ` Florian Weimer
2004-12-28  1:18   ` Wes Groleau
2004-12-27 13:46 ` Adrien Plisson
2004-12-27 16:28   ` Georg Bauhaus
2004-12-28  6:19   ` Microkernels & Ada (Was for the AdaOS folks) Warren W. Gay VE3WWG
2004-12-28 12:02     ` Adrien Plisson
2004-12-28 15:28       ` Warren W. Gay VE3WWG
2004-12-30  1:19 ` For the AdaOS folks Nick Roberts
2004-12-30 13:58   ` Warren W. Gay VE3WWG
2004-12-30 15:27     ` Dmitry A. Kazakov
2004-12-30 16:30       ` Warren W. Gay VE3WWG
     [not found]         ` <otb8t09dkjh54e1k5s5ccn23ggkqk6ndui@4ax.com>
2004-12-30 19:06           ` OT: Mach Ports (For the AdaOS folks) Warren W. Gay VE3WWG
2004-12-31 10:03         ` For the AdaOS folks Dmitry A. Kazakov
2004-12-31 11:30           ` Warren W. Gay VE3WWG
2004-12-31 12:31             ` Dmitry A. Kazakov
2004-12-31 16:24               ` Warren W. Gay VE3WWG
2004-12-31 17:57                 ` Marven Lee
2004-12-31 18:40                   ` Warren W. Gay VE3WWG
2004-12-31 19:22                     ` Warren W. Gay VE3WWG
2005-01-02 15:09                     ` Marven Lee [this message]
2005-01-02 20:06                       ` Luke A. Guest
2005-01-03  3:13                         ` Warren W. Gay VE3WWG
2005-01-03  6:40                           ` Luke A. Guest
2005-01-03 10:30                             ` Marven Lee
2005-01-03 15:52                             ` Warren W. Gay VE3WWG
2005-01-03 16:48                           ` Ad Buijsen
2005-01-03 18:49                             ` Warren W. Gay VE3WWG
2005-01-03 13:43                         ` Marven Lee
2005-01-04 23:36                         ` Nick Roberts
2005-01-03 16:22                       ` Warren W. Gay VE3WWG
2005-01-04 23:16                       ` Nick Roberts
2005-01-05  3:48                         ` Warren W. Gay VE3WWG
2005-01-05 13:14                           ` Nick Roberts
2005-01-01 12:53                 ` Dmitry A. Kazakov
2005-01-02  0:31                   ` Warren W. Gay VE3WWG
2005-01-02 11:50                     ` Dmitry A. Kazakov
2005-01-02 22:04                       ` Warren W. Gay VE3WWG
2005-01-03 10:30                         ` Dmitry A. Kazakov
2005-01-03 16:36                           ` Warren W. Gay VE3WWG
2005-01-03 17:05                             ` Dmitry A. Kazakov
2005-01-03 19:01                               ` Warren W. Gay VE3WWG
2005-01-03 19:55                                 ` Dmitry A. Kazakov
2005-01-03 20:44                                   ` Warren W. Gay VE3WWG
2005-01-04  0:02                                     ` Randy Brukardt
2005-01-04 17:44                                       ` Warren W. Gay VE3WWG
2005-01-04 20:14                                         ` Nick Roberts
2005-01-04  9:59                                     ` Dmitry A. Kazakov
2005-01-04 18:00                                       ` Warren W. Gay VE3WWG
2005-01-04 19:07                                         ` Dmitry A. Kazakov
2005-01-04 19:57                                           ` Warren W. Gay VE3WWG
2005-01-05  0:02                                             ` Nick Roberts
2005-01-05  4:37                                               ` Warren W. Gay VE3WWG
2005-01-05 18:54                                                 ` Nick Roberts
2005-01-05 20:04                                                   ` Warren W. Gay VE3WWG
2005-01-06  0:32                                                     ` Nick Roberts
2005-01-06  1:29                                                   ` Wes Groleau
2005-01-06 11:03                                                     ` Dmitry A. Kazakov
2005-01-05  9:39                                             ` Dmitry A. Kazakov
2005-01-05 11:20                                               ` Warren W. Gay VE3WWG
2005-01-05 12:18                                                 ` Dmitry A. Kazakov
2005-01-05 14:39                                                   ` Warren W. Gay VE3WWG
2005-01-05 17:16                                                     ` zest_fien
2005-01-05 19:44                                                       ` Larry Kilgallen
2005-01-04 20:09           ` Nick Roberts
2005-01-05 10:19             ` Dmitry A. Kazakov
2005-01-05 18:33               ` Nick Roberts
2005-01-05 20:15                 ` Dmitry A. Kazakov
2004-12-31 18:47     ` Nick Roberts
2004-12-31 20:36       ` Warren W. Gay VE3WWG
2005-01-04 18:22         ` Nick Roberts
2005-01-05  5:12           ` Warren W. Gay VE3WWG
2005-01-05 18:02             ` Nick Roberts
2005-01-05 19:55               ` Warren W. Gay VE3WWG
2005-01-06  0:57                 ` Nick Roberts
2005-01-06  2:34                   ` Warren W. Gay VE3WWG
  -- strict thread matches above, loose matches on Subject: below --
2005-01-05 12:14 Mike Brenner
2005-01-05 18:04 ` Warren W. Gay VE3WWG
replies disabled

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