Last Sync: 2022-09-03 12:00:04
This commit is contained in:
parent
4001fb13af
commit
ce4291015b
2 changed files with 22 additions and 2 deletions
10
Linux/Procedural/Shell_cheat_sheet.md
Normal file
10
Linux/Procedural/Shell_cheat_sheet.md
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
categories:
|
||||||
|
- Linux
|
||||||
|
- Programming Languages
|
||||||
|
tags: [shell]
|
||||||
|
---
|
||||||
|
|
||||||
|
# Linux shell commands cheat-sheet
|
||||||
|
|
||||||
|
## CPU
|
|
@ -13,14 +13,24 @@ Virtual memory is implemented at the level of the operating system and is an abs
|
||||||
|
|
||||||
When virtual memory is used, the CPU handles physical memory allocation and presents this to the kernel as an idealised representation. This means that the kernel and, by extension, programs and processes do not need to think about accessing the real memory blocks. This reduces complexity because often memory will be allocated in places that are non-contiguous with similar running processes or be located in the cache or swap memory on the disk.
|
When virtual memory is used, the CPU handles physical memory allocation and presents this to the kernel as an idealised representation. This means that the kernel and, by extension, programs and processes do not need to think about accessing the real memory blocks. This reduces complexity because often memory will be allocated in places that are non-contiguous with similar running processes or be located in the cache or swap memory on the disk.
|
||||||
|
|
||||||
It would take considerable processing workd for the kernel to be tracing these disparate memory sources at every instance. By working on an idealised (contiguous, unlimited) memory set the kernel can focus on task management and CPU sequencing as its primary task.
|

|
||||||
|
|
||||||
|
It would require considerable processing work for the kernel to be tracing these disparate memory sources at every instance. By working on an idealised (contiguous, unlimited) memory set the kernel can focus on task management and CPU sequencing as its primary task.
|
||||||
|
|
||||||
The memory is idealised in that all locations are represented virtually as being contiguous (even when this is not physically the case). Secondly, quantities of available memory can be presented as much larger than is actually the case and which often exceed the physical memory limits of the device. This is achieved through paging, handled by the MMU.
|
The memory is idealised in that all locations are represented virtually as being contiguous (even when this is not physically the case). Secondly, quantities of available memory can be presented as much larger than is actually the case and which often exceed the physical memory limits of the device. This is achieved through paging, handled by the MMU.
|
||||||
|
|
||||||
## The Memory Management Unit (MMU)
|
## The Memory Management Unit (MMU)
|
||||||
|
|
||||||
Without an MMU, when the CPU accesses RAM, the actual RAM locations never change. The memory address is always the same physical location within the RAM. The MMU is a chip that sits within the CPU and RAM recalculating the actual memory address from the virtual memory location requested by the kernel.
|
Without an MMU, when the CPU accesses RAM, the actual RAM locations never change. The memory address is always the same physical location within the RAM. The MMU is a chip that sits between the CPU and RAM recalculating the actual memory address from the virtual memory location requested by the kernel.
|
||||||
|
|
||||||
## Pages
|
## Pages
|
||||||
|
|
||||||
We use the term **pages** to denote blocks of virtual memory and to distinguish them from **addresses** as physical blocks. The MMU possesses a **page table** which is registry logging which pages correspond to which physical blocks.
|
We use the term **pages** to denote blocks of virtual memory and to distinguish them from **addresses** as physical blocks. The MMU possesses a **page table** which is registry logging which pages correspond to which physical blocks.
|
||||||
|
|
||||||
|
## Shared pages
|
||||||
|
|
||||||
|
Virtual memory allows the sharing of files and memory by multiple processes. Crucially the shared data doesn't have to be within the address of each process, instead there is a reference in the page table that each process has access to the shared data.
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
[Virtual memory](https://www.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/9_VirtualMemory.html#:~:text=Virtual%20memory%20also%20allows%20the,to%20more%20than%20one%20process)
|
||||||
|
|
Loading…
Add table
Reference in a new issue