Page 1 of 1

Ports?

Posted: Thu Jun 24, 2004 11:39 am
by Roman
Im a lil bit confused cause I?ve been reading lots and lots of documents on OS-creating.. but there?s a part I dont understand...they are often talking about "ports" using commands as "out" and "in"... what is a port and what is it for? I dont need no long explanation of how to use them I just wanna know what they are.. and are commands such as out and in built in assembler?

Re:Ports?

Posted: Thu Jun 24, 2004 11:53 am
by Solar
Yes, in and out are assembler commands used for addressing memory mapped I/O devices. (See Intel SDM, Volume 3...)

Re:Ports?

Posted: Thu Jun 24, 2004 1:31 pm
by pini
Ports are directly mapped into memory and are connected to a device.

For example, the keyboard controller is accessed using ports 0x60 and 0x64, this means that when you write/read to/from these ports (using out and in), you don't get data from the memory, but directly from the concerned device (here the keyboard controller).

Ports are used to dialog with any kind of device (keyboard, mouse, floppy drive, hard disk drive, real time clock, etc...).

Re:Ports?

Posted: Thu Jun 24, 2004 10:09 pm
by Solar
Oh, yes, one more thing: They are slllooooowwwwww...

Re:Ports?

Posted: Fri Jun 25, 2004 1:45 am
by Pype.Clicker
Solar wrote: Yes, in and out are assembler commands used for addressing memory mapped I/O devices. (See Intel SDM, Volume 3...)
Either i missed something or you made a typo, solar. For memory mapped devices, like video RAM, you use ordinary memory accesses like add [0xA0000],1.

IN and OUT are used when hardware registers are in the separated IO address space ...

Re:Ports?

Posted: Fri Jun 25, 2004 6:12 am
by Solar
Heh. Such things happen if you look something up in the intel manuals quickie-quickie. :P

Sorry. Of course Pype's right. I should only give answers on things I tested and tried. ???