理解Computer中Memory-mapped IO

    技术2022-07-10  81

    Port

    Computer port(hardware)

    wikipedia

    In computer hardware, a port serves as an interface between the computer and other computers or peripheral devices.

    Electronically, hardware ports can almost always be divided into two groups based on the signal transfer:

    Serial port : send and receive one bit at a time via a sinle wire pairParalle ports : send multiple bits at the same time over several sets of wires

    After ports are connected, they typically require handshaking, where transfer type, transfer rate, and other necessary information is shared before data is sent.

    Hot-swappable ports can be connected while equipment is running. Almost all ports on personal computers are hot-swappable.

    Plug-and-play ports are designed so that the connected devices automatically start handshaking as soon as hot-swapping is done. USB ports and FireWire ports are plug-and-play.

    Computer networking (software communication)

    wikipedia

    In computer networking, a port is a communication endpoint.

    At the software level, within an operating system, a port is a logical construct that identifies a specific process or a type of network service.

    Ports are identified for each protocol and address combination by 16-bit unsigned numbers, commonly known as the port number.

    The most common protocols that use port numbers are the Transmission Control Protocol(TCP) and the User Datagram Protocol(UDP).

    A port number is always associated with an IP address of a host and the Protocol type of the communication.

    Specific port numbers are commonly reserved to identify specific services, so that an arriving packet can be easily forwarded to a running application. For this purpose, the lowest numbered 1024 port numbers identify the historically most commonly use services, and are called the well-known port numbers.

    Higher-numbered ports are available for general use by applications and are known as ephemeral ports.

    The concept of port numbers was established by the early developers of the ARPANET in informal co-operation of software authors and system administratiors.

    I/O between CPU and peripheral devices

    Memory-mapped I/O(MMIO) and port-mapped I/O(PMIO) (which is also called isolated I/O) are two complementary methods of performing Input/Output(I/O) between the cenral processing unit(CPU) and peripheral devices in a computor.

    An alternatice approach is using dedicated I/O processors, commonly known as channels on mainframe computers, which execute their own instructions.

    Memory-mapped I/O

    Memory-mapped I/O uses the same address space to address both memory and I/O devices.

    The memory and registers of the I/O devices are mapped to (associated with) address values. So when an address is accessed by the CPU, it may refer to a portion of Physical RAM. or it can instead refer to memory of the I/O device. Thus, the CPU instrucations used to access the memory can also be used for accessing devices.

    Each I/O device monitors the CPU’s address bus and resonds to any CPU access of an address assigned to that device, connecting the data bus to the desired device’s hardware register.

    Cpu-to-device communication methods

    I/O operations can slow memory access if the address and data buses are shared. This is because the perpheral device is usually much slower than main memory.

    Processed: 0.010, SQL: 9