Find the answer to your Linux question:
Results 1 to 6 of 6
So now I have a driver similar to usb-skeleton.c.But I dont know how to remove the previous usb-storage module to test my new module on my usb drive. whnever I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! saurabh.nigam's Avatar
    Join Date
    Sep 2008
    Location
    Indiyah!
    Posts
    15

    How to test my usb skeketon driver


    So now I have a driver similar to usb-skeleton.c.But I dont know how to remove the previous usb-storage module to test my new module on my usb drive.
    whnever I plug-in my usb device dmesg shows active usb-storage module.Do I need to have the device of a specific name like /dev/skeleton.
    Your helps are welcome!

  2. #2
    Just Joined!
    Join Date
    Jul 2009
    Posts
    49

    use of the kernel module tools...

    If I understand your question, you need to use the command "rmmod" to remove the current kernel module so you can insert your own.

    You should acquaint yourself with the module tools modprobe, lsmod, insmod and rmmod before going much further and have a look at modprobe.conf or whichever system is being used by the kernel to manage the deployment of kernel modules.

    Cheers!!

  3. #3
    Just Joined! saurabh.nigam's Avatar
    Join Date
    Sep 2008
    Location
    Indiyah!
    Posts
    15
    Welll I removed usb-storage module using
    rmmod usb-storage
    but it loads automatically ech time device is plugged in & usb-skeleton even after inserting module doesn't gets device
    insmod usb-skeleton.ko
    I once also replaced usb-storage.ko by usb-skeleton.ko but then device doesnt even get detected.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jul 2009
    Posts
    49

    use of the module blacklist file

    You have to "blacklist" the usb-storage" module by using the modprobe.conf file. Have a look using "man modprobe.conf". You will see how to blacklist a particular module. This will prohibit the module from being loaded automatically. You can then use insmod to load your module.

    As I said before, you really should become acquainted with the kernel module's suite of tools if you are going to use write kernel modules.

    Cheers!!

  6. #5
    Just Joined! saurabh.nigam's Avatar
    Join Date
    Sep 2008
    Location
    Indiyah!
    Posts
    15

    Unhappy Problem testing usb-skeleton driver

    Well I blacklisted usb-storage module.Iam still having problems testing the code usb-skeleton.c.
    I am inserting usb-skeleton module as
    Code:
    insmod usb-skeleton.ko
    but then when i lsmod the module is used by 0.
    that means it cannot get the device.
    Do I need to craete device entry something like
    Code:
    # mknod -m 666 /dev/skeleton c 32 0
    The usb-skeleton.c I am having is @linuxhq.com/kernel/ v2.6/32/drivers/usb/usb-skeleton.c"]usb-skeleton.c
    Do I really need to assign a specific device >pls help

  7. #6
    Just Joined!
    Join Date
    Jul 2009
    Posts
    49

    use of mknod

    I wouldn't worry that it is currently showing as being used by 0. That number refers to the other modules that are dependent upon it. Since it has no services to offer, no one would be connected to it.

    The use of mknod is (I believe) restricted to character or block devices At this point you probably don't need them. You really need to read up on device drivers. Do you know what kind of device you are creating? There are 3 basic types, Character, Block and Network with USB having come along and creating a 4th type. I am not acquainted with how they are connected to.

    I would suggest either buying or finding on the net the O'Reilly book "Linux Device Drivers" 3rd edition by Corbet, Rubini and Kroah-Hartman (My their names ever be exalted). You can find the book published on the net if you look. It will tell you everything you need to know.

    Cheers!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •