Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?


  Search this Thread
Old 05-07-2013, 07:11 AM   #1
LQ Newbie
Registered: May 2013
Posts: 1

Rep: Reputation: Disabled
How Linux Kernel Understands Which Driver it should load for a specific hardware?

Sorry for newbie question!
Actually after more than 10 years of using Linux and even developing several linux kernel drivers, when I ask this question from myself, still I can't give a clear answer to it.

In a fairly new Kernel, 3.0 or newer,

Suppose you have a usb device.
And a bunch of .ko drivers in /lib/modules folder.

You attach the usb device to your system.

How does the linux mechanism decides which USB driver it should load into the kernel?

So, the driver gets loaded before an event get dispatched to udev.
I want to know who is loading the driver?

Old 05-07-2013, 01:43 PM   #2
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 12,758
Blog Entries: 27

Rep: Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079Reputation: 2079
Member Response


Welcome to LQ!

Linux Kernel Interactive Map is good resource with link referenced topics. Map is zoom-able and you can direct link to expanded reference by hovering mouse cursor to get a link to open informational link. Great visual reference for Kernel dissection & understanding. provides;
excerpt from "Inside the Linux boot process" (developerWorks, May 2006) explores the Linux boot process from the initial bootstrap to the start of the first user-space application;

When the second-stage boot loader is in RAM and executing, a splash screen is commonly displayed, and Linux and an optional initial RAM disk (temporary root file system) are loaded into memory. When the images are loaded, the second-stage boot loader passes control to the kernel image and the kernel is decompressed and initialized. At this stage, the second-stage boot loader checks the system hardware, enumerates the attached hardware devices, mounts the root device, and then loads the necessary kernel modules. When complete, the first user-space program (init) starts, and high-level system initialization is performed.
That's Linux boot in a nutshell. Now let's dig in a little further and explore some of the details of the Linux boot process.
I like IBM's Technical library for in-depth detailed information for Linux & Gnu/Linux. Great White papers!

Above links are from Slackware®-Links ! More than just Slackware links.
Old 05-07-2013, 10:17 PM   #3
Registered: Mar 2008
Posts: 16,646

Rep: Reputation: 2444Reputation: 2444Reputation: 2444Reputation: 2444Reputation: 2444Reputation: 2444Reputation: 2444Reputation: 2444Reputation: 2444Reputation: 2444Reputation: 2444
A very simple statement would be that host os and hardware usb function watches for some change. Then it asks the usb what it is. The usb would report the type of device along with specific chipset and vendor id. There is some more usb data but to make it simple let's stop there. Then that data is compared to available support usually it has to directly match some device by name and vendor and chip id. If match then it is loaded.

The answer could get quite complex if you really want to know the nuts and bolts of the process.

Reference resources would include usb hardware and software specifications.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
is there a hardware specific kernel builder tool? gtludwig Slackware 5 11-24-2012 12:25 PM
[SOLVED] Kernel --> load only a specific module lfs_mm Linux - Kernel 2 11-17-2011 03:37 AM
How to load a specific device driver hasmak Linux - Newbie 11 01-02-2009 01:07 PM
CentOS 5.2 Linux Kernel 2.6.18-92.1.10.el5 - Cannot Load e1000e driver jreige Linux - Hardware 1 09-18-2008 12:57 PM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration