读书笔记(Linux命令行与shell脚本编程大全(第3版))

时间:2021-11-30 14:28:11

 

总:

Linux可划分为以下四部分:Linux内核、GNU工具、图形化桌面环境、应用软件;

读书笔记(Linux命令行与shell脚本编程大全(第3版))

          Linux系统

Linux系统的核心是内核,内核控制着计算机系统上的所有硬件和软件,在必要时分配硬件,并根据需要执行软件;

一:

内核主要负责以下四种功能:系统内存管理、软件程序管理、硬件设备管理、文件系统管理

系统内存管理:

内核不仅管理服务器上的可用物理内存,还可以创建和管理虚拟内存(即实际并不存在的内存);内核通过硬盘上的存储空间来实现虚拟内存,这块区域称为交换空间(swap space);

内核不断地在交换空间实际的物理内存之间反复交换虚拟内存中的内容;

虚拟内存:硬盘空间来充当内存使用;

交换空间:swap space是磁盘上的一块区域,可以是一个分区,也可以是一个文件,或者是他们的组合。简单点说,当系统物理内存吃紧时,Linux会将内存中不常访问的数据保存到swap上,这样系统就有更多的物理内存为各个进程服务,而当系统需要访问swap上存储的内容时,再将swap上的数据加载到内存中,这就是我们常说的swap out和swap in。

virtual memory is a combination of RAM and disk space that running processes can use.

Swap space is the portion of virtual memory that is on the hard disk, used when RAM is full.

 

虚拟内存的定义:

Virtual memory is a layer of abstraction provided to each process. The computer has, say, 2GB of physical RAM, addressed from 0 to 2G. A process might see an address space of 4GB, which it has entirely to itself. The mapping from virtual addresses to physical addresses is handled by a memory management unit, which is managed by the operating system. Typically this is done in 4KB "pages".

This gives several features:

  1. A process can not see memory in other processes (unless the OS wants it to!)
  2. Memory at a given virtual address may not be located at the same physical address
  3. Memory at a virtual address can be "paged out" to disk, and then "paged in" when it is accessed again.