[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MIG manuals

From: Ognyan Kulev
Subject: Re: MIG manuals
Date: Wed, 6 Jun 2001 18:24:11 +0300
User-agent: Mutt/1.3.15i

On Wed, Jun 06, 2001 at 10:51:53AM -0500, Neal H Walfield wrote:
> > > Thank you very much for the answer. Would you happen to know where I can
> > > find some examples of fairly simple translators? The only ones I've found
> > > so far are the one included in the Hurd distribution (ext2fs, exec, auth
> > > ...) and they are really complex to understand for someone without great
> > > experience of The Hurd...
> > 
> > hurd/trans/hello{,-mt}.c are good starting points, however, these are
> > more translators than the server that you are trying to write.
> Or rather, these use libraries as opposed to raw calls.

What about following:

You make a very simple translator that uses trivfs.  You can use
trans/hello.c as a boilerplate.  The last line of main() uses trivfs_demuxer
which can be replaced by your own function.  Use
proc/main.c:message_demuxer() but replace process_server, notify_server,
ports_interrupt_server and proc_exc_server with trivfs_demuxer and
myserver_demuxer.  Remove mutex locking/unlocking.  myserver_demuxer should
be generated by MiG.  This way the translator will process trivfs interface
*and* your interface.  Everything else is your interface implementation and
MiG generated skeletons.

Use `settrans -a /some/file/name /my/server'.

Clients link with the MiG generated stub and use file_name_lookup glibc
function to get mach port to the server.  In theory just passing this port
to _your_ MiG routines will work.   file_name_lookup is defined in <hurd.h>.

*Warning:* I still haven't written any translator or Mach server so this
might not work.  Someone more experienced might tell.  I beleive that after
some corrections this outline will work.

BTW Why in proc/main.c there is global_lock that is used in message_demuxer
if proc is single-threaded?

PS This discussion belongs to help-hurd so i moved it.

Ognyan Kulev <>, "\"Programmer\""

reply via email to

[Prev in Thread] Current Thread [Next in Thread]