Sponsored Content
Operating Systems Linux Fedora Is Kernel module is the same as a device driver? Post 302520032 by Corona688 on Thursday 5th of May 2011 04:04:01 PM
Old 05-05-2011
Quote:
Originally Posted by newlinuxuser1
However how do you guys troubleshoot devices if there's no clear indication which driver does what?
It's not like windows where you install one specific driver and have to use that hardware for life or it'll try to reconfigure itself. Linux decides which drivers to load at runtime with little to no fuss. Build every possible driver into your kernel and nearly all the time it'll choose the correct drivers and ignore the rest. I've dubbed one linux installation onto another totally different computer and gotten it to boot with no change.

There's plenty of indication which driver does what if you've ever compiled your own kernel, most selectable driver options will tell you what hardware they apply to(usually the chipset, not a brand-name). And you can tell which ones got loaded on boot via lsmod. Drivers are also frequently a lot more generic than Windows ones; sometimes one driver can handle tons of devices. Like usb-storage(flash drives), linux-uvc(webcams, cameras), ahci(SATA disk controllers), and so forth.

If anything went wrong you can check the driver messages with dmesg. As long as your system has a working console and working disk drivers you can debug from there.

This works because plug-and-play devices include device ID's to tell you which driver to use. With rare exceptions* you can't use the wrong driver, Linux drivers know what ID's they ought to talk to. The kernel can choose intelligently which driver to load, on-the-fly. Sometimes when a new device comes out, all they need to update is the ID's for the old driver to successfully use new hardware.

These ID's are what things like lspci and lsusb look at to tell you what devices you've got plugged in. They just take the ID's and consult a giant text list to tell you. This also means you don't actually have to have the driver for lspci to tell you what they are, quite unlike Windows -- which is just plain lost without an applicable driver available and no direct way to get the PCI id to even look it up.
Quote:
You see in windows I have a chain to follow.
Yes, 1) download from manufacturer, 2) follow directions, 3) as a last resort Windows Update, or else 4) complain. None of these give you much real information.

* The Realtek 8139 is an annoying exception. There's two incompatible variants with the same PCI ID. One's handled by the 8139cp module, the other by the 8139too module. When it doesn't work it tells you in dmesg to load the other driver. Another exception is video hardware acceleration, very complicated and proprietary, but since that's not needed to boot, that at least can be troubleshooted. Another is sound, because there's 1238957102351 different sound devices with the same PCI ID of "intel/amd/nvidia high-definition audio". The alsa-config utility can tell them apart fortunately.

Last edited by Corona688; 05-05-2011 at 05:10 PM..
This User Gave Thanks to Corona688 For This Post:
 

4 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Kernel and Device Driver Programming

I am looking for a guide on how to program for either the Linux or FreeBSD (includes 4.4BSD, NetBSD or OpenBSD) kernel. I would prefer to learn how to write device drivers, but anything would help. If you know, please email me at *removed* or leave a post here Regards, Farhan (0 Replies)
Discussion started by: Farhan
0 Replies

2. Solaris

SUNWglmr -- rasctrl environment monitoring driver for i2c or SCSI device driver ?

I've been researching minimizeing Solaris 8 and found that on the web page http://www.sun.com/bigadmin/content/packagelist/s8u7PkgList/p2.html the package SUNWglmr is listed as "rasctrl environment monitoring driver for i2c, (Root) (32-bit)" while in the document "Solaris 8 minimize-updt1.pdf"... (1 Reply)
Discussion started by: roygoodwin
1 Replies

3. Linux

Linux Device Driver: avoid mem copy from/to user/kernel space

I recently started working with Linux and wrote my first device driver for a hardware chip controlled by a host CPU running Linux 2.6.x kernel. 1. The user space process makes an IOCTL call with pointer to a user memory buffer. 2. The kernel device driver in the big switch-case of IOCTL,... (1 Reply)
Discussion started by: agaurav
1 Replies

4. UNIX for Advanced & Expert Users

Get pointer for existing device class (struct class) in Linux kernel module

Hi all! I am trying to register a device in an existing device class, but I am having trouble getting the pointer to an existing class. I can create a class in a module, get the pointer to it and then use it to register the device with: *cl = class_create(THIS_MODULE, className);... (0 Replies)
Discussion started by: hdaniel@ualg.pt
0 Replies
All times are GMT -4. The time now is 01:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy