mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rob Landley <landley@trommello.org>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org
Subject: Policy vs API (was Re: [PATCH] integrate driverfs and devfs (2.5.28))
Date: Mon, 5 Aug 2002 19:51:21 -0400	[thread overview]
Message-ID: <20020806055922.26D48644@merlin.webofficenow.com> (raw)
In-Reply-To: <20020805231914.GF29396@kroah.com>

On Monday 05 August 2002 07:19 pm, Greg KH wrote:

> > By the way, why doesn't imposing consistent predefined major/minor
> > numbers (0x0301 instead of "hda1") count as "policy"?   I'm honestly
> > curious...
>
> It does.  I want to get rid of it too :)  But that's still a ways away...

The user needs some kind of API.  Some way for a program to say "Could I 
please talk to the slave drive on the second IDE controller".  What I'm 
wondering is where's the line between "policy" and "API"?  You can't have a 
standard API without SOME level of "policy".

Major/minor device numbers suck because the namespace is too small (for 
historical reasons), it's randomly organized (again for historical reasons), 
it's almost exhausted (due to the first two), making it bigger will just help 
the clutter breed, and it's almost impossible to recycle old numbers as long 
as three people out there are still using the floppy tape controller or 
whatever.  Plus humans really do think in words (or at least text strings), 
hence the phone book and DNS to access numbers via strings.  (And the /dev 
directory.)

There already ARE standardized text based APIs, and internationalization 
people object to them for political correctness reasons and that's just 
stupid.  If somebody is REALLY stupid enough to translate the standard C 
library function names into chinese unicode, and then try to actually link a 
program against it, they deserve what they get.  Same with the standard unix 
commands: awk, grep, and sed aren't english.  (They're posix.  :)
Internationalizing the data going through an API is one thing, trying to 
internationalize the API itself is just silly.  Might as well encourage 
non-english posts on linux-kernel...

I've noticed a bias against actually using strings to interface the kernel 
with userspace (the module autoloader being one relatively obvious example), 
but it's still done in a bunch of places anyway ("/sbin/init", "linuxrc", 
"hotplug", "modprobe", the text command line for kernel booting with "init=", 
"root=", "initrd="...).  The kernel talks to other parts of the kernel by 
exporting text symbols, userspace talks to userspace with strings, why is 
kernel to userspace fundamentally different?  The problem with the horror 
that is /proc is that it's not ORGANIZED, not that it's text.  People put so 
much stuff into /proc because they WANT a text API, and for a long time that 
was their only real outlet.

The problems with devfs are, well, numerous, but the fundamental idea of 
automatically mounting a /dev directory with the available devices into it 
rather than a MAKEDEV script to create 8 zillion nodes for devices you might 
conceivably want to borrow from a museum someday...  Implementation issues 
aside, what was wrong with the idea itself?  The rebellion against using the 
existing names there makes devfs a lot less interesting to me, I know that 
much.  It doesn't provide the same API the /dev directory does, and half the 
software I use won't compile against it without a chainsaw and a bullwhip, or 
the daemon kludge.  Code quality aside, the new devfs api never struck me as 
an improvement over the old one.  (I STILL don't know why a change of 
implementation mandated a change of API.)

I'm under the vague impression that devicefs may somehow become the new 
driver API at some point after Buck Rogers returns from his frozen orbit.  
The whole POINT of devicefs seems to be to expose new data through a fresh 
API that's designed to grow without getting disorganized.  This implies (to 
me) a move towards a device API defined in the context of a text namespace.

If there's some move underway to avoid doing so (because any standard API is 
"policy"), what exactly is the better alternative?

Rob

  reply	other threads:[~2002-08-06  6:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-28 21:03 [PATCH] integrate driverfs and devfs (2.5.28) Adam Belay
2002-07-29 13:47 ` Adam Belay
2002-07-29 19:33 ` Patrick Mochel
2002-07-29 16:47   ` Adam Belay
2002-07-29 22:21     ` Patrick Mochel
2002-07-29 23:25       ` Oliver Neukum
2002-07-30 16:32         ` Patrick Mochel
2002-07-30 14:02           ` Adam Belay
2002-08-05  6:26         ` Rob Landley
2002-08-05 23:19           ` Greg KH
2002-08-05 23:51             ` Rob Landley [this message]
2002-08-06 16:34               ` Policy vs API (was Re: [PATCH] integrate driverfs and devfs (2.5.28)) Greg KH
2002-08-06 17:43               ` Patrick Mochel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020806055922.26D48644@merlin.webofficenow.com \
    --to=landley@trommello.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®