SLIDE 1
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 - - 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 2
SLIDE 3
Program A Stack Data Text Heap Program B Stack Data Text Heap
SLIDE 4
Program A Stack Data Text Heap Program B Stack Data Text Heap Physical Memory Text Text
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 7
- ○
SLIDE 8
- ○
SLIDE 9
- ○
SLIDE 10
SLIDE 11
- ○
○ ■ ○ ■
- ○
- ○
○ ○
SLIDE 12
SLIDE 13
SLIDE 14
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 17
SLIDE 18
- ○
- ○
SLIDE 19
SLIDE 20
- ○
○
SLIDE 21
SLIDE 22
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
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 26
- ○
- ○
- ○
○
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
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
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 31
- ○
SLIDE 32
- ○
- ○
○ ○ ○ ○
SLIDE 33
- ○
○ ○
SLIDE 34
SLIDE 35
SLIDE 36
SLIDE 37
x86:
- Addresses have 32 bits
32 bits
SLIDE 38
x86:
- Addresses have 32 bits
DIR TABLE OFFSET 10 12 10
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
x86:
- Addresses have 32 bits
- Frames and pages are 4KiB
DIR TABLE OFFSET
DIR
10 12 10 4KiB 1024 entries PTBR
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
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
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
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
DIR TABLE OFFSET
DIR
4KiB 1024 entries
TABLE
PTBR
Physical Memory Frame
4KiB 1024 entries TLB
SLIDE 46
DIR TABLE OFFSET
DIR
4KiB 1024 entries
TABLE
PTBR
Physical Memory Frame
4KiB 1024 entries TLB
SLIDE 47
SLIDE 48
- ○
○ ○ ■ ■
- ○
SLIDE 49
SLIDE 50
- ○
SLIDE 51
- ○
- ○
○ ○
SLIDE 52
- ○
○ ○ ■ ■
- ○
SLIDE 53
SLIDE 54
- ○
SLIDE 55
SLIDE 56
SLIDE 57
- ○
○
- ○
○ ○
- ○
SLIDE 58
SLIDE 59
- ○
- ○
- ○
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 62
- ○
- ○
- ○