Write USB driver: usb-skeleton.c, plug in USB keyboard, probe not called

Source: Internet
Author: User
Write USB driver: usb-skeleton.c, plug in USB keyboard, probe is not called-Linux general technology-Linux programming and kernel information, the following is read details. I want to find out how to write the USB driver. I want to write the driver for a specific device later. I will study it with a USB keyboard for the moment.

I use the system built-in usb-skeleton.c compiled into a module, compiled successfully, then loaded to the development board, loaded successfully.
The return value of usb-register is 0.

However, I plugged in the USB keyboard (and then tried the USB mouse and USB flash drive) and the three items could be used properly on the system.
However, the probe function is not called. I didn't do anything at the beginning of the function and wrote a printk statement. However, I didn't see that sentence after dmesg.

My doubt is: will it be a system with a usb driver, USB Mouse and other three are standard devices.
So, as soon as I plug in, I let the system take over, so that I loaded the usb-skeleton.o can not play a role.

I saw a document on the Internet and said I could delete it first. However, I found that lsmod does not have these things at all, so I want to install it myself.
An article says this: (here we only extract some)
Module configuration method

In many cases, our USB driver is not included in the kernel. In fact, we only need to load them one by one based on the modules it needs. You can enable it.
First, make sure that the corresponding support is selected in the module mode during kernel compilation. In this way, we can see the corresponding. o file in the/lib/modules/2.4.XX directory. When loading a module, we only need to run modprobe xxx. o. (modprobe mainly loads the modules that have been registered by the depmod system. insmod is generally used to load specific. o files)
It is critical to correspond to some modules under the USB device.
Usb core. o the most basic module required to support usb
Usb-uhci.o (already mentioned)
Usb-ohci.o (already mentioned)

However, I did not find these things in the system.
I am talking about the system on my development board.

Root @ beagleboard:/myfile/MAN/man-pages-3.32 # uname-
Linux beagleboard 2.6.32 #4 PREEMPT Thu Jan 27 17:08:08 CST 2011 armv7l unknown

I want to use these modules in UBUNTU on a virtual machine-UBUNTU has these modules loaded.
However, it cannot be loaded because the invalid module format is displayed.
I think the version is not correct.
UBUNTU is UBUNTU 8.04. the above version is 2.6.24.

So I started searching for these drivers in 2.6.32.
But I never looked for it.
Dare I compile a new system and extract it?

During this period, I rummaged through the HOWTO of TLDP and some other documents, but I did not find any other documents, even the content about USB was rare!

In addition, I cannot solve the USB problem. maybe I have gone through such a great path, but maybe I am still doing nothing. I am sure I can help anyone who has done this. thank you.
Related Article

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.