LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-22-2010, 05:38 PM   #1
siavashgh
LQ Newbie
 
Registered: Dec 2010
Posts: 13

Rep: Reputation: 0
Question How installers detect hardwares?


Hi,

We know that each OS has it's own installer which takes care of installation process. The first step in any installation process is detecting the system platform architecture and hardwares such as CPU, RAM, VGA, Mouse, Keyboard, Hard Disk,... so it can act based on system configuration and do a clean install, now my question is: "How an installer can do this for the first time?".

I another word: "How lspci/hwinfo/prtconf/kudzu/... can gather those amount of information about hardwares?" (Yes! all of these commands will read some files for gathering those informations! but I need to know who and how created those files)


P.S:
1- Note that, if we have a binary which compiled for a X86 architecture then it won't work on a Sparc system!
2- OpenSolaris can do that!

Thanks you
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 12-22-2010, 08:15 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
It is the Linux kernel that detects and initialises the hardware when the system is booted. You can see the results of this in the output of 'dmesg'.
As the kernel boots it builds the /proc and /sys directories. (If you look at these directories in an unmounted file system you will see they are empty.) Tools like 'lspci' get their information from these directories and present them in a more human readable format.
Installer kernels are compiled with support for a wide range of hardware builtin. Once you have completed an install, you can compile a kernel that contains support just for the hardware you have. This makes for a smaller kernel and removes the possibility of some hardware being incorrectly identified. It is also possible to build a kernel with minimal hardware support and have that kernel load modules to support your hardware.

P.S. I do not understand your P.S.
 
2 members found this post helpful.
Old 12-23-2010, 03:32 AM   #3
siavashgh
LQ Newbie
 
Registered: Dec 2010
Posts: 13

Original Poster
Rep: Reputation: 0
Thank you allend,
So you mean: "Kernel does all of this!" (and YES, you are right).

Now I just wanna know, HOW?
I mean: "How kernel detects a hardware?" (The mechanism / which part of the kernel?)
Does it have a Database with signature of all (detectable) hardwares? or there is other ways?


Sorry if I couldn't ask my question brightly, I just couldn't get why Kernel can detect many parts so quick but it's infirm in detecting Dial-UP Modems and many Graphic cards! and if it's the kernel which will take care of hardware detection so, why Ubuntu can detect more hardwares than Fedora!
 
Old 12-23-2010, 05:28 AM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
The detail that you want is within the kernel source code and I must confess that I am not an expert in any way.
Devices that connect to the PCI bus provide a standard structure that can be queried for information such as the vendor and product identification code. The kernel code can read these values and associate appropriate drivers.

The problem with serial line dial-up modems is that they do not provide such standard information. There are also problems with other devices such as graphic cards as they may be generic clones that are not exact copies. Audio chips can have many possible inputs and outputs that can be wired in different ways by manufacturers to suit their board layouts. Newer monitors contain EDID information that can be queried so that the connecting PC can get the monitor capabilities, but older CRT monitors may not have this. Newer widescreen monitors may provide incomplete information on their capabilities in their EDID.

Ubuntu is renowned for being good at supporting hardware. This is partly by design as Ubuntu aims to be a very user friendly distribution. It also has a large user base, so it can widely sample the possible hardware space.
Support for some hardware can involve the use of proprietary drivers. Some distributions take a stricter view of the open source philosophy and do not provide binary code that does not have open source.
 
2 members found this post helpful.
Old 12-23-2010, 05:46 AM   #5
siavashgh
LQ Newbie
 
Registered: Dec 2010
Posts: 13

Original Poster
Rep: Reputation: 0
Thank you very much allend, I got the point.

Does anybody know which parts of the kernel involve in hardware detection?
(Any tips or suggestions would be greatly appreciated, I just need a Clue )
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
list of hardwares compatible with upuntu linux sadasivam Ubuntu 2 05-18-2010 04:23 AM
linux supporting most hardwares jestinjoy Linux - Hardware 1 02-25-2008 12:34 PM
Recommend me Linux Hardwares anindyanuri Linux - Hardware 7 12-10-2006 04:45 PM
witch hardwares are compatible with linux? samba4010 Linux - Hardware 2 03-10-2006 07:27 AM
Detecting hardwares anirudh.dp Linux - Newbie 2 10-09-2004 06:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:33 AM.

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
Open Source Consulting | Domain Registration