hi Greg: I just want to understand the interactions of the bus, device and driver, since I am tracing the ehci host controller driver right now and still confused with them even I read Ldd3. The kernel version I used is 2.6.16.1. By the way, would you please tell me where can I get any document about uevent, the callback entry located at bus_type and how to correctly read the kernel panic message? appreciate your help, vichy 2007/11/18, Greg KH <greg@xxxxxxxxx>: > On Sun, Nov 18, 2007 at 12:50:48AM +0800, vichy wrote: > > Dear all: > > I modified the lddbus sample bus driver in ldd3 as the attach file. > > 1. I add bus, ldd_bus_type, in ldd_bus. > > 2. I add device_driver, ldd_bus_driver, in ldd_bus. > > 3. then call device_register(&ldd_bus) > > The module can been successfully compiled, but the kernel panic will > > show while insert the module. > > (the kernel is dead totally such that I cannot attach the kernel log > > file. BTW, will someone tell me how to dump this kind of log?) > > > > I even try device_add(&ldd_bus), as I marked in the source code but it > > still fail. > > This inspiration comes from usb-host contrller driver. > > ( The usb hub device is allocated and initialized the bus and > > device_driver by usb_alloc_dev located at core/usb.c. > > Then it call device_add (&udev->dev) at usb_new_device located at core/hub.c) > > > > Could someone tell me where it goes wrong? > > Lots of things have changed in the driver core since that file was written. > > What kernel version are you trying to build this sample bus driver for? > > If needed, I could probably fix it up to work on the latest kernel > version, I guess it would be a good idea just to document this mess... > > Are you wanting to write your own bus driver code? Or just trying to > understand the interactions of the bus code in the kernel? > > thanks, > > greg k-h > -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ