Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I am a newbie in linux USB drivers. I'm trying to run dummy_hcd with g_zero and g_file_storage in my linux whose kernel version is 2.6.33.3-85.fc13.i686.PAE. I have downloaded the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    5

    [SOLVED] Help needed regarding dummy_hcd driver


    Hello,

    I am a newbie in linux USB drivers. I'm trying to run dummy_hcd with g_zero and g_file_storage in my linux whose kernel version is 2.6.33.3-85.fc13.i686.PAE.

    I have downloaded the kernel source (version 2.6.35.1). I have configured this version of kernel to use dummy_hcd, g_file_storage and g_zero.

    --Snip from .config --
    CONFIG_USB_GADGET=m
    CONFIG_USB_GADGET_DEBUG=y
    CONFIG_USB_GADGET_DEBUG_FILES=y
    CONFIG_USB_GADGET_DEBUG_FS=y
    CONFIG_USB_GADGET_VBUS_DRAW=2
    CONFIG_USB_GADGET_SELECTED=y
    # CONFIG_USB_GADGET_AT91 is not set
    # CONFIG_USB_GADGET_ATMEL_USBA is not set
    # CONFIG_USB_GADGET_FSL_USB2 is not set
    # CONFIG_USB_GADGET_LH7A40X is not set
    # CONFIG_USB_GADGET_OMAP is not set
    # CONFIG_USB_GADGET_PXA25X is not set
    # CONFIG_USB_GADGET_R8A66597 is not set
    # CONFIG_USB_GADGET_PXA27X is not set
    # CONFIG_USB_GADGET_S3C_HSOTG is not set
    # CONFIG_USB_GADGET_IMX is not set
    # CONFIG_USB_GADGET_S3C2410 is not set
    # CONFIG_USB_GADGET_M66592 is not set
    # CONFIG_USB_GADGET_AMD5536UDC is not set
    # CONFIG_USB_GADGET_FSL_QE is not set
    # CONFIG_USB_GADGET_CI13XXX is not set
    # CONFIG_USB_GADGET_NET2280 is not set
    # CONFIG_USB_GADGET_GOKU is not set
    # CONFIG_USB_GADGET_LANGWELL is not set
    CONFIG_USB_GADGET_DUMMY_HCD=y
    CONFIG_USB_DUMMY_HCD=m
    CONFIG_USB_GADGET_DUALSPEED=y
    CONFIG_USB_ZERO=m
    # CONFIG_USB_AUDIO is not set
    # CONFIG_USB_ETH is not set
    # CONFIG_USB_GADGETFS is not set
    # CONFIG_USB_FUNCTIONFS is not set
    CONFIG_USB_FILE_STORAGE=m
    CONFIG_USB_FILE_STORAGE_TEST=y
    CONFIG_USB_MASS_STORAGE=m
    # CONFIG_USB_G_SERIAL is not set
    # CONFIG_USB_MIDI_GADGET is not set
    # CONFIG_USB_G_PRINTER is not set
    # CONFIG_USB_CDC_COMPOSITE is not set
    # CONFIG_USB_G_NOKIA is not set
    # CONFIG_USB_G_MULTI is not set
    # CONFIG_USB_G_HID is not set
    # CONFIG_USB_G_WEBCAM is not set
    ---snip---

    With this configuration, I was able to successfully generate the dummy_hcd.ko file. However, on loading dummy_hcd.ko module using 'modprobe' command, I was getting below error:

    ---snip of dmesg command---
    dummy_hcd: version magic '2.6.35.1 SMP mod_unload 686 ' should be '2.6.33.3-85.fc13.i686.PAE SMP mod_unload 686 '
    ---snip--

    This might be because the kernel version running on my PC is different from the one for which I build the dummy_hcd.ko.

    ---snip of 'uname -r' command---
    2.6.33.3-85.fc13.i686.PAE
    ---snip---

    ---snip of "modinfo dummy_hcd" command---
    filename: /lib/modules/2.6.33.3-85.fc13.i686.PAE/kernel/drivers/misc/dummy_hcd.ko
    license: GPL
    author: David Brownell
    description: USB Host+Gadget Emulator
    srcversion: DD000259101D8067A037298
    depends:
    vermagic: 2.6.35.1 SMP mod_unload 686
    ----snip---

    In order to resolve this error, I have modified the Makefile of Version 2.6.35.1 as

    From:
    ---snip of Makefile---
    VERSION = 2
    PATCHLEVEL = 6
    SUBLEVEL = 35
    EXTRAVERSION = .1
    NAME = Sheep on Meth
    ---snip---

    To:

    ---snip of Makefile ---
    VERSION = 2
    PATCHLEVEL = 6
    SUBLEVEL = 33
    EXTRAVERSION = .3-85.fc13.i686.PAE
    NAME = Sheep on Meth
    ---snip---

    After doing above modification, I was not getting version magic error. However, on loading this module, kernel hangs after sometime with the following message:

    Unable to handle kernel NULL pointer dereference at (null)


    Message from syslogd at Sep 14 17:30:32 ...
    kernel:Oops: 0000 [#1] SMP

    Message from syslogd at Sep 14 17:30:32 ...
    kernel:last sysfs file: /sys/devices/pci0000:00/0000:00:1d.2/usb4/devnum

    Message from syslogd at Sep 14 17:30:32 ...
    kernel:Process modprobe (pid: 28166, ti=dc8ba000 task=d6af0cc0 task.ti=dc8ba000)

    Message from syslogd at Sep 14 17:30:32 ...
    kernel:Stack:

    Message from syslogd at Sep 14 17:30:32 ...
    kernel:Call Trace:

    Message from syslogd at Sep 14 17:30:32 ...
    kernel:Code: 00 e9 6f 01 00 00 b8 c4 3c 98 c0 31 f6 e8 e3 b4 31 00 89 d9 ba 01 00 00 00 b8 e4 3c 98 c0 e8 5a 03 ff ff eb 0a 8b 83 58 01 00 00 <ff> 14 b0 46 3b b3 5c 01 00 00 72 ee 8b 83 d4 00 00 00 85 c0 0f

    Message from syslogd at Sep 14 17:30:32 ...
    kernel:EIP: [<c0466604>] sys_init_module+0x88/0x1dc SS:ESP 0068:dc8bbfa4

    Message from syslogd at Sep 14 17:30:32 ...
    kernel:CR2: 0000000000000000


    ---snip (dmesg) ---

    BUG: unable to handle kernel NULL pointer dereference at (null)
    IP: [<c0466604>] sys_init_module+0x88/0x1dc
    *pdpt = 000000001e202001 *pde = 000000001c96c067 *pte = 0000000000000000
    Oops: 0000 [#1] SMP
    last sysfs file: /sys/devices/pci0000:00/0000:00:1d.2/usb4/devnum
    Modules linked in: dummy_hcd(+) snd_usb_audio snd_hwdep snd_usb_lib snd_rawmidi fuse sunrpc p4_clockmod ipv6 uinput snd_intel8x0 snd_ac97_codec b44 ac97_bus ssb snd_seq ppdev parport_pc iTCO_wdt snd_seq_device mmc_core parport iTCO_vendor_support snd_pcm i2c_i801 snd_timer mii snd soundcore microcode snd_page_alloc i915 drm_kms_helper drm i2c_algo_bit i2c_core video output [last unloaded: scsi_wait_scan]

    Pid: 28166, comm: modprobe Not tainted 2.6.33.3-85.fc13.i686.PAE #1 0888h/HP d220 MT(DK829A)
    EIP: 0060:[<c0466604>] EFLAGS: 00010213 CPU: 0
    EIP is at sys_init_module+0x88/0x1dc
    EAX: 00000000 EBX: e001fac8 ECX: 00000000 EDX: 00000001
    ESI: 00000000 EDI: 002d51d6 EBP: dc8bbfac ESP: dc8bbfa4
    DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
    Process modprobe (pid: 28166, ti=dc8ba000 task=d6af0cc0 task.ti=dc8ba000)
    Stack:
    b7839008 00000001 dc8ba000 c0782bdc b7839008 0003b57f 09ebb3a8 00000001
    <0> 002d51d6 bff41f58 00000080 0000007b 0000007b 00000000 00000033 00000080
    <0> 00110416 00000073 00000246 bff41ecc 0000007b 00000000 00000000
    Call Trace:
    [<c0782bdc>] ? syscall_call+0x7/0xb
    Code: 00 e9 6f 01 00 00 b8 c4 3c 98 c0 31 f6 e8 e3 b4 31 00 89 d9 ba 01 00 00 00 b8 e4 3c 98 c0 e8 5a 03 ff ff eb 0a 8b 83 58 01 00 00 <ff> 14 b0 46 3b b3 5c 01 00 00 72 ee 8b 83 d4 00 00 00 85 c0 0f
    EIP: [<c0466604>] sys_init_module+0x88/0x1dc SS:ESP 0068:dc8bbfa4
    CR2: 0000000000000000
    ---snip---

    Please guide me how to solve above problem. Am I missing some steps or doing something wrong?

    Any kind of help would be appreciated.

    Thanks and Regards
    Meetu

  2. #2
    Just Joined!
    Join Date
    Aug 2010
    Posts
    5
    The above problem has been solved. I was trying to load the dummy_hcd.ko driver built for kernel version 2.6.35.4 into kernel version 2.6.33.3-85.fc13.i686.PAE that was running on my PC. Instead I have to built and install the kernel 2.6.35.4 itself before loading the drivers built for this version.

Posting Permissions

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