1 / 24

Paging & Segmentation

제 11 강 : Paging 과 Segmentation. Paging & Segmentation. 프로그램이 크다면 ?. Swapping Overlay 비연속 할당기법. 운영체제. 프로그램 A. 프로그램 B. 프로그램 C. 빈 공간 List. MMU CPU 에서 Memory 로 가는 주소를 바꿔친다. memory. CPU 가 보낸 주소를 MMU 가 변환 (Memory Management Unit). Add 10, 20 10 : 100 20 : 330 Jump 30

rozene
Télécharger la présentation

Paging & Segmentation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 제11강 : Paging과 Segmentation Paging &Segmentation

  2. 프로그램이 크다면? • Swapping • Overlay • 비연속 할당기법 운영체제 프로그램 A 프로그램 B 프로그램 C 빈 공간 List

  3. MMUCPU에서 Memory로 가는 주소를 바꿔친다

  4. memory CPU가 보낸 주소를 MMU가 변환(Memory Management Unit) Add 10, 20 10: 100 20: 330 Jump 30 30: exit Add A, B A: 100 B: 330 Jump C C: exit 500 10 Mapping 논리적 주소 실제 주소 Source Binary

  5. 만일 mapping table이 있다면 10 번지를 아무 곳으로나 (anytime, anyplace) memory CPU가 보낸 주소를 MMU가 변환(Memory Management Unit) Add 10, 20 10: 100 20: 330 Jump 30 30: exit Add A, B A: 100 B: 330 Jump C C: exit 500 10 Mapping 논리적 주소 실제 주소 Source 프로그램 running 도중에 옮겨도 된다 load 해도 된다 Binary Any time Any place

  6. Memory Management Unit Memory 500: 10 CPU 10 maps to 500 실제 memory 내 주소 physical CPU가 제시한 주소 logical

  7. Paging –동일한 크기 Memory 500: 10 CPU 10 maps to 500 실제 memory 내 주소 physical CPU가 제시한 주소 logical

  8. Memory 500: 10 CPU 10 maps to 500 실제 memory 내 주소 physical CPU가 제시한 주소 logical Segmentation –모두 다른 크기

  9. Logical vs. Physical Address Space • Logical address • CPU(프로세스)가 제시한 주소 • “virtual address”. • Physical address • 메모리에 실제로 전달되는 주소.

  10. Paging

  11. Disk Paging Memory • page • page frame • 전체 executable binary은 disk에 • CPU가 참조하는 page만 메모리로 page frame page

  12. Paging아무 page frame에도 올라온다 Memory MMU 500: 10 500 CPU 10 maps to 500 실제 memory 내 주소 physical CPU가 제시한 주소 logical Disk 10 page

  13. address from CPU CPU가 제시한 주소 logical 10 p d page number displacement (offset)

  14. address from CPU CPU가 제시한 주소 logical 10 p d page number displacement (offset) 실제 메모리 주소 physical p p’

  15. + address from CPU CPU가 제시한 주소 logical 10 p d page number displacement (offset) 실제 메모리 주소 physical p 500 p’ d p’

  16. + Page Table Base Register Page Table Limit Register address from CPU CPU가 제시한 주소 logical 10 p d page number displacement (offset) 실제 메모리 주소 physical p 500 p’ d p’

  17. + Page Table Entry 10 p d page number displacement (offset) p R rwx page frame sector addr 500 p’ Resident bit

  18. Paging 의 장단점 • 장점 • 외부 단편화 현상이 안 생긴다. • 단점 • 페이지 테이블 공간(table fragmentation) • MMU 하드웨어가 필요 • 할당된 마지막 페이지에서 내부단편화

  19. Segmentation

  20. int A[ ][ ]; main() { ---- } add() { ---- } A[][] data rw main() code x add() code x stack data rwa

  21. Disk Segment Memory • 전체 executable binary은 disk에 • cpu가 참조하는 segment만 메모리로 page

  22. 아무 공간에도 올라온다Placement – First-fit, Best-fit, Worst-fit… Memory MMU 500: 10 500 CPU 10 maps to 500 실제 memory 내 주소 physical CPU가 제시한 주소 logical Disk 10 Holes

  23. + address from CPU CPU가 제시한 주소 logical 10 s d segment number displacement (offset) 실제 메모리 주소 physical s 500 s’ d s’

  24. Segment Table Entry R length rwxa s’ sector addr Resident bit

More Related