2004-06-02 11:29:20

by Manu Abraham

[permalink] [raw]
Subject: Minor numbers under 2.6

Hi,
Can somebody clarify a question that i have ?

Say under 2.4 kernel, char device drivers had a minor number of int. In the
2.6 kernels, this number was increased to 20 bits from 8 bits. Under 2.6 i
could use "mknod -c major, minor".

How can i achieve something similar with 2.6 taking into consideration that i
have to create more than 255 minors ?


Regards,
Manu


2004-06-02 14:50:24

by Greg KH

[permalink] [raw]
Subject: Re: Minor numbers under 2.6

On Wed, Jun 02, 2004 at 03:19:32PM +0400, Manu Abraham wrote:
> Hi,
> Can somebody clarify a question that i have ?
>
> Say under 2.4 kernel, char device drivers had a minor number of int. In the
> 2.6 kernels, this number was increased to 20 bits from 8 bits. Under 2.6 i
> could use "mknod -c major, minor".
>
> How can i achieve something similar with 2.6 taking into consideration that i
> have to create more than 255 minors ?

The same way:
# mknod foo c 100 10000
# ls -l foo
crw-r--r-- 1 root root 100, 10000 Jun 2 07:48 foo

Just make sure you have a up to date glibc.

Hope this helps,

greg k-h

2004-06-02 15:10:11

by Eric BEGOT

[permalink] [raw]
Subject: Re: Minor numbers under 2.6

Greg KH wrote:

>The same way:
> # mknod foo c 100 10000
> # ls -l foo
> crw-r--r-- 1 root root 100, 10000 Jun 2 07:48 foo
>
>
>
>
Under 2.6.7-rc2-mm1 :
root@Starbuck:/home/tyler>mknod /dev/test c 100 1000
root@Starbuck:/home/tyler>ll /dev/test
crw-r--r-- 1 root root 103, 232 Jun 2 17:07 /dev/test

and under 2.4.26 that's the same.

2004-06-02 15:17:46

by Greg KH

[permalink] [raw]
Subject: Re: Minor numbers under 2.6

On Wed, Jun 02, 2004 at 05:10:46PM +0200, Eric BEGOT wrote:
> Greg KH wrote:
>
> >The same way:
> > # mknod foo c 100 10000
> > # ls -l foo
> > crw-r--r-- 1 root root 100, 10000 Jun 2 07:48 foo
> >
> >
> >
> >
> Under 2.6.7-rc2-mm1 :
> root@Starbuck:/home/tyler>mknod /dev/test c 100 1000
> root@Starbuck:/home/tyler>ll /dev/test
> crw-r--r-- 1 root root 103, 232 Jun 2 17:07 /dev/test
>
> and under 2.4.26 that's the same.

Like I stated in my message, which you cut off:
Just make sure you have a up to date glibc.

I'm guessing that you do not have the most recent version of glibc on
your machine.

greg k-h

2004-06-02 18:04:16

by Manu Abraham

[permalink] [raw]
Subject: Re: Minor numbers under 2.6

On Wednesday 02 Jun 2004 6:49 pm, Greg KH wrote:
> On Wed, Jun 02, 2004 at 03:19:32PM +0400, Manu Abraham wrote:
> > Hi,
> > Can somebody clarify a question that i have ?
> >
> > Say under 2.4 kernel, char device drivers had a minor number of int. In
> > the 2.6 kernels, this number was increased to 20 bits from 8 bits. Under
> > 2.6 i could use "mknod -c major, minor".
> >
> > How can i achieve something similar with 2.6 taking into consideration
> > that i have to create more than 255 minors ?
>
> The same way:
> # mknod foo c 100 10000
> # ls -l foo
> crw-r--r-- 1 root root 100, 10000 Jun 2 07:48 foo
>
> Just make sure you have a up to date glibc.
>
> Hope this helps,
>
> greg k-h


Thanks a lot, I was breaking my head to understand what the hell was going
on.

Thanks again,

Regards,
Manu

2004-06-02 18:47:27

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: Minor numbers under 2.6

On Wed, 02 Jun 2004 07:49:31 PDT, Greg KH said:

> Just make sure you have a up to date glibc.

We don't currently require any specific glibc level:

% grep -i glibc /usr/src/linux-2.6.6-mm3/Documentation/Changes
%

Hmm... Should we make a note of the glibc level required to make this work?
Possibly as a "If you want to use more than 256 minors" optional?


Attachments:
(No filename) (226.00 B)