티스토리 뷰

### Memory Management Unit(MMU) ###

: virtual address(logical address) 에서 physical address로 run-time mapping을 수행하는 하드웨어 장치

 

출처: Operating System Concepts 10th Ed (John Wiley & Sons, Inc. 2018) ​

 

 

+

: base register은 relocation register라고도 한다.

: relocation register으로 logical address을 physical address로 변환 시킨다.

(physical address에 바인딩 된 logical address)

: relocation register의 값은 메모리로 전송 될 때 user 프로세스에 의해 생성된 모든 주소에 추가된다.

: user 프로그램은 logical address를 처리한다.( rear physical address를 보지 못한다.)

: Execution-time binding은 메모리의 위치를 참조 할 때 발생한다.

 

출처: Operating System Concepts 10th Ed (John Wiley & Sons, Inc. 2018) ​

 

(process전체가 자신에게 할당된 memory space에 적재된다는 전재가 있었지만 사실

1. process 크기 문제 => process 크기는 큰데 memory 크기는 작아서 process는 memory에 적재할 수 없는 문제

 

2. 리소스 이용 효율성 => process을 구성하는 routine이 100% 활성화가 되는 것이 아니다.

=> memory 크기 크지만 차지하는 memory는 가끔 있다. 이런 문제를 해결하기 위해 Dynamic loading을 사용한다.)

== >> ### Dynamic loading ###

: 프로그램 내에 위치한 각 routine에 대해서 실제 call이 발생하기 전까지 memory에 적재 X

(해당 routine들에 대해서 relocatable한 load format으로 disk에 상주만 시키는 것

-> relocatable linking loader가 해당 routine을 memory로 올린다

-> 별도로 관리하는 table에 해당 routine 정보를 입력해서 관리하는 것)

=> 실제 작업을 수행하는 routine만 memory에 올린다 => memory이용률 향상

: physical 메모리 크기의 한계를 극복하기 위해 dynamic loading의 개념으로 사용할 수 있다.

: 실행하려면 전체 프로그램이 메모리에 있어야 한다.

: dynamic loading에서는 routine이 호출 될 때 까지 routine이 load되지 않는다.

: 모든 routine은 재배치 가능한 load 형식으로 디스크에 보관된다.

: dynamic loading의 장점은 routine이 필요할 때 로드 된다.

: dynamic loading방법은 error routine과 같이 자주 발생하지 않는 경우를 처리하기 위해 많은 양의 코드가 필요한 경우에 특히 유용하다.

### Dynamic Linking ###

< Linking >

: 프로그램 작성해서 compile 하면 object file 생성된다.

-> object file에 대해서 미리 작성한 library file을 연결하여 하나의 executable file(실행 파일) 을 만들어 주는 것

- < Static linking >

: binary program image에서 loader에 의해 결합된 system libraries and program code

: executable file을 만들때 compile을 수행한 후 library file를 미리 linking시켜준다.

(memory에 적재 되기 전에 executable file내의 library file이 이미 포함 되어져 있다

=> 메모리 공간이 부족)

- < Dynamic linking >

: process가 memory 적재된 이후에 executable file에 library file을 linking한다.

(executable file 내부에 library file 없다, Dynamic linking 사용시 linking이 execution time까지 연기된다.)

=> 메모리 효율성 높일 수 있다.

: stub은 executable file에 있어 library file을 호출할 때 library routine의 memory 주소 값을 찾아볼수 있도록 하는 것 (자신을 routine주소로 바꾸고 routine을 실행한다.)

: dynamically linked libraries(DLLs)은 shared libraries라고도 한다.

반응형
공지사항
최근에 올라온 글