9.4 Protection and Virtual memory Flashcards

1
Q

What does memory protection refer to (what are programs and the kernal allowed to do)

A
  • Ensuring programs do not access other parts of memory
  • Kernel can access anything
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe how memory is protected (ab as)

A
  • Only allowed access to memory in range ab, ab + as
  • ink flag for kernel
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What instructions does the kernel use for managing program memory space protection

A
  • SETAB SETAS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does memory protection change existing data access instructions (safeguarding)

A
  • Conditional check for ink, otherwise check if in range

Works same for branch instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What happens if this code executes on MacOS

A
  • Returns valid pointer (doesn’t work on linux)
  • Would cause errors down the line as computer does not have 10TB
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is virtual memory

A
  • Abstraction such that program thinks there is more memory than available
  • Managed by kernel
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a memory page

A
  • Similar to cache blocks, data is copied from disk to main memory (and vice versa) in pages (set of memory)
  • Doesn’t make sense to just copy accross single word, when often sequential access is needed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do virtual addresses work

A
  • Page table stores actual address (maps virtual to actual incl memory type and address etc.)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some properties of the page table (use, no entries, entry size etc.)

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a page fault

A

When memory is on disk not main memory and needs to be copied (ie cache miss)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is page replacement (eviction)

A

Page is evicted from main memory back to disk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the point of a Translation Lookaside Buffer (TLB)

A

Caches addreses of data (LRU), so no need to consult page table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does protection apply to virtual memory

A

Read, write, execute permission bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly