"In-depth understanding of computer systems - program structure" study notes

1. The computer system roaming

The computer system is composed of hardware and software components of the system, they work together to run the application. In the "in-depth understanding of computer systems," a book will learn a lot of skills practice. For example: to understand how the compiler implementation process calls, to avoid errors caused by buffer overflow security vulnerabilities, hope and understanding traps concurrent brings.

 

1.1 + context information is bit

  • Source program consists of:

    • Source is a bit sequence consisting of 1 and 0, 8 bits are organized into a group, called a byte.

    • Each byte represents some text characters in the program.

  • Text file:

    • Most systems use standard ASCII text characters to represent only the ASCII characters in the file is referred to as a text file.

    • All other files are called binary file.

 

1.2 program is translated into a different format other programs

  • Program objectives:

    • Also referred to as a target object program executable files, object files by the compiler driver converted to the source.

  • Translation process is divided into four stages

    • Preprocessing phase: modifying the source code to compile another bit of the program file.

    • Compilation phase: The preprocessed source code translated into assembly language program.

    • Compilation stages: the assembly language program translated into machine language instructions.

    • Links stages: the target program of the standard library and source combined to yield that can be loaded into memory, execution of the target file system.

  • Learn how to build system to work is a great advantage

    • Optimize program performance: the overhead of a function call how much? Local variables and references Which is faster? Simple permutation function brackets runs much faster what is the reason? and many more

    • An error occurred while understanding the link: connector can not resolve references What does it mean? What is the difference between static and global variables are? Why do some link errors until runtime?

    • Avoid security vulnerabilities: buffer overflow error, understand the consequences of the way data and control information stored in the program stack will cause.

     

1.3 the processor reads and interprets the instructions stored in the memory

 

 

Guess you like

Origin www.cnblogs.com/wuchangliang/p/11456491.html