Principles of computer composition
1, traditional computer computer block diagram
The CPU communicates with other parts of the system by means of a local bus (or internal bus) consisting of an address line, a data line, a control line, and the address line is used to provide the address of the memory or I/O device, indicating the specific operation location of the required read and write data. Data lines are used for data transmission channels between CPU and memory or I/O, and control lines are used to control the specific read and write operations of memory and I/O
The size of the memory is determined by the number of digits of the address line: 32 bits, 232 bytes, total 4GB
The various control cards below (also Cheng cards) are connected via expansion slots to the system bus, which is the standard interface for the system address line, the data bus, the control bus, and the extended device controller. The bus interface is standard by ISA (industry aarchitecture) bus, EISA,PCI (Peripheral Component Interconnect) Peripheral Components Interconnect Bus, AGP (accelerated Graphics port) Accelerated video Bus
2. Modern computer composition structure
The modern PC is divided into North and South bridges, which connect AGP bus, memory, CPU and bus according to different speed of transmission data of each device. South Bridge for hard disk, keyboard, USB port, PCI bus and other low-speed equipment and bus communication
How to address and access control of I/O ports
1, I/O port addressing: In order to access the data and status information on the I/O control card, the CPU needs to specify its address, which is called the I/O port address or port. Usually according to the different bus traffic into the data port of Access data, output command port, Access controller execution state port.
2, the port Address setting method generally consists of two kinds: unified addressing, independent addressing
The principle of Port unified addressing is to place the I/O port address in the memory addressing address space, also known as memory image addressing, the CPU accesses an I/O port operation is the same as accessing memory, and the command also uses the Access memory command
The port-independent addressing method is to treat the I/O Controller and the port address of the control card as a separate address space, called the I/O address space, so that its access requires specialized I/O directives
Interface Access Control
PC I/O interface data Transmission Control method can be used in the application of cyclic query mode, interrupt processing and DMA transmission mode
1, circular Query method refers to the CPU through the program in the loop query the state of the specified device controller to determine whether data exchange with the device (wasted CPU)
2, interrupt processing control mode needs to interrupt the processor support, only when the I/O device through the interrupt processing request to the CPU, the CPU will temporarily interrupt the currently executing program to perform I/O interrupt processing service process, when the I/O controller or device makes an interrupt request, The CPU passes in the interrupt vector table (interrupt descriptor) to address the corresponding interrupt processing service entry addresses. Interrupt control mode requires pre-set interrupt vector table.
3. Direct Memory Access (DMA): This mode uses the DMA controller without CPU intervention to complete the data transfer between the memory and the I/O device.
Main memory
When the computer initializes power up, the physical memory is set to a contiguous area starting at address 0. All memory can be used as system memory except for addresses from 0xa0000 to 0xFFFFF (640K to 1M total 384K) and 4G at the last 64K range.
In the linux0.1x system, if the memory size bit 16M
0-640k is used to store kernel code and data
384K between 640k-1m still reserved for the specified purpose
1M-16M will be used by the kernel as an assignable main memory area
Bios
1. The system BIOS program stored in ROM is mainly used to perform self-test of each part of the system at the beginning of the computer, and to establish various configuration tables required by the operating system, such as interrupt vector table, hard disk parameter table. (Because the BIOS provides services that are not reentrant, in order to ensure access efficiency, the Linux operating system does not use the BIOS functionality in addition to the BIOS provided some system parameters at the time of initialization)
2, when the computer system power on or this press the reset button on the chassis, the CPU will automatically set the code segment Register CS to 0xf000, Subgrade address is set to 0xffff0000, segment length is 64k,ip program counter is set to 0XFFF0, So at this point the CPU's code pointer points to 0XFFFFFFF0, which is the last 16 bytes of the last 64K of 4G space. Here in the storage location area of the system BIOS, where a jump instruction is stored jmp jumps to one of the instructions in the 64KB range of the BIOS code to start execution, since the modern PC general BIOS capacity is 1m-2m and stored in flash memory, Therefore, in order to perform access to BIOS code or data beyond 64K in the BIOS, the BIOS program first uses a 32-bit large mode technology to set the access range of the data segment register to bit 4G, after the BIOS performs a series of hardware detection and initialization operations, will be compatible with the original PC 64KBIOS code and data copied to the low end of the memory 1M 64K Place, and then jump to this place and let the CPU into the real site operation mode, the last BIOS from the hard disk or other block device to load the operating system boot program into memory 0x7c00, and jump to 0x7c00 to continue execution
Serial Control Card
1. Principle of asynchronous serial communication
Two computers/devices for data exchange, i.e. communication. In computer communication, the language between the computer/device and the computer/device is called the communication protocol. The format of a valid data length unit in a communication protocol is usually represented by a frame, and the general structure of the communication frame includes information such as the initial synchronization information, the actual data transmitted, and the checksum.
Serial communication is a method of communication that transmits a bit of data to a single bit at a time on a line. Serial communication can be divided into asynchronous and synchronous, the main difference is the size of the communication units or frames that are synchronized at the time of transmission. The difference between synchronous communication and asynchronous communication is like two people talking, synchronous communication is like two people you say one word to me. And asynchronous passage is like two people talking on the same channel, each said. (asynchronously means that a character is sent one character at a time without waiting for the peer response, and the synchronization is sent one end (that segment has a specific meaning) and may need to wait for the peer to give a response before continuing to send)
2. Asynchronous Serial transmission format
In the asynchronous communication specification, transfer 1 is called the transmission number, transmission 0 is called the empty number, when there is no data transmission, the sender continues to send the transmission number, and the need to send data, the sending side first sends a bit time interval of the empty number.
The receiver may detect three errors: parity error, excessive speed error, frame format error.
The structure of microcomputer composed of fully annotated Linux kernel