From owner-freebsd-hackers Wed Jun 3 23:41:08 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA10154 for freebsd-hackers-outgoing; Wed, 3 Jun 1998 23:41:08 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from antipodes.cdrom.com (castles348.castles.com [208.214.167.48]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA10148; Wed, 3 Jun 1998 23:41:01 -0700 (PDT) (envelope-from mike@antipodes.cdrom.com) Received: from antipodes.cdrom.com (localhost [127.0.0.1]) by antipodes.cdrom.com (8.8.8/8.8.5) with ESMTP id WAA00588; Wed, 3 Jun 1998 22:36:44 -0700 (PDT) Message-Id: <199806040536.WAA00588@antipodes.cdrom.com> X-Mailer: exmh version 2.0zeta 7/24/97 To: dyson@FreeBSD.ORG cc: jonny@jonny.eng.br (Joao Carlos Mendes Luis), mike@dingo.cdrom.com, mike@smith.net.au, hackers@FreeBSD.ORG Subject: Re: kernfs/procfs questions... In-reply-to: Your message of "Wed, 03 Jun 1998 23:41:14 CDT." <199806040441.XAA00768@dyson.iquest.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 03 Jun 1998 22:36:44 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Joao Carlos Mendes Luis said: > > > > Then, /dev/kmem is bogus ? > > TM > > The idea that file namespace controls everything is a GoodThing, > > and the existence of device files is one of the things I like > > more in Unix. > > > That is reducing things to the absurd. I don't like the silly > string parsing in the debug control for procfs for example. The > bad thing about multiple namespaces is when they aren't well supported, > poorly designed and not hierarchical like the SYSV IPC stuff. > > Think of this issue: > When writing a message to a /kernfs file to modify a function, > do you want to implement a full and general interface for partial > message transfers, etc??? Sysctl is pseudo-message based, and > operations are complete within themselves. The write has to be a single, complete operation. That more or less goes without saying. The issue is whether you are willing to have these implicit controls on something that you might think "should" behave entirely like a file. This still kills a lot of /dev, but it's also generally assumed that things mounted from "special" filesystems may have "special" semantics. > > I agree with somebody (Mike ?) who said that this facilitates > > using of general tools. > > > Sysctl is easy to use with such tools also. The current interface to sysctl sucks. I certainly can't use cat(1) on it. I can't open it and parse it with sscanf(). I can't mmap() it either, and it would be very nice to be able to do that. 8) > If someone wants to use the kernfs paradigm, it is okay, but it > seems to be redundant. Using sysctl is quite trivial (the man page > reflects a much nicer API than the original.) Also, kernfs implies > a filesystem, and the associated VFS stuff, while it isn't needed > with sysctl. You don't need vnodes, or any of the other cruft > to implement the unnecessary state for sysctl, while filesystems > have to implement all kinds of things... The biggest win from the filesystem complexity is traversal that works. I implemented the entire DMI parameter space as a self-handling sysctl hierarchy the other day. It worked fine insofar as you could look things up if you knew they were there, but sysctl makes no provision for traversal through self-handled subtrees, and it would be slightly difficult to add without a major interface change. If you go look like a filesystem, this happens automatically. It is also one of the things that would prevent a sysctlfs being trivially implementable. Imagine a node that looked like a file, but was actually a directory... (No, the DMI code isn't going anywhere fast. You can do everything I did by reading from /dev/mem; I haven't implemented the procedural interface yet because they use the demented 16-bit protected mode PnP interface and Jonathan isn't happy with our support for that yet.) -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message