In-depth understanding of computer Systems Reading notes Chapter I: Roaming

Source: Internet
Author: User

I was from the watercress to see a lot of people are recommending this book, so I went to borrow to read, last night took a long time to read the first chapter of the book, I feel this book is more consistent with me (some of the basis is not quite clear, the book is explained in detail, very good).

Here's my understanding (by the way, I'll review the Knowledge)

The first section is mainly about: A Tour of Computer Systems

Take hello.c as an example to explain how this program from a source program into an executable program, and then to execute, the display appears "Hello,world"

························································································································· ·························

The article is more organized and conforms to people's general thinking. (I think that since the computer is human-made, used to expand the calculation of people's thinking, then some of his operations should be able to employ the general idea to understand) with my thoughts to review.

In fact, the original name of the book is called: Computer systems:a Programmer's perspective (to understand the computer system from the perspective of a program ape)

Below assume oneself is a computer small white (actually also almost, hehe, no, than small white strong point, but some concepts or what still do not understand, computer work principle is not clear, but this chapter with a C source program of the implementation process of the computer is explained, very good, there is a great harvest, nonsense not much to say) Let ' s begin.

1 computers, you don't have to talk.

2 There is a lot of information in the computer. So what is the message? information = bit + context understand the computer is 0, 12 binary is stored, calculated. Basic storage is bit. But the same bits are different in different files. What is this? Because they have different contexts, that is, their information is different from top to bottom, for example, like: "Its" and "archaisms" in classical Chinese, although they are the same word but his context is different, so there is a difference. So the information is differentiated.

3. After understanding the information, we will take the hello.c file as an example. Analyze and understand his execution process.

We understand the hello.c procedure.

  

#include <stdio.h>
Main ()
{
printf ("Hello world!\n");
}
This is hello.c. This is the first program to learn the C language.
This is written in C but cannot be performed directly by a computer. C language This is a high-level language, this language is for the program ape to see, but the computer can not understand. So we're going to ask a translator to get two documents to understand and communicate.
"Translation Officer" is a compilation system. So let's take a look at what parts of this compilation system are made up of.
Pre-compilation
Compile
Assembly
Link
At this stage of precompilation: It is the beginning of the directives to deal with, (this is the system of the original) after this stage hello.c into Hello.iwenjian
Compile: Contains an assembly language program, the high-level language written by the program into assembly language written. Hello.I into Hello.s.
Assembly stage: It is to turn this HELO.S into a hello.o program, this program has been machine language, binary, with a text editor open will appear garbled
The final stage is the link: this stage, because there are some calls in the source program in the library functions or something, but this program does not need to link to form a real executable program. Save to Memory
4 The hardware is explained (we know how to generate the executable program, and has been saved to the memory then, how does the computer execute it?). On the hardware to explain his execution process,,,,,
Hardware, first of all, the overall understanding of the hardware system

Computer hardware System composition

The overall understanding of the composition of computer hardware system then, we come to a detailed look at the specific composition, the meaning of the various nouns.

(1) Bus: An electronic channel that runs through the entire system. It mainly carries out the information between the various hardware. I think it is like a road, so that the various points connected together, can form a communication, exchange of information.

(2) I/O device: input. Well, this .... This is the communication channel between the system and the outside world.

What constitutes an I/O device? is connected by a controller or an adapter to the I/O bus. So what is a controller and what is an adapter?

Controller: I/O device itself or a chipset on the motherboard

Adapter: Card plugged into the card slot on the motherboard

(3) Main memory: a temporary storage device. (DRAM), which is responsible for storing the data that the program processes and its programs when executing the program.

(4) Processor (CPU): The core of the engine that interprets/executes instructions stored in main memory. It's like the brain, analyzing information from various systems, issuing execution orders, kernel

What can the processor do?

Load: Loads the information in main memory. Copies a word/byte from main memory into the register, overwriting the original information

Storage: Copies a word/byte from the register to a location in main memory, overwriting the original information.

Update: Copy the contents of two registers to Alu,alu and add them to a register, overwriting the original information.

I/O read: Copy a word/byte from the I/O device to the register, overwriting

I/O write: Copy a word/byte from the register to the I/O device, overwriting

 transfer: Copy a word from the instruction and copy it to the PC, overwriting 
5. After understanding the hardware, how to accelerate it?
Too much information, slow transfer, long program run time, long wait time, so we need to speed up the process. But where is the main time-consuming part of the process? Only by understanding this point can it be accelerated, the effect is more obvious.
The main time-consuming point is to read information, that is, the transfer of information, from one location to another, such as from main memory to register. (We understand: larger storage devices run smaller storage devices run much slower)
How to solve it? A concept called caching.
Main memory, disk-and register
Cache


The higher the pyramid, the shorter the running time, the faster, but the higher the corresponding cost.
The above can be done in the following high-level cache.
7 After the hardware system is understood, it should be executed.
Implementation, but also understand the operating system. To know that the program cannot control hardware between, there is an operating system in between. The operating system controls the hardware directly.

Understand some of the concepts
Process: illusion, like exclusive processor, main memory and I/O device, only this program is running.
Actually several programs are executing. Run concurrently (a Cheng instruction executes with the instructions of another program), Context switch: All the information needed to save the program to run
Virtual Memory: illusion, each process exclusive main memory. There's a unique address.
File: A sequence of bytes.
8. The network is also an I/O device
The above is a computer implementation process, but not with other computers to communicate.

·····················································································································
Finally, finally completed the first chapter of the review, the following feelings:
This chapter is an overall explanation. There is no detailed explanation.
This distribution is very good.
When we are learning, first of all, we understand the process in general, and then we will learn more about the process.
Well, it took me a whole morning to finish my work and have a sense of accomplishment!!!!
Read the second chapter in the afternoon to be continued ...

In-depth understanding of computer Systems Reading notes Chapter I: Roaming

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.