Hardware Basic (hardware basics) A operating system must be closely fitted with hardware systems as its basis. The operating system needs to use some of the features that only hardware can be provided. For complete understanding Linux, you need to understand the basics of the underlying hardware. This chapter is carried out in the hardware of modern PC. The picture of the Altair 8080 was printed on the "Popular Electronics" magazine cover in January 1975, and a revolution began. Altair 8080, following the early "Star Trek Epsode" named, only $ 397, you can be assembled by your personal e-enthusiast. It has Intel 8080 processor and 256 bytes of memory, but there is no screen and keyboard. It is too simple to measure today's standard. Its inventors, ED ROBERTS, manufactured noun "Personal Computer" to name his invent, but now, the noun of the PC has been used to name almost all you can do without relying on the computer, you can run the computer. With this definition, even some very powerful Alpha AxP systems are also PC. The enthusiasts have seen Altair's potential and started to write software, manufacturing hardware. For these early pioneers, it represents freedom: freedom from the host system that is controlled and operated by the clergy. You can have a computer in your own home or even the kitchen table, which makes the college's retreat for this fans and all night. At the same time, there is a large number of hardware, and the software experts are willing to write software for these new machines. IBM released IBM PC in 1981 and defined in 1982, and defined modern PC models. It has Intel 8088 processor, 64K memory (can be extended to 256K), two floppy drives and a 80x25 color graphics card (CGA), with today's standard measure, it is not very powerful, but it is good. In 1983, the IBM PC-XT launched immediately, there is a luxurious 10M hard drive. Soon, a large number of companies, such as Compaq started to create a replica of IBM PC, and the structure of the PC became the standard of facts. This fact's standard makes large number of hardware companies to compete with this growing market, in turn, can contain prices, so that users are satisfied. Modern PC inherited many systematic features of early PC. Even the system based on the most powerful Intel Pentium Pro can also run Intel 8086 addressing mode. When Linus Torvald is started to develop later Linux, he chose the most common and most reasonable hardware platform at that time: an Intel 80386 PC. From the outside of the PC, the most obvious parts are chassis, keyboards, mouse, and displays. There are some buttons in front of the chassis, a small screen displays some numbers, and there is a floppy drive. Most systems now have a CD-ROM period, drive. If you need to protect your data, there will be a backup tape drive. These devices are all seen as peripherals. Although the CPU is managed throughout the system, it is not the only smart device. All peripheral controllers, such as IDE controllers, have a certain degree of intelligence. Inside the PC (Figure 1.1), you can see a motherboard, including CPU or microprocessor, memory, and slots of some ISA or PCI peripheral control cards. Some of these controllers, such as the IDE disk controller, may be built on the system board. CPU CPU, or microprocessor, is the heart of all computer systems.
The microprocessor performs math operation, logic operation and reading instructions from memory and executes instructions, thereby controlling data flow direction. In the early days of computer development, various functional modules of microprocessors are constructed from units that are separated by mutual separation (and large). This is also the origin of the noun "central processing unit". Modern microprocessors focus these functional modules on an integrated circuit made of very small silicon wafers. Alternately in this book, noun CPU, microprocessor and processor. Microprocessor processes binary data: These data consist of 1 and 0. These 1 and 0 correspond to the open or off of the electrical switch. It seems that 42 represents 4 10 and 2 units, and binary numbers consist of a series of power numbers representing 2. Here, the number of power means a number of times the number of times. 10 primary power is 10, 10 power is 10x10, 10 power is 10x10x10, and so on. Binary 0001 is a decimal 1, and the binary number 0010 is a decimal 2. The binary 0011 is a decimal 3, and the binary 0100 is a decimal 4, and the like. Therefore, the decimal 42 is binary 101010 or (2 8 32 or 21 23 25). In addition to using binary representing numbers in computer programs, another base, 16 is often used. In this kind, each digit represents 16 power. Because the decimal figures are only from 0 to 9, 10 to 15 in hexadecimal are represented by letters A, B, C, D, E, and F, respectively. For example, hexadecimal E is a decimal 14, while hexadecimal 2A is a decimal 42 (2 16 10). Use a C language representation (this book has been used), hexadecimal numbers use prefix "0x": hexadecimal 2A write 0x2a. The microprocessor can perform an arithmetic operation such as adding, multiplying, and division, or executing logic operations such as "whether x is greater than Y". The execution of the processor is controlled by external clock. This clock, that is, the system clock, a stable clock pulse to the processor, in which the processor performs some work in every clock pulse. For example, a processor can perform an instruction in each clock pulse. The speed of the processor uses the frequency of the system clock. A 100MHz processor receives 100,000, and 000 second clock pulses per second. The ability to describe the CPU with a clock frequency is a misunderstanding because different processors are different from the workload performed in each clock pulse. Nonetheless, if all conditions are equal, the faster the clock frequency indicates the stronger the ability of the processor. The command executed by the processor is very simple, for example: "read the contents of the memory position X in the register y". The register is the internal storage space of the microprocessor to store data and operate. The execution operation may cause the processor to stop the current operation to rotate the instructions in the memory in memory. It is these tiny instructions together to give modern microprocessors almost unlimited power because it can perform millions or even billion instructions per second. The instructions must be extracted from memory when executing instructions, and the instructions may also reference data in memory, which must also be extracted into memory and saved to memory when needed. The size, quantity, and type of the internal registers of a microprocessor are fully determined in its type. An Intel 80486 processor and a register group of an Alpha AXP processor are completely different. In addition, Intel is 32-bit wide and Alpha Axp is 64-bit wide.
However, in general, all specific processors have some general purpose registers and a small number of dedicated registers. Most processors have the specific registers of the following special purposes: Program Counter (PC) Program Counter This register records the address of the instruction to be executed. The content of the PC is automatically increased at each time the instruction. The Stack Pointer (SP) stack pointer processor must be able to access large-capacity external read and write random access memory (RAM) for temporary storage data. Stack is a method for storing and restoring temporary data in external memory. Typically, the processor provides special instructions to press the data in the stack and need to be taken afterwards. The stack uses LIFO (afterwards). In other words, if you press the two values x and y to the stack, then pop up a value from the stack, then you will get the value of Y. Some processors grow to the top of the memory, while others grow to the bottom of the memory. There are also two ways of processors that can be supported, such as: ARM. The Processor Status (PS) instruction may result. For example: "Is the content of the X register greater than the Y register?" May result in true or false results. The PS register retains these results and other information in the current state of the processor. Most processors have at least two modes: Kernel (core state) and user (user), the PS register records those information that can determine the current mode. All systems of Memory have a hierarchical memory structure consisting of memory between different levels of speed and capacity. The fastest memory is a cache memory, just like its name suggests - for temporarily stored or caches the contents of the main memory. This memory is very fast but more expensive, so there is a small number of cache on the multi-processor chip, and most cache memory is placed on the system board. Some processors use a cache memory to cache instructions and data, while others have two cache memory - one for instructions and the other for data. ALPHA AXP processors have two built-in memory cache memory: a D-Cache, another for instructions (I-cache). Its external cache (or B-cache) is mixed together. The last memory is the main memory. The velocity of the CPU has a cache memory relative to the external cache memory, and the main memory is simply climbed. Cache memory and main memory must be synchronized (match). In other words, if one of the primary memory is saved in one or more positions of the cache memory, the system must ensure that the cache memory and the main memory of the main memory. The work part of the cache synchronization is completed by the hardware, and the other is done by the operating system. For other systems, hardware and software must also be closely fitted. The various components of the BUSES system board are interconnected by connecting systems called bus. System bus is divided into three logical functions: address bus, data bus and control bus. The address bus specifies the memory location (address) of the data transfer, and the data bus saves the transmitted data. The data bus is two-way, which allows the CPU to read, and the CPU is allowed to write. The control bus includes various signal lines for sending clocks and control signals in the system. There are many different bus types, ISA and PCI buss are common ways for systems for connecting peripherals.