Ports?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Roman

Ports?

Post 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?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Ports?

Post by Solar »

Yes, in and out are assembler commands used for addressing memory mapped I/O devices. (See Intel SDM, Volume 3...)
Every good solution is obvious once you've found it.
pini

Re:Ports?

Post 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...).
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Ports?

Post by Solar »

Oh, yes, one more thing: They are slllooooowwwwww...
Every good solution is obvious once you've found it.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Ports?

Post 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 ...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Ports?

Post 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. ???
Every good solution is obvious once you've found it.
Post Reply