ComputerForum.com ComputerForum.com  

Go Back   Computer Forum > Computer Software > Operating Systems

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-31-2009, 08:39 PM   #1
Bit Member
 
Join Date: Dec 2009
Posts: 5
Default How does OS detect hardware?

I've never been able to figure out how operating systems detect the hardware they're hooked up to. Google searching has so far been futile. Does the OS send a signal through all the buses asking for identification? This is important since I'm building a computer from scratch.
Maxwellius is offline   Reply With Quote
Sponsored Links
Old 12-31-2009, 08:48 PM   #2
Petabyte Member
 
tremmor's Avatar
 
Join Date: Oct 2007
Location: Mich
Age: 67
Posts: 6,017
Default

Good question. I did a little checking with Bing and came up with this for plug and play devises. http://technet.microsoft.com/en-us/l...8WS.10%29.aspx
tremmor is online now   Reply With Quote
Old 12-31-2009, 08:54 PM   #3
Bit Member
 
Join Date: Dec 2009
Posts: 5
Default

I mean like when my system boots up, the BIOS detects my hardware, displays a menu on my screen, and asks me what media I want to boot from. How does it know I have a monitor and a keyboard and a hard drive?
Maxwellius is offline   Reply With Quote
Old 12-31-2009, 10:19 PM   #4
banned
 
Join Date: Dec 2009
Location: Planet Earth
Age: 24
Posts: 3,035
Default

When your OS is turned on,as soon as you plug any devices in,it detects them automatically.The reason is simple.The OS is programmed that way so it detects all the new devices and automatically installs the proper drivers that Microsoft included in the OS itself.All those error messages,information messages,warning messages,balloon tips....blabla....which you get while connecting the hardware to your computer you get again for the same reason....Microsoft programmed the OS that way and when you make the hardware change,the programmed code from the OS is executed in order to make what it should make wether if it installs the simple USB stick,new HDD,new monitor and so on......Some OS components even use the timer so they can scan for hardware changes every second or every 10 seconds or every minute or however they decided to make it.
In short...EVERY SINGLE thing that you use and see in your OS contains the programming code which executes when needed and therefore makes what it should make.Here is a small example:

You have a window with bunch of options.You adjust all those options just the way you want them and then you click the OK button which APPLIES ALL THOSE OPTIONS and also CLOSES the window.Now...that OK button seems very simple.You KNOW you must click it and after you do,the window is closed immediately.BUT what you do not see is the HUGE programmed code behind that button.By clicking that OK button,a LOT of programming code is executed and it makes what it should make.Wether if it saves some text,check box state,radio button state,all their functions and so on.In short...there is A LOT of code that one OS contains.A LOT...

As for the keyboard and the monitor,as soon as the BIOS has fully loaded,it automatically points to the BOOT SECTOR on the HDD which tells the BIOS what to start loading.Wether should he start loading some OS such as XP,Vista,some DOS program or whatever you are trying to load...
Your monitor and the keyboard WORK because the OS automatically starts loading their drivers as soon as it starts booting.So while the OS is booting up,during the boot up process they load ALL the neccessary drivers so that your devices could work properly after the OS is fully loaded.Wether if its the monitor,keyboard,mouse and so on...

Usually the drivers are located under the: "C:\WINDOWS\system32\drivers\"
There are few more places where the drivers are located.It depends of course on the driver itself and where that driver has installed its neccessary files.

One more important thing is the REGISTRY.EVERY SINGLE installed hardware and its drivers writes their informations into the Windows registry.This is very important so that the OS KNOWS that you have those hardware drivers installed and therefore it can start loading them on the boot up process...
If you just have the drivers,but their informations are NOT written into the Windows registry,the hardware drivers will not work then because the OS will not know that you have those hardware drivers at all and of course it wont use them and the OS will act like you dont have that hardware devices plugged into your computer...
The registry file called "system" contains most of the hardware drivers informations and it can be located under the: "C:\WINDOWS\system32\config\system"



Cheers and happy new 2010. year everyone!!!

Last edited by S.T.A.R.S.; 12-31-2009 at 10:33 PM.
S.T.A.R.S. is offline   Reply With Quote
Old 01-01-2010, 12:51 AM   #5
Bit Member
 
Join Date: Dec 2009
Posts: 5
Default

First of all, I'm running Linux. You can't just assume people use Windows.

Second of all, I'm not talking about the OS specifically. My BIOS does a great job at telling what sort of hardware I have, and I'm sure it doesn't have every type of driver hard-coded into a tiny little ROM chip. Does the manufacturer of the motherboard rig it up to talk to all the other hardware? On my little Z80 single-board computer I'm making, I'm just using a 2-port PIO chip. I can hard-code my processor to deal with only that chip. But on modern computers, it's much more complicated, and I can't quite figure out how Linux or my BIOS or whatever figures out what hardware I have installed even before it tries to interface with it.
Maxwellius is offline   Reply With Quote
Old 01-01-2010, 01:47 AM   #6
Gigabyte Member
 
zombine210's Avatar
 
Join Date: Feb 2009
Location: TX, usa
Posts: 1,359
Default

interesting, but i don't know,

first i thought you were talking about the HAL, but i think that's windows specific.

also, it might have to do with the motherboard's chipset collecting this data. each chipset can only recognize certain hardware, that's why you can't use a pentium IV on a PIII motherboard.

also, each micro controller has it's own assembly language instruction set. the os must somehow know this language to be able to operate it. that's why when you chose a distro, you download the one for your particular cpu: i386, i486, x86.

i didn't know there was a linux distro to run on a z80, interesting.

please post back when you finish this project, i have an old gameboy that uses this chip.
__________________
Laptop: Acer Aspire 5732Z / Intel Pentium T4400 / 4GB DDR2-667 / Intel GMA 4500M
Gaming Rig: DFI LP DK X38-T2R / C2Q Q9550 / 8GB G.Skill DDR2-1066 / Saphire HD6870
FileServer: Super Micro C2SBC-Q / C2D E8400 / 4GB G.Skill DDR2-800 / 4x 1TB HDDs
zombine210 is offline   Reply With Quote
Old 01-01-2010, 02:25 AM   #7
Bit Member
 
Join Date: Dec 2009
Posts: 5
Default

Sorry, the computer I'm building is different from the computer I plan on using. It's just a tiny little experiment. Anyways, I think I figured it out. The manufacturer puts a chipset on the motherboard that interfaces the front-side bus, which connects the CPU to the rest of the computer, with the main memory and all the peripherals, like the hard drive I'm booting off of. So the motherboard, not the BIOS, has to figure out how to talk to the hardware.
Maxwellius is offline   Reply With Quote
Old 01-01-2010, 01:15 PM   #8
banned
 
Join Date: Dec 2009
Location: Planet Earth
Age: 24
Posts: 3,035
Default

Quote:
Originally Posted by Maxwellius View Post
So the motherboard, not the BIOS, has to figure out how to talk to the hardware.
Hehehe now you know why its almost impossible to work with newest hardware components which are connected to the 20 years old motherboard.
It's like you want to install Windows 95 on today's modern computers. ^^
S.T.A.R.S. is offline   Reply With Quote
Old 01-01-2010, 01:30 PM   #9
Kilobyte Member
 
canivari's Avatar
 
Join Date: Dec 2009
Location: Jersey UK
Age: 33
Posts: 486
Default

In these days allmost all hardware cames with plugand play Bios inside of it
When u power up your pc, the bios usually send echo requests to the chipset and chipset
send the message to all plug and play hardware asking theyre capability,size,heads,cilinders,
capacty,etc (i think u got the point) and each hardware send theyre especifications and where they are located.
Bios reserves then an adress for each component so it can be used later
from the OS booted up.
In devices that are not plug and play like old printers that usually are conected
from LPT or RS232, u ned to install them later inside the OS manually.
And for what i could read in the thread, u are running Linux, and in Linux operates with hardware from the Kernel it self, in windows is
used what we call an driver.
Hope that helps.
__________________
Dual QuadCore Xeon E5405
8 GB DDR2 667Mhz FB
Windows 7 (36 Bits version hehe...) Ultimate
Board Super-micro X7DVL-E
HDD 150GB Raptor 10K 16MB cache
HDD 500GB Seagate 7.2K 16MB cache
HDD 320GB WD 7.2K 16MB cache
Rig Thermaltake M9
PSU Alpha-Power 850W v.2.2
4X3 Viewsonnic 19'

Last edited by canivari; 01-01-2010 at 02:01 PM.
canivari is offline   Reply With Quote
Old 01-01-2010, 02:13 PM   #10
banned
 
Join Date: Dec 2009
Location: Planet Earth
Age: 24
Posts: 3,035
Default

Quote:
Originally Posted by canivari View Post
In these days allmost all hardware cames with plugand play Bios inside of it
When u power up your pc, the bios usually send echo requests to the chipset and chipset
send the message to all plug and play hardware asking theyre capability,size,heads,cilinders,
capacty,etc (i think u got the point) and each hardware send theyre especifications and where they are located.
Bios reserves then an adress for each component so it can be used later
from the OS booted up.
In devices that are not plug and play like old printers that usually are conected
from LPT or RS232, u ned to install them later inside the OS manually.
And for what i could read in the thread, u are running Linux, and in Linux operates with hardware from the Kernel it self, in windows is
used what we call an driver.
Hope that helps.
I agree with everything you said here.
S.T.A.R.S. is offline   Reply With Quote

Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hardware ID extractor mashter77 Computer Memory and Hard Drives 2 12-09-2009 11:44 PM
INTEL Q9300 CPU VT-x VT-d Disabled Hardware Virtualization Problem eurusd CPUs and Overclocking 2 08-29-2009 12:07 AM
hardware found new installation w/ xp pro tremmor Operating Systems 3 04-17-2009 09:55 PM
Activating windows after reinstallation: The Point-System PC Hobbyist Operating Systems 9 10-07-2006 09:52 AM


All times are GMT +1. The time now is 04:16 PM.


Powered by: vBulletin Version 3.8.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.
Copyright © 2002-2014 Computer Forum