Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 7 Sep 2002 20:23:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 7 Sep 2002 20:23:44 -0400 Received: from air-2.osdl.org ([65.172.181.6]:7617 "EHLO cherise.pdx.osdl.net") by vger.kernel.org with ESMTP id ; Sat, 7 Sep 2002 20:23:39 -0400 Date: Sat, 7 Sep 2002 17:39:04 -0700 (PDT) From: Patrick Mochel X-X-Sender: mochel@cherise.pdx.osdl.net To: Greg KH cc: Daniel Phillips , , Subject: Re: [RFC][PATCH] x86 BIOS Enhanced Disk Device (EDD) polling In-Reply-To: <20020904041705.GC3739@kroah.com> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="346834433-168841503-1031445544=:1021" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 22630 Lines: 422 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --346834433-168841503-1031445544=:1021 Content-Type: TEXT/PLAIN; charset=US-ASCII > Sweet, we're an axis now! That's much better than the other terms Pat > and I have been called in the past... And everyone knows what's the > next size jump up from axis :) Yes, this is definitely cause for celebration. I've always believed that I was a straight line around which objects rotated. Thanks for the reassurance ;) > So here's how driverfs fits into the big picture in one sentance: > > Anything that does not have to do with processes > will go into driverfs. This is true, as per discussions in Ottawa in June. This will take a long time, and is not as clear cut as we make it out to sound. For example, porting things like meminfo and cpuinfo will likely never happen. Though, we intend to have equivalent information in driverfs. Things like stats will also take a long, if not indefinite amount of, time to convert because of performance concerns. But, the obvious candidates for transition are things like /proc/bus/*, /proc/ide, /proc/scsi, and at least the /proc/sys/cpu/ part of /proc/sys/. We've been working on solidifying the various top-level infrastructural pieces, like device classes, so that the organization of, and correlation between objects in, driverfs makes sense to at least developers. As always, mo' better stuff is coming RSN.. > So in this example, we are exporting a number of boot devices as the > bios told us, so apply the rule stated above, and determine if it should > go into /proc or not[1]. This is interesting, and I look forward to delving into the code. ACPI is doing something very similar. One thing I would like to do is create a 'platform' or 'firmware' top-level directory in driverfs in which all the various firmware drivers can display the data they ascertain from the firmware. Stay tuned.. > [1] Yes, it's still a bit difficult to figure how to add files to > driverfs, if you aren't starting with a "struct device" or "struct > device_driver", but I have seen some very nice documentation on how to > do it properly written by Pat involving a wonderful example of beer, and > I'm sure that once he gets back into internet connectivity range, he'll > be updating it and adding it to the Documentation directory. That > should be by the end of the week or so. Two examples are attached: pub.c: A subsystem that maintains a list of beers that are dyanamically registered and unregistered. This example is very similar to what is already there wrt devices and drivers. When the module is loaded, a top-level directory is created called 'pub', and a subdirectory is created in that: 'beer'. A struct beer describes a beer type. A couple of example beers are defined and are registered with the pub subsystem (pubsystem?). A directory is created for each, and a number of attributes are exported on behalf of the beer by the pubsystem. All are read-only for now. (Wouldn't you love to change the attributes of a beer? ;) The things to note are the following: - struct beer_attribute. This describes an attribute and includes type-safe callbacks to read and write the attributes. - BEER_ATTR() macro This helps you define an attribute for a beer. It creates a structure called beer_attr_, where is the name of the attribute, and initializes it properly. - struct driverfs_ops This defines the callbacks that driverfs actually calls. These are responsible for converting between the generic structures to the pubsystem-specific structures (see to_beer() and to_beer_attr() macros). This code is pretty much identical to what already exists. I'm not claiming its perfect, and not many eyes have really looked at what's going on. I'm sure I'll hear if I'm doing something completely retarded, and am looking forward to it. If anyone is really that bored (and sick), extend the pub to include objects of struct wine, etc. :) pat.c: An in-kernel representation of myself. This example exports attributes concerning my current state. I've been threatening for some time to write patfs, but I decided to port patfs to driverfs and eat my own dog food. It's pretty shoddy, and doesn't include a decent way to update my current attributes. But, it's good for about 3 seconds of entertainment. There is no registration of objects and no dynamic directory or file creation. I am singular and may not be replicated. When the module loads, a top-level directory is created named 'pat'. An array of files are then created, each one for a particular attribute of my self on this dreary Oregon Saturday. For defining attributes, I defined struct simple_attribute, which has no type-specific callbacks; they pass only the buffer, count, and offset. Because of this, the driverfs_ops for the patsystem are simple. [ struct simple_attribute can, and likely will be, defined in a common header for others to use. There is a lot more work that I've done in this area and I'm currently trying to figure out what to do with it all..] Everything else in it is pretty self-explanatory (I hope). The patsystem is pretty much as simple as it gets for exporting attributes of a subsystem. The documentation in Documentation/filesystems/driverfs.txt is up to date. If anyone has any questions, please ask. Other than that, go wild. -pat --346834433-168841503-1031445544=:1021 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="pub.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: pub.c Content-Disposition: attachment; filename="pub.c" LyoNCiAqIHB1Yi5jIC0gZXhwbG90aW5nIGRyaXZlcmZzIGZvciBmdW4gYW5k IHByb2ZpdA0KICoNCiAqIENvcHlyaWdodCAoYykgMjAwMiBQYXRyaWNrIE1v Y2hlbA0KICogICAgICAgICAgICAgICAgICAgIE9wZW4gU291cmNlIERldmVs b3BtZW50IExhYg0KICoNCiAqICBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0 d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeQ0K ICogIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVi bGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5DQogKiAgdGhlIEZyZWUgU29m dHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiBvZiB0aGUgTGlj ZW5zZSwgb3INCiAqICAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJz aW9uLg0KICoNCiAqICBUaGlzIHByb2dyYW0gaXMgZGlzdHJpYnV0ZWQgaW4g dGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwNCiAqICBidXQgV0lU SE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZlbiB0aGUgaW1wbGllZCB3 YXJyYW50eSBvZg0KICogIE1FUkNIQU5UQUJJTElUWSBvci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kaXIsJnB1Yl9kaXIpOw0KCWJlZXJfcmVnaXN0ZXIo Jmd1aW5uZXNzX2JlZXIpOw0KCWJlZXJfcmVnaXN0ZXIoJnBhYnN0X2JlZXIp Ow0KCXJldHVybiAwOw0KfQ0KDQpzdGF0aWMgdm9pZCBfX2V4aXQgcHViX2V4 aXQodm9pZCkNCnsNCgliZWVyX3VucmVnaXN0ZXIoJmd1aW5uZXNzX2JlZXIp Ow0KCWJlZXJfdW5yZWdpc3RlcigmcGFic3RfYmVlcik7DQoJZHJpdmVyZnNf cmVtb3ZlX2RpcigmcHViX2JlZXJfZGlyKTsNCglkcml2ZXJmc19yZW1vdmVf ZGlyKCZwdWJfZGlyKTsNCn0NCg0Kc3Vic3lzX2luaXRjYWxsKHB1Yl9pbml0 KTsNCm1vZHVsZV9leGl0KHB1Yl9leGl0KTsNCg== --346834433-168841503-1031445544=:1021 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="pat.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: pat.c Content-Disposition: attachment; filename="pat.c" LyoNCiAqIHBhdC5jIC0gYW4gaW4ta2VybmVsIHJlcHJlc2VudGF0aW9uIG9m IG15c2VsZi4NCiAqDQogKiBDb3B5cmlnaHQgKGMpIDIwMDIgUGF0cmljayBN b2NoZWwNCiAqICAgICAgICAgICAgICAgICAgICBPcGVuIFNvdXJjZSBEZXZl bG9wbWVudCBMYWINCiAqIA0KICogIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNv ZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5 DQogKiAgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQ dWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkNCiAqICB0aGUgRnJlZSBT b2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mIHRoZSBM aWNlbnNlLCBvc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KiBhdHRyOw0KCWludCBpOw0KCWludCBlcnJvciA9IDA7DQoJDQoJZm9yIChp ID0gMDsgKGF0dHIgPSBwYXRfYXR0cnNbaV0pOyBpKyspIHsNCgkJaWYgKChl cnJvciA9IGRyaXZlcmZzX2NyZWF0ZV9maWxlKCZhdHRyLT5hdHRyLCZwYXRf ZGlyKSkpDQoJCQlicmVhazsNCgl9DQoJcmV0dXJuIGVycm9yOw0KfQ0KDQpz dGF0aWMgaW50IF9faW5pdCBwYXRfaW5pdCh2b2lkKQ0Kew0KCWRyaXZlcmZz X2NyZWF0ZV9kaXIoJnBhdF9kaXIsTlVMTCk7DQoJcmV0dXJuIHBvcHVsYXRl X2RpcigpOw0KfQ0KDQpzdGF0aWMgdm9pZCBfX2V4aXQgcGF0X2V4aXQodm9p ZCkNCnsNCglkcml2ZXJmc19yZW1vdmVfZGlyKCZwYXRfZGlyKTsNCn0NCg0K c3Vic3lzX2luaXRjYWxsKHBhdF9pbml0KTsNCm1vZHVsZV9leGl0KHBhdF9l eGl0KTsNCg== --346834433-168841503-1031445544=:1021-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/