Computing/Operating System

13 > Main Memory

i독 2021. 11. 15. 02:22

* 해당 게시물은 경북대학교 컴퓨터학부 강의초빙교수, 배준현 교수님의 강의를 보고 작성되었음을 미리 알려드립니다. ( 개인적인 공부를 정리한 글입니다. )

 

> 주니온 TV Youtube Channel.  https://www.youtube.com/channel/UCOcPzXDWSrnaKXse9XOPiog

 

주니온TV 아무거나연구소

TMI Lab. 아무거나 연구소의 유튜브 TMI 지식나눔 채널 컴퓨팅 사고력을 키워 주고 코딩 지능을 길러 주는 자세히 보면 유익한 코딩 채널 주니온TV@Youtube 주니온 박사: 현) 경북대학교 컴퓨터학부 초

www.youtube.com

 

> 주니온 TV Inflearn page.  https://www.inflearn.com/users/@joonion

 

주니온님의 소개 - 인프런 | 온라인 강의 플랫폼

인프런 지식공유자 주니온님의 소개 페이지 입니다. - 지식공유자 소개 | 인프런...

www.inflearn.com


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.

Figure 9.7 Variable partition.

[  ] 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