0

I have been reading a lot on port addressing and such lately, and know that say, Port 0x20, 0x21, 0xA0, and 0xA1 are the 8259A PIC, 8253/8254 PIT at Port 0x40-0x47, Ports 0x60-0x64 are the keyboard controller, 0x3F0-0x3F6 is the floppy device controller ext. I am trying to read up on things specifically for the 8086+ processor family and have seen some books online that seem to be very well worth the buy, if any suggestions on such books please let me know as well.

However, to my surprise, I am still unsure exactly how or where these port numbers are actually coming from? Are they mapped like the IDT occupying a space for a vector table somewhere? To my understanding you can readjust port numbers on windows, or is this incorrect? Or are they built into the circuitry of the processors pin-outs maybe? How can one find knowledge on what ports are for what device and what ports a computer has exactly?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
GodDamn
  • 161
  • 1
  • 8
  • 1
    Possible duplicate: [Is there a specification of x86 I/O port assignment?](https://stackoverflow.com/q/14194798) and/or [where to get the I/O port addresses assignment](https://stackoverflow.com/q/62212913). Some of those legacy IBM-PC IO ports are basically fixed, but IDK how actual modern hardware emulates them and whether firmware could reprogram their locations. – Peter Cordes Jun 11 '20 at 17:11
  • 1
    Also [Question About x86 I/O Port Addresses and IN/OUT Instructions](https://stackoverflow.com/q/56656650) about how they map to hardware. – Peter Cordes Jun 11 '20 at 17:13
  • Thank you guys, sorry for the duplicate question. I couldn't seem to find them however you all helped me out a bunch! – GodDamn Jun 11 '20 at 17:18
  • basically they are wired into the hardware, as things evolved exactly where that happens and how varies. In a virtual machine and even outside you can have the operating system now trap these addresses and simulate them with other hardware or map those access to real hardware in a different address space. – old_timer Jun 11 '20 at 17:58
  • the processor and other documentation will describe what peripherals are at what addresses. usb and pcie discovered devices vid/pids and addersses can be found using various tools. and remember you are dealing with decades of products so you need to be specific as to which chips and motherboard as the next/prior chip and motherboard are different for some items but for others are not for compatibility reasons. – old_timer Jun 11 '20 at 18:00

0 Answers0