Re: can i see a driver's registered *minor* number(s)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 11 Apr 2008, Rene Herman wrote:

> On 11-04-08 11:56, Robert P. J. Day wrote:
>
> >   i know well enough that, if i write and load a driver that
> > allocates a device major number and one or more minor numbers, i
> > can see the allocated major number via /proc/devices.  but is
> > there a userspace way to see the minor number(s)?  or, as LDD3
> > implies, it's my job to just *know* what those would have been?
> > thanks.
>
> Just idle interest -- I see the lowercase "I" more and more these
> days. Is it a kiddospeak thing or is that actually finding its way
> into the English language?

  just FYI, i long ago gave up on uppercase for the most part since
doing that makes a *huge* difference in avoiding carpal tunnel
syndrome.  constantly reaching for the shift keys represents a
noticeable amount of stress on the wrists.  when i stopped doing that,
it made a significant difference.  your mileage might vary, of course.
:-)

> Historically, no way. The driver just gets everything for its
> registered major and has to switch on minor itself. That is, no such
> thing as "allocated" minors as far as the system is concerned.

i had suspected as much, i just wanted to make sure.

> Newishly though, we have class_create() and device_create() which do
> provide minors with more of a role. For exaple, if you look at
> /sys/class/mem, you see subdirectories according to its minors.
>
> The "historic" driver is far from obsolete though, so the best
> answer is "if you're lucky, but don't count on it".

fair enough, that's pretty much the answer i was looking for.  thanks.
more dumb questions coming shortly.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux