05-04-2011
I've known for a long time that device files are in /dev. However, I forget how I came to know that. So remember this thread!! Then when someone asks you 30 years from now how you knew that device files are in /dev you can refer him to this forum. We always appreciate referrals from our members.
So I list the files in /dev. Then, with awk I select only those with field 5 equal to "1," which is the major number. And I sort the output by 1st character (which is driver type -- actually file type but same difference) and field 6 (which is the minor number).
This User Gave Thanks to Perderabo For This Post:
4 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I am looking for a guide on how to program for either the Linux or FreeBSD (includes 4.4BSD, NetBSD or OpenBSD) kernel. I would prefer to learn how to write device drivers, but anything would help.
If you know, please email me at *removed* or leave a post here
Regards,
Farhan (0 Replies)
Discussion started by: Farhan
0 Replies
2. Solaris
I've been researching minimizeing Solaris 8 and found that on the web page http://www.sun.com/bigadmin/content/packagelist/s8u7PkgList/p2.html the package SUNWglmr
is listed as "rasctrl environment monitoring driver for i2c, (Root) (32-bit)" while in the document "Solaris 8 minimize-updt1.pdf"... (1 Reply)
Discussion started by: roygoodwin
1 Replies
3. Linux
I recently started working with Linux and wrote my first device driver for a hardware chip controlled by a host CPU running Linux 2.6.x kernel.
1. The user space process makes an IOCTL call with pointer to a user memory buffer.
2. The kernel device driver in the big switch-case of IOCTL,... (1 Reply)
Discussion started by: agaurav
1 Replies
4. UNIX for Advanced & Expert Users
Hi all!
I am trying to register a device in an existing device class, but I am
having trouble getting the pointer to an existing class.
I can create a class in a module, get the pointer to it and then use
it to register the device with:
*cl = class_create(THIS_MODULE, className);... (0 Replies)
Discussion started by: hdaniel@ualg.pt
0 Replies
mknod(5) File Formats Manual mknod(5)
NAME
mknod.h - header file of macros for handling device numbers
SYNOPSIS
DESCRIPTION
The header file defines macros to create and interpret device identification numbers for use with the system call (see mknod(2)).
The use of these macros is architecture-dependent. See the System Administration Manual for your system for information on how to select
major and minor device numbers.
contains the macro
which packs the major and minor components into a device identification number suitable for the dev argument of and the two macros:
which extract the major and minor number components, respectively, from a device identification number, dev.
The macro is a specification (see printf(3S)) that prints the minor number in the format best suited to the particular implementation; it
is used by the long format of the command (see ls(1)) to show the minor numbers for device files.
The base of the number is indicated in the same way as in the C programming language: no leading zero for decimal, leading zero for octal,
and leading for hexadecimal.
SEE ALSO
ls(1), mknod(1M), mknod(2), printf(3S).
mknod(5)