Personal learning memo for future reference
One, Red Hat certification training
Red Hat 5.0 Training Certification Exam
Foundation (RHCE):
RH033: Basics
RH133: Operating System Management
RH253: Service
Red Hat Architect (RHCA):
RH401:
RH423: (Red Hat's own LDAP)
RH442: System tuning Black Art, Fundamentals of hardware operation, operating system fundamentals.
Tuning (use of memory, use of CPU)
RH436: Clustering and storage
RHS333:
Clusters: Basic load-balancing clusters, high-availability clusters, high-performance clusters
Second, how the computer is running
How the program works
The CPU can only be executed after it has been loaded into the instruction, and the instruction should be placed on the secondary, or external memory.
External memory includes CD-ROM, USB drive, hard disk, floppy disk. (Memory cannot be used to store data)
When the computer is powered on, it should go to where to load the instruction (program), it needs to be specified in the boot (boot order, boot sequence) in the BIOS.
Including:
Removable Devices mobile devices, such as USB drives,
Hard Drive,
CD-ROM drive disc,
Network Boot from Intel E1000
Top-down, if the first one does not, go to the second, if the first (such as a USB stick) has, the second will not tube. For example, if you have a system on your hard disk and you want to reload the system through a disc, you must transfer the CD-ROM from the boot sequence to the hard drive.
2. Computer architecture
* The father of computer architecture: von Neumann.
* The computer is made up of five major components:
(1) Computing Device ( calculator ): Calculator, mathematical arithmetic,
Only addition and logic operations (adder, logic operators), which are responsible for the operation
(2) Controller: Responsible for the operator where to fetch data
(3) Memory: Storing data-refers to memory ,
Is the addressable storage device, each storage unit is 8 bits, called a byte, each byte has an address (independent reference unit).
Memory is a flat address, and every memory cell on the inside has a unique location globally.
(Flat address: Put the whole country in a piece of the compilation, No. 1th, 2nd ....
Three-dimensional addressing: state-province-...)
(4) Input device:
(5) Output device:
* Calculator + controller = CPU
* The operator gets the data from the storage device for calculation, and then puts the results of the operation into the memory
The core part of a computer is called an arithmetic device (adder)
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/8C/01/wKioL1heouuiFQqCAAA1V3r30VA819.png "title=" QQ picture 20161225003110.png "Width=" "height=" 303 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:400PX;HEIGHT:303PX; " alt= "Wkiol1heouuifqqcaaa1v3r30va819.png"/>
Adder may produce near-bit, right-to-left carry, first calculate the digit, then calculate 10 bits, ...
an adder can only operate one bit, and if it is necessary to add two 3-digit numbers (for example, 111 + 999), 3 adder is required. Because each adder can only add one number per corresponding bit.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/8C/03/wKioL1heqBjQW8T6AAA3SkMtrgs636.png "title=" QQ picture 20161225005317.png "width=" height= "297" border= "0" hspace= "0" vspace= "0" style= "WIDTH:350PX;HEIGHT:297PX;" alt= "Wkiol1heqbjqw8t6aaa3skmtrgs636.png"/>
the computer only supports binary, why does it not recognize the decimal?
The computer is an electrical device and only supports 2-in (0, 1).
Since the power supply line has a resistor, the original output voltage is 1 volts, the final output may be 0.8, resulting in imprecise. If the integer is not accurate OK, if it is a decimal, such as 0.11346, how to adjust the voltage can be very difficult. Therefore, it is very troublesome to use decimal to denote the addition operation.
Binary is relatively simple, with the power of the one to say (whether 1 volts, 3 volts or 8 volts, as long as the electricity is used as a means), no electricity on the use of the said. This is relatively simple, greatly reducing the complexity of the design of the computer itself.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/8C/03/wKioL1hern_y1uE-AABlJh4ANPI336.png "title=" QQ picture 20161225012040.png "Width=" "height=" 308 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:400px;height:308px; " alt= "Wkiol1hern_y1ue-aabljh4anpi336.png"/>
Each time an addition operation is performed, it is necessary to acquire addend and be addend in the memory. The program is composed of instructions and data, instructions will tell the CPU, in which memory cell is placed in the Addend, which storage unit is placed in the addend.
The controller needs to accept the control instruction.
The line that transmits the data, called the bus.
For the controller, the line that obtains the control instruction is called the control bus.
Instructions are also placed in the memory, so there is not only data in the memory, but also instructions.
The result of the operation is placed in memory, and the controller tells the operator where there is room in memory and puts the result into memory.
All of this is done between the operator, the controller, and the memory.
The memory is empty at the initial time and there is nothing in it because the memory cannot store the data. For the user, we first need to run the program (instruction + data), first put in the memory. The operators and controllers can then read the data and instructions.
This requires a peripheral device to store instructions and data in memory so that the operators and controllers can read the instructions from memory.
The output is stored in the memory, and if a power outage occurs, all data inside the memory is lost.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/8C/03/wKioL1het_vhAzoCAACLbXs1y3I863.png "title=" QQ picture 20161225020100.png "Width=" "height=" 451 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px;height:451px; " alt= "Wkiol1het_vhazocaaclbxs1y3i863.png"/>
If the 32-bit calculation requires a lot of root lines, the line multiplexing is required. Use a line can be used to transmit addend, also can pass summand, also can preach instruction. Give him a control bit and have a control line on the CPU.
If you use a set of lines to transfer addend and be addend, then you need to record the data, if not recorded, when the incoming summand, Addend is gone. So the device needs to save Addend, this device is called register.
Operators, registers, and controllers are the core components of the CPU. First-level cache, the level two cache is also part of the CPU, but not the core part. But it determines the performance of the CPU.
3. Virtual machines
A virtual machine is a software simulation of such an operator, controller, memory, and so on.
4. When you start the boot
Programs are made up of instruction + data, and instructions and data must be loaded into memory to be implemented .
How does the power-up self-test (post:power on and self testing, power-on-Test, power-on-self-test) be done? The computer does not yet know what disks it has, and the disks are ordered (where the results shown in Boot sequence come from). The process of the order itself is an instruction, who directs the process?
The computer must have the ability to bootstrap . It is achieved by means of additional equipment.
Ram:random access memory random access storage--memory, RAM.
Rom:read only memory Read only. It stores a bunch of instructions for this computer that can be mapped into memory.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/8C/03/wKioL1heu-iiLyJ-AAClNf5mCGQ124.png "title=" QQ picture 20161225021750.png "alt=" Wkiol1heu-iilyj-aaclnf5mcgq124.png "/>
Round chip. The instructions in this will not be lost, even if no electricity is lost. A boot, the computer will automatically (through the hardware logic to complete) the chip inside the program map to the bottom of the memory, the first paragraph, the operator, the controller will read this instruction, this program tells you the host, to detect whether there are keyboards, video cards, network cards and other hardware equipment. This process is called power-on self-test.
Third, peripheral equipment
Connect all peripherals through the bus to the core, how early to know that the keyboard was knocked, not the mouse?
Polling: (poll) The way the CPU keeps looking, called polling. Very low efficiency. If you haven't knocked on the keyboard for a day, look white.
Interrupt: (interrupt) hardware notification mechanism. Whoever knocks on the keyboard notifies the CPU that someone has knocked on the keyboard.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8C/08/wKiom1hfbECj7pYgAACnxAOeiU0474.png "title=" QQ picture 20161225145013.png "alt=" Wkiom1hfbecj7pygaacnxaoeiu0474.png "/>
When an interrupt occurs, how does the CPU know it is a keyboard or a mouse? This requires a control chip. Inside the computer there is a chip called a programmable interrupt chip, which is connected to the CPU pin. There are multiple lines on this controller, and each line represents a device. For example, if an event occurs on the first line, it is known that the event is the keyboard, which occurs on the second line, knowing that it is a mouse.
Multiple devices can be identified on a single line, represented by interrupt vectors. (for example, a server is connected to a hundreds of-block drive)
The hard drive also needs to be interrupted.
Peripheral I/O devices interact with the CPU or computer core through constant interruptions. If the number of interrupts is more, the performance of the host will be degraded.
The read-in and read-out of data from many devices is done through interrupts. If it is a very busy server, it is necessary to receive requests from others through the network card, and then respond to the data requested by the other party. If the network card is very busy, it is normal to generate 20,000 interrupts per second. At this time the CPU in order to deal with the interruption is already busy, performance degradation.
Front-end bus:Front Side bus (FSB)
Iv. Nan Qiao
The CPU has to keep up with memory, so the CPU and memory need a bus connection, and a controller is needed in the middle.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/8C/0A/wKiom1hfwdWSab_cAAArz03MNTc578.png "title=" QQ picture 20161225205528.png "alt=" Wkiom1hfwdwsab_caaarz03mntc578.png "/>
North Bridge: High-speed bus controller, near the CPU. Need a lot of data transmission, need to work at relatively high frequency, fast implementation of data exchange, are connected on the North Bridge. The early North Bridge was used to connect memory.
South Bridge: Low-speed bus controller, slightly farther from the CPU. (Low speed, such as tapping the keyboard, knocking faster, can knock a few times a second). The South bridge is much slower than the North bridges, and most of the I/O devices are connected on the South bridges. The South bridge is used to connect peripherals such as hard disks, keyboards, mice, monitors, and so on. These devices are aggregated by the South Bridge and passed to the North Bridge via the same wire, which is then transferred to the CPU.
The equipment is working at a certain frequency.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/8C/06/wKioL1hfwgzzpB5tAAAqLtPd0sg667.png "title=" QQ picture 20161225205622.png "alt=" Wkiol1hfwgzzpb5taaaqltpd0sg667.png "/>
The memory is now directly connected to the CPU, and the North Bridge is only responsible for connecting the bridges and other bus controls.
Like the current graphics card, processing a large amount of data, video memory to show some image processing, especially some 3D rendering, the amount of data to be processed is also very large, it is possible that the VGA chip directly on the North Bridge.
For some file servers, such as a Web server, each request to request a page, the page to open, called the Web page. Web page is actually a file, is stored on the server, a person to access a Web server is not so called, if 1 million people at the same time access to a page, a page inside including the picture open may have 2 M, 1 million people at the same time access is how much data, these data if you want to be read from hard disk, The hard drive may be too busy to work, only 100,000 people can access it, and 900,000 people are waiting. So I/O devices can become very slow. The hard drive is connected to the South Bridge, in order to make it work at a higher frequency, it can be connected to the North Bridge. If it is a mechanical hard disk, rotating through the disc, it is useless to get to the North Bridge. If it's a solid state drive, you can connect the SSD directly to the North Bridge, enabling fast disk I/O.
V. CPU frequency
Hertz: The number of cycles that occur in an event per unit of time.
For example the adder, the switch closure stands for 1, that closed how long the adder knows that the data has been received in, and that it is temporarily stored in? If the input addend takes 1 seconds, the input summand takes 1 seconds, and the calculation output takes 1 seconds, the calculation period takes 3 seconds to complete. Because the electrical transmission is very fast, and the inside of the cable is very short, after the switch is closed, the electric instantaneous can reach the adder. If the switching speed is very fast, it means that the input and output of the addend and Summand are very fast.
Once the event can be completed at one time, this event may be the input of completing the addend or being addend.
1G = 10 of 9 square, 1G Hertz represents a second to complete 10 of the 9-time transformation.
Assume that the CPU is operating at 1G Hz, while the memory operating frequency is 1M Hz, the speed is not coordinated. The memory manufacturing process determines that the frequency is relatively slow. Faster memory, much higher cost.
Put an intermediate device between the fast and slow center, which can connect to the connecting device.
CPU has cache, level cache, level two cache, level three cache. The smaller the number of caches, the closer he is to the CPU, the faster it is, the higher the cost, so it's smaller, and the bigger it is, the more expensive.
Registers can operate at the same frequency as the CPU. The first level cache is much slower, and the primary cache is divided into instruction cache and data cache. A secondary cache is slower than a first-level cache, but it is faster than memory. The cache is smaller than the memory and the primary cache is smaller than the level two cache.
The local principle of the program: the locality of time, the locality of space.
Time locality: The data just accessed, one may also want to access, cache down, from memory to level two, and then to a level, the next time directly from the first level cache directly. If you don't access it later, there's no point in caching it.
Spatial locality: If a data is accessed, data that is very close to the data may be accessed immediately. So when loading a data, load the data around the data together.
Vi. Transplant of procedures
The computer hardware chip, its various functions are through the PIN has the electricity to complete.
Intel's CPU, which is produced by Motorola, is placed in a piece, and it may run differently. A programmer-developed program runs on Intel's CPU and does not necessarily run on the Motorola CPU.
Porting a program: because the underlying chip works differently, the program has to rely on the chip to work.
VII. ASSEMBLY language
Machine language: The time of the chip operational program is the binary number, the program regardless of the instruction or the data are binary. The language used in binary programming, called machine language.
Microcode (assembly language): In order to speed up the development of programmers, the chip manufacturer will be the chip's machine language with a microcode, each chip support microcode programming. Called assembly language. Words that can be expressed in human natural language, such as MOV.
Programmers can understand the language, the machine cannot understand, so need to convert. Compiling assembly language-developed programs into machine languages requires a compiler.
Viii. API
Microcode is the chip itself, so Intel's microcode and Motorola's microcode is not the same.
Although the assembly language is easy to recognize, but it is very close to the hardware chip, so this language is called low-level language.
High-level language: To be able to run on the CPU, it must be converted to binary format. It also needs to be compiled. It is first converted into a compilation and then translated into machine language. High-level languages combine additional mechanisms to bridge the differences between multiple chips.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/8C/0A/wKiom1hf1xbTKcSlAAA4BP8F7iI365.png "title=" QQ picture 20161225222603.png "alt=" Wkiom1hf1xbtkcslaaa4bp8f7ii365.png "/>
Api:application Programming Interface application Programming interface. A program with the same functionality written in assembly language on different CPUs.
Nine, the common CPU series
Hardware platform Architecture: refers to the different series of CPU chips.
ARM: Mobile hardware platform architecture. Chip features are power saving, performance is also good.
British companies, which only produce intellectual property, are responsible for designing chips. Handheld Smart Device Andior IOS.
X86:32 bit platform. AMD is compatible with Intel, and there is no big difference between the x86 series.
X64:x86, AMD 64
Itanium: Intel acquired from HP.
Alpha:hp
ULTRASPARC: Stanford University design, later sold to Sun, by Fujitsu on behalf of production.
POWER:IBM first CPU with a frequency exceeding 4G Hz
(The manufacturing process is now experiencing bottlenecks and can no longer be improved, 4 G is a ceiling.) Start to multi-core development)
m68000:m68k Motorola
PowerPC: Apple, Motorola, IBM three joint
Apple Mac OS is UNIX, IOS is also UNIX, is Freebs Unix
Linux almost supports all of the above CPU types.
X. Operating system (OS)
Windows
Linux
Unix:
Hp-ux:hp
Solaris:sun
Aix:ibm
SCO UNIX
UnixWare
Os/2
Xi. process
Early computers:
Input equipment, perforated tape;
Output device: Light Emitting diode
Programmers use the assembly to write good programs, converted into binary, with paper tape machine made of perforated paper tape.
The computer is fast and the input and output is slow.
The cost of running a computer for 1 seconds is expensive, as much as you want the computer to be responsible for computing, not doing anything else.
Offline Batching: Two computers, a slow programmer is responsible for programming, and the program is stored on tape. A quick one is responsible for reading the program from the tape and then doing the operation.
The disadvantage of tape is that it cannot be accessed randomly.
Jobs: A complete computational process that runs on a computer, called a job, job, multiple jobs, is called jobs.
Early jobs on tape, each tape on a job, the job is finished, the tape is removed and replaced next.
Later, you put multiple jobs on a tape. Multiple jobs are separated by separators.
For example: jobs1$$$$$$$$$$$$$$ $jobs 2. When the first one is finished, the second is automatically loaded.
At some point, you can still execute only one program. Because there is only one memory, this memory is accessed entirely by the program.
Two programs cross-run, and the second program will destroy the data in the first program memory.
The first program is done, the second program is on tape, and in order to read the program from the tape into memory, the CPU is idle for a while. Computing power is very expensive, and people want to get the CPU up and busy as much as possible.
Multi-tasking system: Computer core components, CPU, Memory.
If two programs, each program execution takes 10 seconds.
Divide a resource into multiple parts, the CPU processes the first program for 1 seconds, stops, saves the scene, and processes the second program for 1 seconds. Then process the first program, starting at the saved field and continuing backwards.
CPU: Divided by Time
Slice: Calculation time slice, 5ms, 5ms
Memory: Segmentation mechanism
The first program starts at 001 of the first paragraph
The second program starts at 001 of the second paragraph.
The address is relative.
Programmers still use 001, internally by CPU or hardware to complete the segmentation, starting from 001 of each segment
Virtual address space: (not virtual memory) assume that there is a 32-bit system, no matter how much memory you have, assume that there is 4G of memory.
32-bit CPUs altogether address bus only 32 bits, and 32 bits can refer to 2 of the 32 parties, that is, 4G different addresses.
A 32-bit system can use up to 4G of physical memory, which is determined by its bus width.
64-bit system is 2 of 64, that is, 4G 4G memory (400 million 4G, not 16G)
Every time the program runs, it has its own virtual address space. No matter how big your physical memory is, it thinks it has 4G.
CPU allocated to a program 5ms, if the time is up, the program depends on the operating system is responsible for the management of hardware resources.
Process: Processes a running program, which is an instance, called a process.
The process has a life cycle, starts, ends.
Program is placed on the hard disk, if not deleted always exists, so the program and process are different.
The operating system is a generic software, which is not responsible for the completion of the specific work, it is only responsible for coordinating other specific procedures are working.
The program has the execution portal, the C language main function, the Java public static static class
System call:
System call: With the operating system, no program can directly deal with the hardware, in order to use hardware features, must be through the operating system
Library: is a bunch of programs, no execution portal, they can not run independently, can only be executed by other program calls (call). When it executes, it can provide a unified calling mechanism, and the calling interface is the same.
System call is too low-level to encapsulate one or more of the underlying system calls into a more advanced interface, which is the library, the API.
Programming with Windows-provided libraries on Windows, programming with Linux-provided libraries on Linux, will not work if the two libraries provided are different.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/8C/0B/wKiom1hf9_KwVRtYAAAgI17-dug271.png "title=" QQ picture 20161226004627.png "alt=" Wkiom1hf9_kwvrtyaaagi17-dug271.png "/>
Shell: The function of the computer, through the human easy operation of the way output an interface, through this interface, can really go to operate the computer. The shell is a human-computer interface, the broad shell has a graphical, command-line.
02 Computer Fundamentals