Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where do the serial port addresses come from?

Status
Not open for further replies.

wookie2

Programmer
Mar 23, 2004
6
0
0
GB
Hey!

After POST, BIOS is writing serial port addresses to 0040:0000. I need to know how it gets to know these adresses, to write a protected mode program (0040:0000 inaccesible) that does the same. Or are the addresses always the same (3f8 - COM1, 2f8 - COM2, 3e8 - COM3 and 2e8 - COM4)? And how does BIOS check the status of the port (to put 0 in 0040:000x if it's not available)?

Thanks for any help :).
 
as far as i know com port addresses are really the same all the time, and the data on their usage are stored in bios data area, i guess. but i'm a bit puzzled why a particular segment (0000 in this case is inaccesible? what platform is ur protected mode program? is it windows or a kind of PM mem manager?
 
Hello,
port addresses used to be hard wired on the bus so they are always the same address. more recently they can be setup using cmos but they still remain the same due to convention.

you need to look at how your TSS has been configured for your protected mode program. port access can be inhibited and i suspect this may be the cause. if you are accessing the ports via RAM you need to turn of the cache which is also a setting in CR0 bit 30 called CD (Cache Disable).

hope this helps, good luck!
straiph


"There are 10 types of people in this world, those who know binary and those who don't!"
 
also, in protected mode you need to ensure you have a valid data segment configured in your GDT or LDT.

0040:0000 is a real mode segmented address and if used in protected mode will cause exception 13 #GP if segment 0040 hasnt been setup correctly.

if you want to know more about protected mode segmented addressing the Intel manuals are a dead good read. see FAQ.

good luck!
straiph

"There are 10 types of people in this world, those who know binary and those who don't!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top