Closed 0XFF-96 closed 3 years ago
Chapter 1 is the roadmap of this book started by a simple example that every programmer should have known - The "Hello world" program.
Unlike the other book's, The author break this program down into serval part and introduces the idea in computer systems by tracing the life cycle of the program, which give me a more clear picture of what this program doing in machine level.
There is a few key opinions I would like to bear in mind in the future .
If you search wiki for the definition of information, there is a lots[bad expression] of sayings. But the author says, in the computer science context, information is equal to bits with context. information can be defined to bits with context.
All information in a system is represented as a bunch of bits . For example, the hello.c program is stored in a file as a sequence of bytes.
the same bits with different context , can be represent different things. it could be an integer, floating-point number, character strings, or machine instruction.
what is it context the above talking about ? I thought it mean the state of cpu register or the state of the process, for which it can take the same input bits, but interpret it into different objects.
Why we need memory hierarch ? Because, On top of the memory hierarchy memory has faster access time, less capacity and higher cost per bit stored. At the bottom there is larger storage capacity, slower access time and lower cost per bit stored.
As the book says
As we move from the top of hierarchy to the bottom, the devices become slower, larger, and less costly per byte.
More Detail: Memory Hierarchy Introduction
There two primary purposes of operating system:
So it can be discussed into three parts: process、virtual memory、files.
There is a three ways of concurrency:
What is the different of these three levels ? how to distinguish them from each other ?
You are 【poised 】for an exciting journey
You will learn the promises and 【pitfalls】 of concurrency
C also lacks 【explicit】 support for useful abstractions .
We do not know 【the inner workings】 of the compiler .
The 32-bit code that has become 【ubiquitous】 on machines running Linux, Windows.
The shell prints a prompt and waits for the next input command line.
The executable program 【resides】 on the disk.
A system can get the effect of both a very large memory and a very fast one by 【exploiting】 locality, 【the tendency for 】programs to access data and code in localized regions.
We can think of the operation system as a layer of software 【interposed 】between the application program and the hardware.
This concludes our initial 【whirlwind】 tour of systems.
这些有趣的表达,在中译本会被翻译成什么样呢?
This section is mainly talking about how to represent and manipulate information. And it reveals the relationship between the representation of bits and the implementation of bits . The most important things the author want us to figure out is that casting between signed and unsigned number of different data size.
there is a few key points .
Most Computer use blocks of eight bits, or bytes. Bit operation do not subject(obey) to common mathematical properties, such as associativity, commutativity, and distributivity, which allows compiler to do many optimizations.
two-conventions:
ordering becomes issues
When it comes to Assembly, many programers will stop and get stuck here. And starting to complain about it, like why shall we learn this kind of low-level language, since we can do almost everything by using high-level language like C++, C, Golang. To be honest, I was one of them before I forced my self to go through this obstacle. Now I have a lots of reason telling why we should study Assembly and have a better understanding of it.
This is a difficult chapter I have encountered so far ! not only requiring us to read the book again and again, but also we need to run the assembly code in machine . For my own opinion, this chapter can be break down into a few topic below. we much know the levels of abstraction of different code
This week we skip a few chapter and moved on to chapter 6 the memory hierarchy. The author introduces us a few key concepts, such as the locality of the program and memory hierarchy of storage.
there mainly two kind of ram , (static ram and Dynamic ram) .
SRAM is for Cache memories, but DRAM is for Main memories, frame buffers.
Store operation: movq %rax, A Load operation: movq A, %rax
disk consists of serval parts including actuator、arm、spindle、platters、scsi connector。
there are three kind of object file, .o file and a.out file and .so file .
there are two ways can change the control flow . But it is insufficient for a useful system.
An exception is a transfer of control to the os kernel in response to some event.
it can be classify into two sets: low level mechanisms and higher level mechanisms.
Any topological sort of the graph corresponds to a feasible total ordering
There are three main reason .
结束
Aside
This is the repo I used for keep track of my reading notes of CSAPP book .
I would like to challenge myself to keep notes in english . Because I am reading this book in english version.
And there are a few rules I set up for myself, as the following: