|
|
Log in / Subscribe / Register

Toward a larger dev_t

Toward a larger dev_t

Posted Mar 27, 2003 12:19 UTC (Thu) by rwmj (subscriber, #5474)
Parent article: Toward a larger dev_t

Device major and minor numbers (and indeed block/char special inodes) are one of those early Unix things which have now really outlived their usefulness. The current problems and debates around them are symptomatic of the fact that the whole concept is flawed.

They were originally necessary as a hack so that one could create files which looked like devices on an ordinary filesystem.

There are two better approaches now.

One is a kind of enhanced 'devfs'. It would look a lot like /proc (the clue here is that /proc has files with magical properties, yet it doesn't need block or char special inodes). The newer devfs would be mounted under /dev. When a device is registered, a /proc-like file is created which just intercepts the open/read/write/etc. system calls and calls device-supplied functions to provide the magic properties of the file. No major or minor numbers required.

This would work for /dev but wouldn't allow you to create block and char special files on any ordinary filesystem. I'm proposing that we extend ext3 to add special "object" inodes. An object inode has some metadata - probably just the name of the kernel module which handles that inode. When an object inode is opened, it causes the module to be loaded and the open function in this module to be called. Read/write/etc. operations can be modified by the module to provide whatever kind of magic is required.

One interesting possibility is to replace some configuration files with object inodes. /etc/passwd, for example, could be a special type of file which, when read, looks like an ordinary password file, but the data is actually pulled from NIS or LDAP.

Just my £0.02 anyway.

Rich.


to post comments

Toward a larger dev_t

Posted Mar 27, 2003 18:28 UTC (Thu) by hummassa (guest, #307) [Link] (1 responses)

I don't mean to be rude or anything, but did you notice you just invented The HURD? ;-)

regards,
Massa

not even close

Posted Mar 28, 2003 16:27 UTC (Fri) by pflugstad (subscriber, #224) [Link]

No, not even close. He describes some simple enhancements to the
filesystem to allow the kernel to do away with major/minor numbers.
Something that should/could have been done a long time ago.

The HURD is something else entirely.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds