[1] Computer system roaming notes

1. Most machines now have a word length of 4 bytes (32 bits) and 8 bytes (64 bits). ps: So we can get the number of system bits by judging the length of the int type.

2. System hardware composition, as shown below:

 

Bus: A set of electronic conduits that run through the entire system.

I/O device: The channel through which the system communicates with the outside world. (Such as mouse, keyboard, display, and disk.)

Main memory: is a temporary storage device used to store programs and data processed by the program when the processor executes the program.

Processor: is the engine used to execute instructions stored in main memory.

3. The stages (preprocessor, compiler, assembler, and linker) that a program passes through when it is compiled by other programs.

4. The inner workings of loads, stores, operations and jumps performed by the CPU.

Load: Copy a word or byte from main memory to a register, overwriting the original contents of the register.

Store: Copy a word or byte from a register to a location in main memory, overwriting the contents of the original location.

Operation: Copy the contents of the two registers to the ALU (arithmetic/logical unit), the ALU calculates the two, and returns the result to a register, overwriting the contents of the original location.

Jump: Extract a piece of data from the instruction itself, and copy the data to the PC (program counter), overwriting the value at the original location.

5. Run the program.

At the beginning, we input commands from the USB controller, connect the bus interface through the I/O bridge, and the shell program reads the characters into the register one by one, and then puts it into the memory (main memory).

 When we hit enter, the shell knows we're done typing. The shell then loads the executable hello file through a series of instructions and copies the code and data from disk to main memory, containing the final output "hello world".

Finally: when we next visit, we don't need to read from disk, we can read data directly from main memory, which greatly speeds up the efficiency.

6. The importance of cache.

Why don't we get data from disk all the time, but read from main memory?

1. The time overhead for the processor to read a word from disk is 10 million times greater than the overhead of reading from main memory.

2. In order to display the data faster.

3. It is much easier and cheaper to speed up the processor than to speed up the main memory.

7. We can improve program performance by caching the processor.

PS: For example, point A---B needs three -, I add a cache A--+B between AB, + to store the data in B, then the process from point A to point B will be less -;

8. Two basic functions of the operating system:

(1) Prevent hardware from being abused by runaway applications;

(2) Provide applications with a simple and consistent mechanism to control complex and often very different low-level hardware devices.

The operating system implements these two functions through processes, virtual memory, and files.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324971358&siteId=291194637