20169203 "Linux kernel Fundamentals and analysis" work for the second week

Source: Internet
Author: User

Through this week's study, I have more specific understanding of how the computer works, for the von Neumann architecture is mainly:

(1) The use of stored procedures, instructions and data mixed storage in the same memory, (data and programs in-memory is no different, they are in-store data, when the EIP pointer to which CPU load the memory of the data, if it is an incorrect instruction format, An error interrupt occurs on the CPU. In the current CPU protection mode, each memory segment has its descriptor, which records the access rights (readable, writable, executable) of this memory segment. This is a disguised specification of what memory is stored in the instruction and what is the data can be sent to the operator to operate, That is, a program consisting of instructions can be modified.

(2) memory is a one-dimensional structure of linear addresses accessed by address, and the number of bits per unit is fixed.

(3) The instruction is composed of the operation code and the address. The opcode indicates the type of operation of this instruction, and the address code indicates the operand and address. The operand itself has no data type flag, and its data type is determined by the opcode.

(4) Direct control signals are controlled by the execution of instructions to control the operation of the computer. Instructions are stored in memory in the order in which they are executed, and the instruction counter indicates the address of the cell where the instruction is to be executed. The instruction counter has only one, which is generally incremented sequentially, but the order of execution can be changed by the result of the operation or the external conditions at that time.

(5) With the operator as the center, the data transfer between the I/O device and the memory must pass through the arithmetic device.

(6) The data is represented in binary notation.

The most important part of the von Neumann architecture is the storage module, it can be said that all the other modules are around the storage module to operate, each module has a very small memory register, register is to hold temporary data with the characteristics of fast storage, In the assembly instructions can be seen between the system of information transfer through the Register of the stack into the stack implementation, by a C language Program disassembly into the assembly program small experiment can let me have a better understanding.

First write a C program in Linux:

Compile commands from Linux by compiling them as assembly instructions:

We can first analyze the G () function, a point of the G () function of the command PUSHL is the push-in stack command incoming x value%EBP press into the storage stack, and then pass the X value to%eax through MOVL, addl instructions make x+6 Finally, the resulting results are passed to main () by popl out the stack instruction. I have a problem here is that for the instruction in the stack, no matter what register his size is a certain computer is what mechanism to ensure that the data into the stack will not overflow, whether by adding a stack pointer to solve, What should the computer do at this time if the data is going to be stored in a stack full of programs and then put into the stack? Is it a different register to store the data you want to press into?

20169203 "Linux kernel Fundamentals and analysis" work for the second week

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.