9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] A proposal regarding # in bind
@ 2003-02-26 22:44 a
  2003-02-26 23:02 ` Russ Cox
  0 siblings, 1 reply; 42+ messages in thread
From: a @ 2003-02-26 22:44 UTC (permalink / raw)
  To: 9fans

// perhaps intro(3) should mention or include /sys/src/9/port/master.

then again, perhaps port/master should be up to date?
ア


^ permalink raw reply	[flat|nested] 42+ messages in thread
* Re: [9fans] A proposal regarding # in bind
@ 2003-02-26 23:46 a
  0 siblings, 0 replies; 42+ messages in thread
From: a @ 2003-02-26 23:46 UTC (permalink / raw)
  To: 9fans

i stand (gladly) corrected. thanks. i'm a bit behind on my
updates. i was about to say "well then maybe we should come
up with an automated way to ensure it stays that way" but
actually thought to check this time. sure enough, looks
like rsc's though of that, too. more thanks.
ア


^ permalink raw reply	[flat|nested] 42+ messages in thread
* Re: [9fans] A proposal regarding # in bind
@ 2003-02-26 21:26 John Stalker
  2003-02-27  8:29 ` Fco.J.Ballesteros
  0 siblings, 1 reply; 42+ messages in thread
From: John Stalker @ 2003-02-26 21:26 UTC (permalink / raw)
  To: 9fans

In some sense # has to be a special case.  The / hierarchy is (potentially)
different for each process.  The # hierarchy is not.  You need a global
namespace from which to choose what to include in a local namespace.  At least
you do if you want children to be able to bind things which were not in their
parents' name spaces.  /ur or variants thereof in some sense hide a copy of
the global namespace inside the local one.  Whether that's a good thing or a
bad thing is partially a matter of aesthetics.  Since I actually like ed(1)
my opinion in questions of aesthetics should be regarded as worthless.
--
John Stalker
Department of Mathematics
Princeton University
(609)258-6469


^ permalink raw reply	[flat|nested] 42+ messages in thread
* Re: [9fans] A proposal regarding # in bind
@ 2003-02-26 14:56 rog
  2003-02-26 15:02 ` Russ Cox
  0 siblings, 1 reply; 42+ messages in thread
From: rog @ 2003-02-26 14:56 UTC (permalink / raw)
  To: 9fans

> Suppose you recentered the kernel around 9P,
> building a muxer that wasn't process-based
> like devmnt's currently is.

one would also have to make devices more rigorous about use of
"writing process" resources, as presumably the device driver would no
longer have access to the user area of the process producing the
request, as would it not be necessary to send all 9p requests to a
driver down a Chan associated with that driver (and presumably every
driver would have at least one process reading 9p requests)?

so you'd be unable to post a file descriptor to /srv by writing its
integer file descriptor.

similarly you'd have to think of another way to give fs(3) access to
files to multiplex, or to give bind in ip(3) a device to bind an
interface to.

perhaps a system call to post a file descriptor to part of the
namespace?  but that comes with its own problems.

you'd lose a certain amount in context switch time too, which wouldn't
matter so much for some devices but might be a significant overhead in
others.

all those rough edges...



^ permalink raw reply	[flat|nested] 42+ messages in thread
* Re: [9fans] A proposal regarding # in bind
@ 2003-02-26  6:21 okamoto
  2003-02-26 13:32 ` Digby Tarvin
  0 siblings, 1 reply; 42+ messages in thread
From: okamoto @ 2003-02-26  6:21 UTC (permalink / raw)
  To: 9fans

>> So ...
>>
>>     #*cons  == #c
>>     #*ether!0 == #l0
>>     #*ip!1 == #I1
>>     #*srv!auth == #sauth
>>
>
> I like '#*' idea.

I'm wondering why giving a more readable kernel device name is so important.
Those will be used only by whom making decision what kind of devices to give
to some end users.   In the Plan 9 environment, there might be only limitted number
of such administrator, and all the others can be 'end users'.   Those well educated
administrator can refer a table showing one rune charachter device name
and long one.

Just a kidding. ☺

Kenji



^ permalink raw reply	[flat|nested] 42+ messages in thread
* [9fans] A proposal regarding # in bind
@ 2003-02-24 19:25 Joel Salomon
  2003-02-25  4:33 ` Martin C.Atkins
  0 siblings, 1 reply; 42+ messages in thread
From: Joel Salomon @ 2003-02-24 19:25 UTC (permalink / raw)
  To: 9fans

How about /# ?
Where is the inferno group Martin said he cross-posted to?
comp.os.inferno seems to be a low traffic spam board.

--Joel



^ permalink raw reply	[flat|nested] 42+ messages in thread
* Re: [9fans] A proposal regarding # in bind
@ 2003-02-24 19:04 rog
  2003-02-24 19:04 ` rob pike, esq.
                   ` (3 more replies)
  0 siblings, 4 replies; 42+ messages in thread
From: rog @ 2003-02-24 19:04 UTC (permalink / raw)
  To: 9fans

rob:
> Your proposal is interesting but doesn't solve the bootstrap problem.
> How would /proto get mounted?  You see, the thing about # names
> is that they're really not in the name space, and that comes in handy
> when booting or creating a name space from scratch, such as in
> listen.  Since a program can't name the proto driver, how does one
> establish a connection to it?  I'm sure there's a way; I just wonder
> what your plan is.

two possibilities spring to mind:

a) there's still an escape from the namespace, but a smaller one:
there could be one (and only one) device nameable in the '#' name
space, the proto device.  (whether one allows an attach spec is a
matter of taste).  that at least would solve some of the naming
problems.

b) have a special system call for attaching proto.

martin:
> One could have a /proto/ctl file to which commands could be sent to remove
> (or even add?!) devices from the visibility of this, and inheriting, processes
> (a sort of fine-grained NODEVS).

this would require that the namespace served by the proto device
was specific to a namespace group. how would the proto device
know to serve the same namespace to a process that's just
done an rfork(RFNAMEG)?

you could make it so each attach to '#' (the proto device) gave
you a new instance of that device, so:

	unmount /proto
	bind '#' /proto

would allow changing of availability of devices in /proto
without affecting anything else.



^ permalink raw reply	[flat|nested] 42+ messages in thread
* [9fans] A proposal regarding # in bind
@ 2003-02-24 15:19 Martin C.Atkins
  2003-02-24 15:28 ` Boyd Roberts
  2003-02-24 18:36 ` rob pike, esq.
  0 siblings, 2 replies; 42+ messages in thread
From: Martin C.Atkins @ 2003-02-24 15:19 UTC (permalink / raw)
  To: 9fans, inferno

Hi,
	One thing I have never quite felt comfortable with in Plan9
and Inferno, is the special treatment of '#' in the bind system call,
and more generally, at the start of any path given to open, etc.
(The following discussion uses Inferno examples, but most have direct
Plan9 equivalents. I've cross-posted this to both groups, since it is
a question about both systems - I hope that is OK!)

Problems I see with '#' include:
It is a special case:
	Nowhere else is there a similar mechanism/convention.

Limited:
	What happens when we run out of letters/glyphs to represent devices?
	(Ok, so there *are* 65,000-odd glyphs... :-)

Awkward:
	Many device letters are no-longer obvious. E.g. Many devices could
	reasonably be #s - SCSI, serial, etc. Oops, no it's srv!
	Is #d a disk, or /dev/draw?
	Why is flash '#W'? Why is ssl '#D'? (Because '#s' is srv perhaps?)

Breaks the rules in 'The Hideous Name':
	why can't I do:
		ls -l #?
	to see all the devices, etc...

Requires other special cases:
	Such as the sys-pctl option, NODEVS.

I think I have a proposal that could replace this mechanism, addressing all
these problems, while providing a (reasonably) clean backwards compatibility option
until the rest of the system caught up.

I propose a special filesystem driver, call it 'proto', which is mounted
on /proto by the kernel, during the creation of the first, 'init', process
from which all the others are derived by forking.
The /proto directory would contain a file for each device, so that instead
of
	bind '#c' ...
one would do
	bind '/proto/console' ...
(or "bind '/proto/cons' ...", if you must insist :-)

The special behaviour of proto, would be that attempts to bind files within
it would do what binds of names beginning with '#' currently do.

Then one could:
	ls -l /proto
to see the devices on this system.

But lots of programs have "#..." filenames in them, so what about them?
While such programs continue to exist, system calls would be changed so that '#x'
at the start of a filename would be expanded to:
	/proto/shortnames/x
The "shortnames" directory would contain the single letter pseudonyms for the drivers.
Furthermore, "bind '#Dppp/path' ..." would be rewritten to:
	bind '/proto/shortnames/D/ppp/path' ...

So that the example from KFS(3):
	echo filsys fs kfs.file >'#Kcons/kfsctl'
would be equivalent to:
	echo filsys fs kfs.file >'/proto/shortnames/K/cons/kfsctl'
or, to:
	echo filsys fs kfs.file >'/proto/kfs/cons/kfsctl'

(
	bind '#D/path' ...
could map to:
	bind '/proto/shortnames/D/./path' ...
or are there any better suggestions? Would
	bind '/proto/shortnames/D//path' ...
actually be safe enough?)

Once drivers are represented by files, lots of other things become possible
(although some of these might be going too far...)

Access to devices could be controlled by permissions, etc.

One could have a /proto/ctl file to which commands could be sent to remove
(or even add?!) devices from the visibility of this, and inheriting, processes
(a sort of fine-grained NODEVS).

"sys->pctl(NODEVS, [])" itself could be replaced by:
	unmount /proto
since there is no way for a program to name the proto driver, there is
then no way to get access to it once it has been unmounted, or to gain
access to any other devices! '#' names would expand into non-existent paths.

This all seems so obvious, that I can't understand why it hasn't always
been done this way!

I'm sure that there would be many practical issues to sort out in
changing to this kind of scheme. One problem that springs to mind is
the format of /prog/pid/ns, and programs that read it...

But are there any fundamental problems with this approach? Was there some
clever reason why this wasn't done from the start, or would cause untold
problems that I haven't thought of?

I.e. Am I missing something, or is it a 'good idea' (that might be
too much trouble to change for now)?

Martin
--
Martin C. Atkins				martin@mca-ltd.com
Mission Critical Applications Ltd, U.K.		http://www.mca-ltd.com


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2003-02-27  8:29 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-26 22:44 [9fans] A proposal regarding # in bind a
2003-02-26 23:02 ` Russ Cox
  -- strict thread matches above, loose matches on Subject: below --
2003-02-26 23:46 a
2003-02-26 21:26 John Stalker
2003-02-27  8:29 ` Fco.J.Ballesteros
2003-02-26 14:56 rog
2003-02-26 15:02 ` Russ Cox
2003-02-26  6:21 okamoto
2003-02-26 13:32 ` Digby Tarvin
2003-02-26 13:58   ` Russ Cox
2003-02-26 14:14   ` Russ Cox
2003-02-26 14:33     ` Boyd Roberts
2003-02-26 15:28       ` Ronald G. Minnich
2003-02-24 19:25 Joel Salomon
2003-02-25  4:33 ` Martin C.Atkins
2003-02-24 19:04 rog
2003-02-24 19:04 ` rob pike, esq.
2003-02-24 19:53   ` Jack Johnson
2003-02-25  4:37   ` Martin C.Atkins
2003-02-25 11:02     ` chris
2003-02-25 14:01       ` Martin C.Atkins
2003-02-25 14:11         ` Russ Cox
2003-02-25 14:17           ` Martin C.Atkins
2003-02-25 14:34             ` Russ Cox
2003-02-25 14:36               ` Russ Cox
2003-02-25 14:52                 ` Ronald G. Minnich
2003-02-25 19:57                   ` northern snowfall
2003-02-25 16:49                 ` Dan Cross
2003-02-26  5:12                   ` Martin C.Atkins
2003-02-24 19:29 ` Fco.J.Ballesteros
2003-02-24 22:34 ` George Michaelson
2003-02-24 23:32   ` Bruce Ellis
2003-02-25  5:02     ` Martin C.Atkins
2003-02-25 11:19       ` chris
2003-02-25 14:06         ` Martin C.Atkins
2003-02-26  0:04         ` Bruce Ellis
2003-02-26  6:06           ` Skip Tavakkolian
2003-02-25  5:00 ` Martin C.Atkins
2003-02-24 15:19 Martin C.Atkins
2003-02-24 15:28 ` Boyd Roberts
2003-02-24 18:36 ` rob pike, esq.
2003-02-25  4:57   ` Martin C.Atkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).