* 해당 게시물은 경북대학교 컴퓨터학부 강의초빙교수, 배준현 교수님의 강의를 보고 작성되었음을 미리 알려드립니다. ( 개인적인 공부를 정리한 글입니다. )
> 주니온 TV Youtube Channel. https://www.youtube.com/channel/UCOcPzXDWSrnaKXse9XOPiog
> 주니온 TV Inflearn page. https://www.inflearn.com/users/@joonion
A process is a program in execution. To say, a set of instructions kept in a main memory.
A memory consists of a large array of bytes, each with its own address.
CPU fetches instructions from memory using the program counter, and instruction may cause load from and store to the memory.
이 메모리 공간에 어떻게 Process 들을 저장하고 관리할 것인지가 중점.
We need to make sure that each process has a separate memory space.
A pair of registers : base register and limit register.
- provides the ability to determine the range of legal addresses.
Figure 9.2 Hardware address protection with base and limit registers.
[ ] Address Binding
- A program resides on a disk as a binary executable file.
To tun, the program must be brought into memory.
The address of the process does not start at address 00000000.
- Addresses in the source are generally symbolic(상징적인).
- A compiler typically binds symbolic addresses to relocatable addresses.
- A linker or loader in turn binds the relocatable addresses to absolute addresses.
Figure 9.3 Multistep processing of a user program.
[ ] Logical vs Physical Address Space.
논리적 주소는 물리적 주소와 관계가 없다. 따라서 각 공간을 표현하는 방법은 분리되어 있다.
[ ] MMU (Memory Management Unit)
- a hardware device that maps from logical address to physical address.
Figure 9.4 Memory management unit (MMU).
relocation register: a base register in MMU.
Figure 9.5 Dynamic relocation using a relocation register.
[ ] Dynamic Loading.
- It is necessary for the entire program and data to be in physical memory?
이럴 경우 dynamic loading을 해야 한다. 게임 프로그램을 예로 들면, 대부분의 게임은 메모리에 올릴 수 없을 정도로 사용하는 프로그램이 큰 경우가 많다.
Dynamic loading은 필요할 때만 Load 한다.
- The relocatable linking loader is called to load the desired routine and to update the program's address tables to reflect this change.
[ ] Dynamic Linking and Shared Libraries.
- DLLs : Dynamically Linked Libraries. > 프로그램이 실행 중일 때 Linking 되는 Library 파일들을 말한다.
- Static linking: System libraries are treated like any other object module and are combined by the loader into the binary program code.
- Dynamic linking: is similar to dynamic loading.
- Shared library: DLLs are also known as shared libraries, since only one instance of the DLL in main memory can be shared among multiple user processes.
[ ] Contiguous Memory Allocation.
- each process is contained in a single section of memory that is contiguous to the section containing the next process.
전체를 올리기에 연속적인 메모리 구역을 가진다.
[ ] Memory Allocation
hole : a block of available memory.
[ ] The problem of Dynamic Storage Allocation:
- How to satisfy a request of size n from a list of free holes?
- Three types of solutions to this problem
1) First-Fit : allocates the first hold that is big enough. > 순서대로 남은 공간을 탐색하여 들어갈 수 있는 곳에 넣는다.
2) Best-Fit : allocates the smallest hole that is big enough. > hole을 heap으로 관리하면 가장 작은 것부터 찾을 수 있는데, 작은 것부터 넣을 수 있는 곳까지 탐색하여 들어갈 수 있는 곳에 넣는다.
3) Worst-Fit : allocates the largest hole. > hole을 max_heap으로 관리
[★] Fragmentation
빈 공간의 총 용량은 100M지만 너무 잘게 나눠져 어떠한 곳에도 Process를 할당시킬 수 없을 때 단편화가 발생했다고 한다.
external fragmentation > Program이 할당되면서 그 사이에 중간에 사용하지 않는 메모리가 존재하게 되어 낭비되는 경우.
internal fragmentation > Program이 할당될 때, 필요한 용량보다 더 큰 메모리를 할당 받아 사용하지 않는 메모리 공간이 낭비되는 경우
'Computing > Operating System' 카테고리의 다른 글
16 > Page Replacement (0) | 2021.11.15 |
---|---|
14 > Paging, Swaping (0) | 2021.11.15 |
12 > 동기화(4) (0) | 2021.11.15 |
11 > 동기화(3) (0) | 2021.11.15 |
10 > 동기화(2) (0) | 2021.11.15 |