Memory-mapped I/O and Port-mapped I/O
페이지 정보
작성자 Levi 작성일25-10-24 13:45 조회7회 댓글0건관련링크
본문
Memory-mapped I/O (MMIO) and port-mapped I/O (PMIO) are two complementary methods of performing input/output (I/O) between the central processing unit (CPU) and peripheral gadgets in a pc (usually mediating access by way of chipset). Another method is utilizing devoted I/O processors, commonly referred to as channels on mainframe computers, which execute their own directions. The memory and registers of the I/O devices are mapped to (related to) address values, so a memory address may seek advice from either a portion of physical RAM or to memory and registers of the I/O machine. Every I/O system both monitors the CPU's address bus and responds to any CPU entry of an tackle assigned to that machine, connecting the system bus to the desired gadget's hardware register, or uses a dedicated bus. To accommodate the I/O units, some areas of the deal with bus used by the CPU must be reserved for I/O and should not be obtainable for regular physical memory; the range of addresses used for I/O gadgets is decided by the hardware.
The reservation could also be everlasting, or temporary (as achieved by way of financial institution switching). An instance of the latter is discovered in the Commodore 64, which uses a form of memory mapping to cause RAM or I/O hardware to look in the 0xD000-0xDFFF range. Port-mapped I/O usually uses a particular class of CPU instructions designed specifically for performing I/O, such as the in and out directions found on microprocessors based mostly on the x86 architecture. Completely different forms of these two directions can copy one, two or 4 bytes (outb, outw and outl, respectively) between the EAX register or one in every of that register's subdivisions on the CPU and a specified I/O port address which is assigned to an I/O device. I/O gadgets have a separate handle house from basic memory, both achieved by an additional "I/O" pin on the CPU's physical interface, or Memory Wave an entire bus dedicated to I/O. Because the tackle space for I/O is isolated from that for fundamental memory, that is sometimes referred to as remoted I/O.
On the x86 architecture, index/knowledge pair is commonly used for port-mapped I/O. Different CPU-to-gadget communication strategies, akin to memory mapping, don't affect the direct memory access (DMA) for a system, because, by definition, DMA is a memory-to-device communication technique that bypasses the CPU. Hardware interrupts are one other communication technique between the CPU and peripheral units, nonetheless, for a number of reasons, interrupts are always handled separately. An interrupt is machine-initiated, as opposed to the methods talked about above, which are CPU-initiated. It is usually unidirectional, as data flows solely from device to CPU. Lastly, each interrupt line carries only one bit of data with a hard and fast which means, namely "an event that requires consideration has occurred in a machine on this interrupt line". I/O operations can slow Memory Wave System access if the tackle and information buses are shared. This is because the peripheral gadget is usually much slower than major memory. In some architectures, port-mapped I/O operates via a devoted I/O bus, alleviating the problem.
One advantage of Memory Wave-mapped I/O is that, by discarding the additional complexity that port I/O brings, a CPU requires much less inner logic and is thus cheaper, faster, easier to construct, consumes less energy and will be bodily smaller; this follows the basic tenets of lowered instruction set computing, and is also advantageous in embedded methods. The opposite advantage is that, as a result of common memory directions are used to handle units, all of the CPU's addressing modes are available for the I/O as nicely because the memory, and instructions that perform an ALU operation directly on a memory operand (loading an operand from a memory location, storing the result to a memory location, or both) can be used with I/O device registers as nicely. In contrast, port-mapped I/O instructions are sometimes very restricted, often providing just for simple load-and-store operations between CPU registers and i/O ports, so that, for instance, to add a constant to a port-mapped system register would require three instructions: read the port to a CPU register, add the constant to the CPU register, and write the outcome again to the port.
댓글목록
등록된 댓글이 없습니다.
