1 / 27

GDT 를 알아보자 !!!!

GDT 를 알아보자 !!!!. 세그먼트 레지스터 너가 하는 일이 도대체 뭐냐 ?. CS. DS. SS. ES. FS. GS. Real Mode 에서 세그먼트는. Segment(16bit). . 4 bit Shift. +. 16bit Offset. 20bit 주소 (1M). 보호모드에서는 …. GDT Global Descriptor Table. CS. DS. SS. ES. FS. 그렇다면 …GDT 는 뭐까 ?. 메모리 설명서인것이다 . 이 설명서 안에는

jarvis
Télécharger la présentation

GDT 를 알아보자 !!!!

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. GDT를 알아보자!!!!

  2. 세그먼트 레지스터너가 하는 일이도대체 뭐냐? CS DS SS ES FS GS

  3. Real Mode에서 세그먼트는. Segment(16bit)  4 bit Shift + 16bit Offset 20bit 주소(1M)

  4. 보호모드에서는… GDT Global Descriptor Table CS DS SS ES FS

  5. 그렇다면…GDT는 뭐까? 메모리 설명서인것이다. 이 설명서 안에는 각 세그먼트가 접근 할 수 있는 시작위치 접근 가능한 범위 접근할 수있는권한 등이 적혀 있다. 시작위치(Base Address) Descriptor(NULL) Descriptor 범위(limit) . . . 8192개 . 권한(DPL) Descriptor

  6. Segment Descriptor설명서안에는 다음내용이 적혀 있다. 시작 위치 범위 권한 기타.. 등등

  7. 시작위치 Base Address 63 -------- 56 39 ------- 16 시작위치(31~24) 시작위치 (23~0) 왜? 이렇게 나뉘어져 있나??? 비효율적이게--;

  8. 범위 Limit Bits 51------ 48 63 -------- 56 39 ------- 16 15 ------ 0 시작위치(31~24) 범위 (19~16) 시작위치 (23~0) 범위 (15~0) 어라~ 이것도 분단되어 있네

  9. 접근권한 (DPLDescriptor Privilege Level) 51------ 48 63 -------- 56 46---45 39 ------- 16 15 ------ 0 시작위치(31~24) 범위 (19~16) DPL 시작위치 (23~0) 범위 (15~0)

  10. Segment descriptor자세히보기 BaseBits 31-24 G D X U Limit Bits 19-16 P DPL S Type Base Bits 23-0 Limit Bits 15-0

  11. 286 Descriptor와 비교 출처: http://www.x86.org/articles/pmbasics/

  12. 세그먼트 레지스터 모양16비트 15 4 3 2 0 Index (13bit)  8192개 TI (1bit) RPL (3bit) 이 인덱스가 GDT의 Descriptor의 Index

  13. Ntddk.h에 정의된 세그먼트

  14. Ntddk.h에 정의된 세그먼트 15 4 3 2 0 1(index) 0 00

  15. Ntddk.h에 정의된 세그먼트 15 4 3 2 0 11(3) index 0 00

  16. 응용프로그램에서 세그먼트값확인

  17. 응용프로그램 CS =1B면…어떻게 해석해??? 15 4 3 2 0 11(index-3) 0(GDT) 11 (RPL-Ring 3)

  18. 응용프로그램 CS =1B면…어떻게 해석해??? 15 4 3 2 0 11(index-3) 0(GDT) 11 (RPL-Ring 3)

  19. 응용프로그램 DS =23면…어떻게 해석해??? 15 4 3 2 0 100(index-4) 0(GDT) 11 (RPL-Ring 3)

  20. 응용프로그램 DS =23면…어떻게 해석해??? 15 4 3 2 0 100(index-4) 0(GDT) 11 (RPL-Ring 3)

  21. FS =3B면…어떻게 해석해??? 15 4 3 2 0 111(index-5) 0(GDT) 11 (RPL-Ring 3)

  22. 커널 모드에서 세그먼트값 확인

  23. CS 가 8이면… 15 4 3 2 0 1(index-1) 0(GDT) 00 (RPL-Ring 0)

  24. 커널 모드에서 세그먼트값 확인 15 4 3 2 0 1(index-1) 0(GDT) 00 (RPL-Ring 0)

  25. 프로텍티드모드에서 세그멘테이션에 대해서 알겠는가?이렇게 해서 선형주소를 만든것이다.

  26. 정리해봅시다. GDT Segment Register CS : 0x1b  11(index-3) 0(GDT) 11(RPL-Ring 3) 시작위치(31~24) 범위 (19~16) 시작위치 (23~0) 범위 (15~0) 시작위치 Base Addr : 0x00000000 가상주소 Virtual Addr : 0x1000000 Linear Address 0x1000000

More Related