Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

Major device number?

How can I know which major device number are occupied by the kernel, and which can be used by the programmer?

thanks.

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by 0quanquan0@Oct 18 2006, 08:57 AM

    how can i know which major device number are occupied by the kernel, and which can be used by the programmer?

    thanks.

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=18761)

    --- quote end ---

    --- Quote End ---

    linux-2.6.x/Documentation/devices.txt
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks you, hippo. I have found this file, but I am a little confused, I don&#39;t know how to find useful information in it, how can I find the major number I can used?

    And I have another question about register device driver:

    I am studying two examples of led driver, they use different register methods,

    one just uses the register_chrdev() function, but another uses devfs_register_chrdev(), devfs_mk_dir(), devfs_register() to finish register.

    Can you tell me the difference betweem them?

    thank you very much.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by 0quanquan0@Oct 18 2006, 11:39 AM

    thanks you, hippo. i have found this file, but i am a little confused, i don&#39;t know how to find useful information in it, how can i find the major number i can used?

    and i have another question about register device driver:

    i am studying two examples of led driver, they use different register methods,

    one just uses the register_chrdev() function, but another uses devfs_register_chrdev(), devfs_mk_dir(), devfs_register() to finish register.

    can you tell me the difference betweem them?

    thank you very much.

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=18764)

    --- quote end ---

    --- Quote End ---

    Look in ch3 of the (must have) book "Linux Device Driver 3rd ed."