Independent addressing, unified addressing:Are I/O address spaces and memory address space addressing methods consistent? For example, 51 is a unified addressing, with a total I/O and memory address space of 64 K. x86 is an independent addressing, which can be divided into I/O address space and memory address space.
Io space, memory space
X86: supports memory space, Io space, and independent addressing. Arm, MIPS, and PowerPC only support memory space, that is, unified addressing.
IO port and IO memory:For x86 systems, for example, Nic interfaces can be connected to the address bus of Io or the address bus in the memory, the IO port and IO memory are different.
IO port:When a register or memory is in the I/O space, it is called an I/O port.
IO port operations: Application, access, and release
Application:Struct resource * _ request_region (struct resource * parent, resource_size_t start, resource_size_t N, const char * Name, int flags)
After applying, you can view the port usage under/proc/ioports.
Access:Static inline int INB (unsigned long I) // read the byte port (8 bits) Static inline void outb (char C, unsigned long I) // write the byte port (8 bits) for the remaining 16-bit access ports, the 32-bit I/O port function is: inw, outw, INL, and outl.
Io memory: When a register or memory is in the memory space, it is called Io memory.
Io memory operations: Application, ing, access, and release
Application:Request_mem_region (START, N, name) // start: Application Start address, N: Application length, name: name of the application region.
After the application is completed, you can view the iomem usage in/proc/iomem.
Ing:In Linux, physical addresses cannot be used directly, and virtual addresses must be used. Therefore, there must be a ing process for Io memory operations.
Ing function: ioremap (cookie, size) // COOKIE: physical address, size: ing size.
Access:I/O memory access. It is recommended that you do not directly use * ADDR to assign values directly. In some cases, errors may occur easily. We recommend that you use functions provided by the kernel. Functions provided by the kernel include ioread8, iowrite8, ioread16, iowrite16, ioread32, and iowrite32. In earlier versions, functions such as readb, writeb, readw, writew, readl, and writel are also provided in the kernel.
Release:Iounmap () and release_mem_region ()
Feng nuiman, Harvard structure:The Harvard structure is a memory structure that separates program instruction storage from data storage. The central processor first reads the program instruction content in the program instruction memory, decodes the content, obtains the data address, and then reads the data in the corresponding data storage device, and perform the next step (usually execution ). The program instruction storage and data storage are separated, which can make the instruction and data have different data widths. For example, the program instruction of the pic16 chip of microchip is 14-Bit Width, while the data is 8-bit width. Currently, there are many central processors and controllers using Harvard architectures, in addition to the PIC chips of the microchip company mentioned above, as well as Motorola's mc68 series, zilog Gong
Division's Z8 series, Atmel Company's AVR series and anmou company's ARM9, arm10 and arm11, 51 Single Chip Microcomputer also belongs to the Harvard structure of Feng nuiman, also known as Princeton structure, it is a memory structure that combines program instruction memory and data storage. The program instruction storage address and data storage address point to different physical locations of the same storage, so the program instruction and data width are the same, for example, Intel's 8086 central processor's program commands and data are both 16-bit wide. At present, there are many central processors and controllers that use the Von noriman structure. In addition to the intel 8086 mentioned above, Intel's other central processor, Amou's ARM7 and MIPS's MIPS processor also adopt the Von noriman structure.
Reference: http://blogold.chinaunix.net/u3/119473/showart_2527242.html