其实我们的操作系统也可以理解为一个虚拟机,因为他是把硬件资源虚拟成文件系统可以识别使用的程序
The swap partition for Linux is also equivalent to Windows virtual memory:
Computer three major key:
1, Cpu:time Slice
2. Memory:
3. I/O device:
Cpu:time Slice
I/O devices
Memory Work Model
If the memory is 4G, then each process realizes that it is 4G available (for 32bitcpu),
x86 introduces a virtual address, also known as the concept of a linear address
Memory is stored in the page frame.
当物理内存将要被占满的时候(进程一直认为自己是有4g的内存可用,所以不断的索取),但是被占满之后是不能再存储了,这时候就使用到了swap空间了
Part of the hard disk storage space allocated a certain simulation page box, go to storage memory using the fewest page box, and then in real physical memory to store user operation new process. , and then after use, the hard disk will still return to the memory, this is the swap out (so that performance will fall a lot) (page out, page in) process.
So swap can be used as an emergency, and if memory is enough, it won't.
Swap partition (must be a separate partition): Swap space:
Allow memory can be overloaded use, although performance will fall a lot, but this swap partition is necessary, otherwise really not enough, then direct Linux system down, the system is very bad
Actually put into the swap partition, but the actual CPU read or take from the memory, do not go directly to the swap partition to operate, so that the swap partition only satisfies the real physical partition is not enough, temporary storage only.
Access Access: Speed
1, Register 1NM
2. Cache 10nm
3, Memory 100nm
4. Swap partitions in seconds
Basic principles of Linux:
1, by the purpose of a single small program composition: The combination of small programs to complete complex tasks
2, all documents (even the access to the device is a file):
3, try to avoid capturing the user interface (is very little and user interaction):
For example, LS directly has output, such as ifconfig, direct output, do not need to interact
4. The configuration file is saved in plain text format:
So write a service that can be fully implemented with plain text configuration
The shell is a human-computer interface:
GUI接口:CLI接口:
Command prompt, prompt (prompt), bash (shell)
#:root
$: Normal User
Any command that you want to execute must have an execution entry, like Java execution has a main function as a portal,
C language is also
The interface we normally knock on commands is the Bash shell interface.
7. Memory knowledge and Linux Basic principles