Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-17-2003, 10:18 PM   #1
LQ Newbie
Registered: Jun 2003
Location: Gangavathi, Karnataka(state), INDIA
Distribution: Redhat 7.3
Posts: 28

Rep: Reputation: 15
Question devfs max major/minor numbers

Hi All..

As of now Linux kernel supports 8 bits for Major and 8 bits for minor numbers ...but using devfs support for Linux kernel is it possible to increase this limit???
i need to support 1024 devices using one major number ? how?

-thanks in advacne.
Old 06-17-2003, 10:37 PM   #2
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 49
devfs doesn't do its thing using Major and minor numbers, those are there just for backward compatibility.
From the kernel documentation, /usr/src/linux/Documentation/filesystems/devfs/README:

Linux *must* move beyond the 8 bit major and minor barrier,
somehow. If we simply increase each to 16 bits, then the indexing
scheme used for major driver lookup becomes untenable, because the
major tables (one each for character and block devices) would need to
be 64 k entries long (512 kBytes on x86, 1 MByte for 64 bit
systems). So we would have to use a scheme like that used for
miscellaneous character devices, which means the search time goes up
linearly with the average number of major device drivers on your
system. Not all "devices" are hardware, some are higher-level drivers
like KGI, so you can get more "devices" without adding hardware
You can improve this by creating an ordered (balanced:-)
binary tree, in which case your search time becomes log(N).
Alternatively, you can use hashing to speed up the search.
But why do that search at all if you don't have to? Once again, it
seems pointless.

Note that devfs doesn't use the major&minor system. For devfs
entries, the connection is done when you lookup the /dev entry. When
devfs_register() is called, an internal table is appended which has
the entry name and the file_operations. If the dentry cache doesn't
have the /dev entry already, this internal table is scanned to get the
file_operations, and an inode is created. If the dentry cache already
has the entry, there is *no lookup time* (other than the dentry scan
itself, but we can't avoid that anyway, and besides Linux dentries
cream other OS's which don't have them:-). Furthermore, the number of
node entries in a devfs is only the number of available device
entries, not the number of *conceivable* entries. Even if you remove
unnecessary entries in a disc-based /dev, the number of conceivable
entries remains the same: you just limit yourself in order to save

Last edited by moses; 06-17-2003 at 10:41 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
why i cant get man major() or minor() henryluo Programming 5 06-27-2005 03:39 AM
How to determine major, minor programatically markjuggles Programming 1 04-15-2005 02:09 PM
Mouse mknod major/minor numbers? BlurredWeasel Linux - Hardware 2 11-06-2003 03:22 PM
major/minor number zyan Linux - Newbie 2 06-25-2001 07:57 PM
major /minor number zyan Linux - General 0 06-22-2001 03:26 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:59 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration