Stack Stack Heap Heap Data Data Text Text Program A Program - - PowerPoint PPT Presentation

stack stack heap heap data data text text program a
SMART_READER_LITE
LIVE PREVIEW

Stack Stack Heap Heap Data Data Text Text Program A Program - - PowerPoint PPT Presentation

Stack Stack Heap Heap Data Data Text Text Program A Program B Stack Stack Text Heap Heap Data Data Text Text Text Program A Program B Physical Memory Stack Stack Stack Heap Stack Kernel Heap Heap Data Heap Data


slide-1
SLIDE 1
slide-2
SLIDE 2
slide-3
SLIDE 3

Program A Stack Data Text Heap Program B Stack Data Text Heap

slide-4
SLIDE 4

Program A Stack Data Text Heap Program B Stack Data Text Heap Physical Memory Text Text

slide-5
SLIDE 5

Program A Stack Data Text Heap Program B Stack Data Text Heap Physical Memory Text Data Heap Stack Text Data Heap Stack Kernel

slide-6
SLIDE 6
slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11

○ ■ ○ ■

○ ○

slide-12
SLIDE 12
slide-13
SLIDE 13
slide-14
SLIDE 14
slide-15
SLIDE 15

Vim 1 Stack Data Vim Heap/File Vim 2 Stack Data Vim Heap/File Physical Memory Kernel Vim Data Data Heap/File Heap/File Stack Stack

slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20

slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23

4KiB-aligned Page Address G S W A D T U R P Avail 1 2 3 4 5 6 7 8 9 1 1 1 1 2 3 1

  • Available: Free for the OS to use. If P is unset, all bits are available.
  • G: If 1, page is global and TLB will not update it.
  • S: If 1, this is a 4MiB page, otherwise a 4KiB page.
  • W: If 1, page has been written to.
  • A: If 1, page has been read or written to. (OS is responsible for clearing the bit.)
  • D: If 1, disable caching.
  • T: If 1, page is write-through, otherwise write-back.
  • U: If 1, page is user-accessible, otherwise only supervisor-accessible.
  • R: If 1, page is read-write, otherwise it is read-only.
  • P: If 1, page is in memory, otherwise it is not (page fault).
  • Items in red are specific to page directory entries (1st level).
  • Items in blue are specific to page table entries (2nd level).
slide-24
SLIDE 24

4KiB-aligned Page Address G S W A D T U R P Avail 1 2 3 4 5 6 7 8 9 1 1 1 1 2 3 1

  • Available: free for the OS to use. If P is unset, all bits are available.
  • G: If 1, page is global and TLB will not update it.
  • S: If 1, this is a 4MiB page, otherwise a 4KiB page.
  • W: If 1, page has been written to.
  • A: If 1, page has been read or written to. (OS is responsible for clearing the bit.)
  • D: If 1, disable caching.
  • T: If 1, page is write-through, otherwise write-back.
  • U: If 1, page is user-accessible, otherwise only supervisor-accessible.
  • R: If 1, page is read-write, otherwise it is read-only.
  • P: If 1, page is in memory, otherwise it is not (page fault).
  • Items in red are specific to page directory entries (1st level).
  • Items in blue are specific to page table entries (2nd level).
slide-25
SLIDE 25

slide-26
SLIDE 26

slide-27
SLIDE 27

P1 Stack Data Vim Heap/File P2 Stack Vim Heap/File Physical Memory Sh R Page Table Page Table Sh RX Sh RX RW RW RW RW Write Data

slide-28
SLIDE 28

P1 Stack Data Vim Heap/File P2 Stack Vim Heap/File Physical Memory Sh R Page Table Page Table Sh RX Sh RX RW RW RW RW Write Copy Data

slide-29
SLIDE 29

P1 Stack Data Vim Heap/File P2 Stack Vim Heap/File Physical Memory Sh R Page Table Page Table Sh RX Sh RX RW RW RW RW Write Copy Data Update reference counter

slide-30
SLIDE 30
slide-31
SLIDE 31
slide-32
SLIDE 32

○ ○ ○ ○

slide-33
SLIDE 33

○ ○

slide-34
SLIDE 34
slide-35
SLIDE 35
slide-36
SLIDE 36
slide-37
SLIDE 37

x86:

  • Addresses have 32 bits

32 bits

slide-38
SLIDE 38

x86:

  • Addresses have 32 bits

DIR TABLE OFFSET 10 12 10

slide-39
SLIDE 39

x86:

  • Addresses have 32 bits
  • Frames and pages are 4KiB

DIR TABLE OFFSET

DIR

10 12 10 4KiB 1024 entries PTBR

slide-40
SLIDE 40

x86:

  • Addresses have 32 bits
  • Frames and pages are 4KiB

DIR TABLE OFFSET

DIR

10 12 10 4KiB 1024 entries PTBR

slide-41
SLIDE 41

x86:

  • Addresses have 32 bits
  • Frames and pages are 4KiB
  • Each page table entry has 32bits

DIR TABLE OFFSET

DIR

10 12 10 4KiB 1024 entries

TABLE

PTBR 4KiB 1024 entries

slide-42
SLIDE 42

x86:

  • Addresses have 32 bits
  • Frames and pages are 4KiB
  • Each page table entry has 32bits

DIR TABLE OFFSET

DIR

4KiB 1024 entries

TABLE

PTBR 4KiB 1024 entries

slide-43
SLIDE 43

x86:

  • Addresses have 32 bits
  • Frames and pages are 4KiB
  • Each page table entry has 32bits

DIR TABLE OFFSET

DIR

4KiB 1024 entries

TABLE

PTBR

Physical Memory Frame

4KiB 1024 entries

slide-44
SLIDE 44

x86:

  • Addresses have 32 bits
  • Frames and pages are 4KiB
  • Each page table entry has 32bits

DIR TABLE OFFSET

DIR

4KiB 1024 entries

TABLE

PTBR

Physical Memory Frame

4KiB 1024 entries

slide-45
SLIDE 45

DIR TABLE OFFSET

DIR

4KiB 1024 entries

TABLE

PTBR

Physical Memory Frame

4KiB 1024 entries TLB

slide-46
SLIDE 46

DIR TABLE OFFSET

DIR

4KiB 1024 entries

TABLE

PTBR

Physical Memory Frame

4KiB 1024 entries TLB

slide-47
SLIDE 47
slide-48
SLIDE 48

○ ○ ■ ■

slide-49
SLIDE 49
slide-50
SLIDE 50
slide-51
SLIDE 51

○ ○

slide-52
SLIDE 52

○ ○ ■ ■

slide-53
SLIDE 53
slide-54
SLIDE 54
slide-55
SLIDE 55
slide-56
SLIDE 56
slide-57
SLIDE 57

○ ○

slide-58
SLIDE 58
slide-59
SLIDE 59
slide-60
SLIDE 60

4KiB-aligned Page Address G S W A D T U R P Avail 1 2 3 4 5 6 7 8 9 1 1 1 1 2 3 1

  • Available: free for the OS to use. If P is unset, all bits are available.
  • G: If 1, page is global and TLB will not update it.
  • S: If 1, this is a 4MiB page, otherwise a 4KiB page.
  • W: If 1, page has been written to.
  • A: If 1, page has been read or written to. (OS is responsible for clearing the bit.)
  • D: If 1, disable caching.
  • T: If 1, page is write-through, otherwise write-back.
  • U: If 1, page is user-accessible, otherwise only supervisor-accessible.
  • R: If 1, page is read-write, otherwise it is read-only.
  • P: If 1, page is in memory, otherwise it is not (page fault).
  • Items in red are specific to page directory entries (1st level).
  • Items in blue are specific to page table entries (2nd level).
slide-61
SLIDE 61
slide-62
SLIDE 62