LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-24-2003, 09:18 AM   #1
pe2338
Member
 
Registered: Dec 2002
Location: Bucharest,RO
Distribution: debian etch, sarge and sid
Posts: 407

Rep: Reputation: 30
Question How are the numbers generated?


Hello everybody!

I have been searching for this on google and on the forum, but I couldn't find something related...

I am wondering : How are the char/block major/minor numbers assigned?
I came first accross this problem when I installed for the first time the Nvidia driver that was char-major-195. Hit it back on the rtc clock with char-major-135 and again with the bttv module that was char-major-80 (although I found a tutorial that indicated to use 81).

Coming back to the question, how are these assigned? Some pointers, links...

thanks!
 
Old 09-24-2003, 10:00 AM   #2
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 47
From:
http://www.tux.org/lkml/#s2-8

8. What's this major/minor device number thing?

* (REG) Device numbers are the traditional Unix way to provide a mapping between the filesystem and device drivers. A device number is a combination of a major number and a minor number. Currently Linux has 8 bit majors and minors. When you open a device file (character or block device) the kernel takes the major number from the inode and indexes into a table of driver structure pointers. The specific driver structure is then used to call the driver open() method, which in turn may interpret the minor number. There are two tables: one for character devices and one for block devices, each are 256 entries maximum. Obviously, there must be agreement between device numbers used in a driver and files in /dev. The kernel source has the file Documentation/devices.tex which lists all the official major and minor numbers. H. Peter Anvin (HPA) maintains this list. If you write a new driver (for public consumption), you will need to get a major number allocated by HPA. See the Q/A on devfs for an improved (IMHO) mechanism for handling device drivers.

EDIT: devices.tex is a typo in that doc, or has changed. Search on your system for devices.txt.

Last edited by itsjustme; 09-24-2003 at 10:05 AM.
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 2 & 1 generated TuxFreak Linux - Software 1 04-23-2005 06:59 AM
hd problem generated by smartd martinius Linux - Hardware 2 04-04-2005 05:57 AM
random generated password LinuxRam Linux - Security 13 09-13-2004 05:25 AM
no output generated suchi_s Programming 2 09-08-2004 05:08 AM
Adding numbers, break on non-numbers... Cruger Programming 1 03-22-2004 09:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:02 AM.

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