Collection
zero Useful+1
zero

Addressing space

CPU's ability to address memory
The address space generally refers to the CPU's memory addressing Ability. Generally speaking, it is a question of how much memory can be used at most. Data in storage (RAM) storage is regular. When the CPU needs to extract data during operations, it needs to know where the data is stored. At this time, it needs to go door to door, which is called addressing. However, if there are too many addresses beyond the CPU's capacity, the CPU cannot find the data. The maximum range of addresses that the CPU can find is called addressing capability byte For example, a 32-bit addressed CPU can address an address of the 32nd power of 2, that is, 4G. This is why a 32-bit CPU can match 4G memory at most. No more CPUs can be found.
Chinese name
Addressing space
Foreign name
Addressing space
Meaning
CPU for memory addressing Ability of
Popular meaning
How much memory can be used at most
Addressing capability
What is the maximum range of addresses the CPU can find
Unit
byte

brief introduction

Announce
edit
I/O port And addressing
CPU To access I/O interface For the data and status information on the controller or control card, their addresses need to be specified first. This address is called I/O Port address Or port for short. Usually, one I/O The controller contains data ports for accessing data, command ports for outputting commands, and access controllers Execution status Status port of. The port address can be set in two ways: Unified addressing and Independent addressing
The principle of unified port addressing is to classify the port address in the I/O controller into storage addressing address space Within the range. So this Addressing The mode is also called Storage image Addressing. The operation of accessing a port by the CPU is the same as the operation of accessing memory. It also uses the instruction of accessing memory. The method of port independent addressing is to treat the address space of I/O controller and control card as an independent address space, which is called I/O address Space. Each port has an I/O address corresponding to it, and uses a dedicated I/O Instructions To access the port.
IBM PC and its Compatible computer The independent addressing mode is mainly used, and an independent I/O address space is used to register Addresses and accesses. use ISA bus The I/O address space of traditional PC with structure is 0x000~0x3FF, with 1024 I/Os Port address available. See Table 2-1 for the port address range assigned and used by each controller and control card by default. The use and programming methods of these ports will be described in detail later when related hardware is involved.
In addition, IBM PC also partially uses Unified addressing Mode. For example, on the CGA display card display memory The address of Memory address The space is 0xB800~0xBC00. Therefore, if you want a character to be displayed on the screen, you can directly use memory operation instructions to write to this memory area.

Port address assignment

Announce
edit
Distribution description
Port address range
Distribution description
0x000~0x01F
8237A DMA controller one
0x1F0~0x1F7
0x020~0x03F
0x278~0x27F
Parallel printer port 2
0x040~0x05F
8253/8254A timing counter
0x2F8~0x2FF
Serial controller 2
0x060~0x06F
eight thousand and forty-two Keyboard controller
0x378~0x37F
Parallel printer port 1
0x070~0x07F
Access the CMOS RAM/RTC (Real Time Clock) port
0x3B0~0x3BF
Monochrome MDA display controller
0x080~0x09F
DMA page register access port
0x3C0~0x3CF
Color CGA display controller
0x0A0~0x0BF
0x3D0~0x3DF
Color EGA/VGA display controller
0x0C0~0x0DF
8237A DMA controller two
0x3F0~0x3F7
floppy disk controller
0x0F0~0x0FF
Coprocessor Access Port
0x3F8~0x3FF
Serial controller 1
0x170~0x177
-
-
For using EISA or PCI, etc Bus structure Modern PC with 64KB I/O address The space is available for use. In a normal Linux system, you can view the/proc/ioports file to get the relevant controller or set the I/O address range used:
[ root@plinux root]# cat /proc/ioports
0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-006f : keyboard
0070-007f : rtc
0080-008f : dma page reg
00a0-00bf : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : ide1
01f0-01f7 : ide0
02f8-02ff : serial(auto)
0376-0376 : ide1
03c0-03df : vga+
03f6-03f6 : ide0
03f8-03ff : serial(auto)
0500-051f : PCI device 8086:24d3 (Intel Corp.)
0cf8-0cff : PCI conf1
da00-daff : VIA Technologies, Inc. VT6102 [Rhine-II]
da00-daff : via-rhine
e000-e01f : PCI device 8086:24d4 (Intel Corp.)
e000-e01f : usb-uhci
e100-e11f : PCI device 8086:24d7 (Intel Corp.)
e100-e11f : usb-uhci
e200-e21f : PCI device 8086:24de (Intel Corp.)
e200-e21f : usb-uhci
e300-e31f : PCI device 8086:24d2 (Intel Corp.)
e300-e31f : usb-uhci
f000-f00f : PCI device 8086:24db (Intel Corp.)
f000-f007 : ide0
f008-f00f : ide1
[ root@plinux root]# [1]