Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9274989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:28:58+00:00 2026-06-18T16:28:58+00:00

I am learning linux device driver development and created the code of a basic

  • 0

I am learning linux device driver development and created the code of a basic kernel module which creates a pseudo char device.
That module got compiled and inserted too..
When I did lsmod the result was like this

 Module                 Size   Used by
modeldriver             2540    0 

what does that number indicate? what is meant by size of the module?
And what is the maximum value of major and minor numbers in linux?
Where can I get to know about the values of linux kernel 2.6.37

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:29:00+00:00Added an answer on June 18, 2026 at 4:29 pm

    1.
    “Size” is the amount of memory the kernel module occupies, that is, the size of code, data and probably some special sections of the module loaded to memory. Note that the memory allocated dynamically by the module itself is not included there.

    2.
    As for the major/minor numbers, it is better not to rely on the particular limits. If you need to reserve such numbers for your character devices, for example, you can use alloc_chrdev_region().

    From the definitions of MAJOR(), MINOR() and MKDEV() in <linux/kdev_t.h>, it follows that 12 bits are used to encode a major number (0..4095, it seems), 20 bits – for the minors. Section “The Internal Representation of Device Numbers” of chapter 3 of “The Linux Device Drivers” book (3rd ed.) confirms that too:

    As of Version 2.6.0 of the kernel, dev_t is a 32-bit quantity with 12 bits set aside for the major number and 20 for the minor number. Your code should, of course, never make any assumptions about the internal organization of device numbers; it should, instead, make use of a set of macros found in linux/kdev_t.h

    If you have not done so already, I would recommend taking a look at Linux Device Drivers book mentioned above. While a bit outdated in some places, it is still very useful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning about the blocking I/O functions for writing linux device driver and I'm
I'm learning the Linux kernel and reading the book The Linux Kernel . Can
Learning some VBA. So far, I've constructed this piece of code which should allow
I learning Objective-C in Linux(Ubuntu), but when i tryed to compile my application that
I'm currently learning c++ on a linux machine. I've got the following code for
I am learning how to write device drivers for linux, and I have a
I'm learning the linux kernel internals and while reading Understanding Linux Kernel, quite a
I am just learning how to modify the linux kernel. I am using gdb
I am learning Linux module programming. I work on Ubuntu 12.04. I made a
I am learning linux programming and came across exec function which is kind of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.