LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
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?

Notices



Reply
 
Search this Thread
Old 11-05-2012, 05:25 PM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Rep: Reputation: 86
how does hardware detection work


NOTE -- Other articles date from three or more years back... forever in internet time.

Can someone direct me to a details description of how linux hardware detection works? I need some understanding and lack the knowledge to read kernel and driver code and discover some details. Any help will be valuable and appreciated.

I run Linux Mint-12 (derived from Ubuntu 11.10) which is a Debian family distro so that you have more context. I know that each distro family has its own details.

I understand some behavior at the tree-top level:
  • power-on does hardware init; parts wake up
  • something causes some BIOS code to run
  • BIOS knows some and learns some hardware details
  • BIOS code loads first parts from boot device
  • first parts know some and learn some about hardware
  • "events" start dealing with found hardware
  • first parts load second parts from boot device
  • second parts add smarts to event processing
  • full system running -- devices come and go at end-user discretion

The "dynamic kernel module" process loads device drivers for found hardware. How do we get from HARDWARE_INIT to LOAD_MODULE( "moduleName" )?

Once loaded, do the events originate in the driver or does whatever loaded the driver throw the events when it see successful load and init completed?

I have hardware that works as advertised with win-dose, but that linux does not seem to grok well. (I get some behavior that is different, less, poor, on linux compared with win-dose.)

Lastly, if I must read about the kernel or boot loaders or elsewhere, can someone offer suggestions for recommended places to start? Are there blueprints or specs or similar before I start reading code?

Thanks in advance,
~~~ 0;-Dan
 
Old 11-07-2012, 11:53 AM   #2
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Original Poster
Rep: Reputation: 86
BUMP!!

Someone must have some reference or some knowledge about this topic.
Please throw this olde geek a bone (or pizza or beer or ...) so that
I can move forward with solving my problem.

~~~ 0;-Dan
 
Old 11-07-2012, 03:50 PM   #3
kinneyd
LQ Newbie
 
Registered: Oct 2011
Posts: 21

Rep: Reputation: Disabled
I'm afraid I'm no expert on the topic, but my understanding is udev is pretty much responsible for loading modules these days. Look at section 7.4.2.4.

http://www.linuxfromscratch.org/lfs/...er07/udev.html

Hope that is somewhat useful.
 
2 members found this post helpful.
Old 11-07-2012, 05:42 PM   #4
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Original Poster
Rep: Reputation: 86
What a great web site reference !!!

This is a classic case of you need to know enough to ask useful questions.
I had no idea that such a site existed.

Other LQ Readers: can you offer suggestions of more useful reading?

~~~ 0;-Dan
 
Old 11-08-2012, 07:41 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 11,446
Blog Entries: 4

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
Member Response

Hi,

Linux Kernel Interactive Map is a good map of the kernel to feel your way around. This gives a general overview for initialization.

Provide some insight to Dynamic Interrupt Request Allocation for Device Drivers that will help you understand overall device management.

Linux Device Drivers, Third Edition will help you to dissect or understand device drivers. Plus this book is a good desk reference.

Linux Signals for the Application Programmer a little sugar.

HTH!
 
1 members found this post helpful.
Old 11-08-2012, 02:36 PM   #6
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Original Poster
Rep: Reputation: 86
Quote:
Originally Posted by onebuck View Post
The Magic is in the Magician not the wand! ©
What is the origin of your signature quotation. I would guess Harry Potter©.

My avatar usually appears as Mickey Mouse™ in the Sorcerer's Apprentice©.
I know where the wizard keeps the hat, and I've learned how to swim and
clean up after any mess I create. (grin)

~~~ 0;-Dan
 
Old 11-08-2012, 02:40 PM   #7
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Original Poster
Rep: Reputation: 86
Quote:
Originally Posted by onebuck View Post
Hi,

Linux Kernel Interactive Map is a good map of the kernel to feel your way around. This gives a general overview for initialization.

Provide some insight to Dynamic Interrupt Request Allocation for Device Drivers that will help you understand overall device management.

Linux Device Drivers, Third Edition will help you to dissect or understand device drivers. Plus this book is a good desk reference.

Linux Signals for the Application Programmer a little sugar.

HTH!
Thanks for the reading references. Like much in this open community world, one needs some knowledge before one can ask reasonable questions. I have hopes for The Linux Documentation Project as a clearing house and go-to point to find 'yellowBrick==1' on the road to information.

If you know of other documentation collections, would you kindly mention those in a follow-up post?

Thanks,
~~~ 0;-Dan
 
Old 11-08-2012, 03:03 PM   #8
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Original Poster
Rep: Reputation: 86
I found the following article from 2009:
Intro to UDEV
that seems to offer a little light on the subject. Specifically:

Kernel Device Event Management
  • When bootup is initialized, the /dev directory is mounted in tmpfs.
  • After that, Udev will copy the static device nodes from /lib/udev/devices to the /dev directory.
  • The Udev daemon then runs and collects uevents from the kernel, for all the devices connected to the system.
  • The Udev daemon will parse the uevent data and it will match the data with the rules specified in /etc/udev/rules.d.
  • It will create the device nodes and symbolic links for the devices as specified in the rules.
  • The Udev daemon reads the rules from /etc/udev/rules.d/*.rules and stores them in the memory.
  • Udev will receive an inotify event, if any rules were changed. It will read the changes and will update the memory.
I hope to find something more recent. 2009 to 2012 is forever in Linux/internet time...

~~~ 0;-Dan

Last edited by SaintDanBert; 11-08-2012 at 03:14 PM. Reason: clarification
 
Old 11-08-2012, 03:05 PM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 11,446
Blog Entries: 4

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
Member Response

Hi,

Look at Slackware®-Links for useful links.

As to my sig 'The Magic is in the Magician not the wand! ©', I copyrighted that years ago. Been using it for a long time. Just a play on context of words to symbolize that man is the master visionary.

Last edited by onebuck; 11-08-2012 at 03:12 PM. Reason: typo & font errors
 
Old 11-08-2012, 03:17 PM   #10
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Original Poster
Rep: Reputation: 86
Re: Magic and wands and hats

I doff my hat (sic) to the way you think.

Cheers,
~~~ 0;-Dan
 
Old 11-17-2012, 12:56 AM   #11
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Original Poster
Rep: Reputation: 86
In some reading, somewhere, I remember finding that during the power-up and initial scans, some software creates and XML representation of all hardware found.

Where do I find documentation on this XML representation of hardware?


Is there a Document Type Definition or XML Schema for this hardware representation as XML?

Is the XML stored to disk somewhere that mortals can read it?

Is this the same XML one might see reading the output from lshw -xml?

Last edited by SaintDanBert; 11-17-2012 at 01:40 AM.
 
  


Reply


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
Test hardware? Slow boot up, difficult hardware detection, internet is slowing down. justinp526 Linux - Newbie 4 06-01-2011 11:36 PM
Hardware detection? dwarf007 Linux - Hardware 1 03-03-2005 11:01 AM
new hardware detection.... blind958 Mandriva 6 07-16-2004 01:43 PM
Hardware detection groovin Debian 12 03-16-2004 06:01 PM
hardware detection johncla Linux - Hardware 2 04-27-2002 07:31 PM


All times are GMT -5. The time now is 06:50 PM.

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