How to determine the port numbers for peripheral devices?

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
smwikipedia
Member
Member
Posts: 49
Joined: Tue Apr 20, 2010 1:11 am

How to determine the port numbers for peripheral devices?

Post by smwikipedia »

Hi, guys. This is my first thread here. And this place is awesome! So happy no to find this place too late.

I know that peripheral devices such as a hard driver, a floppy driver, etc are controlled by reading/writing certain control registers on their device controllers.

I am wondering about the following questions:

•Is it true that when these peripheral devices are plugged onto the computer, the addresses(port numbers) of their control registers are thus determined by how they are attached to the address bus (i.e. the hard-wiring rules, not any soft things)?
•Who makes the scheme of the port number assignment?
•If I was given a naked computer(with no operating system and with many peripheral devices), how could I figure out the port number assignment so I can use them to control peripheral deveices.

Thanks for your patience and reply. 8^)
Last edited by smwikipedia on Sun Apr 25, 2010 9:53 am, edited 1 time in total.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: How to determine the port numbers for peripheral devices

Post by Combuster »

There are three classes of devices: some devices use predefined ports and addresses, some are wired or jumpered, and some are plug-and-play. Most of the hardware present since the 386 is of the first kind, they are also the first things you'll use.
Every device that comes from the old age and was optional usually is of the second type (soundblasters etc), most newer stuff is plug-and-play, which means the BIOS assigns addresses to them so they don't overlap.

Basically, you'll need to know what kind of device you are dealing with to find out to what ports they respond.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply