18. Introduction to Paging Flashcards

1
Q

What are page frames?

A

An array of fixed-sized slots in the physical memory

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

What is a page?

A

A fixed-size unit of memory

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

What is a page table?

A

A per-process data structure that store address translations of virtual pages to physical pages

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

How does address translation in pages work?

A

We have two components: Virtual Page Number (VPN) and offset

The VPN is to indicate which page number is it
The offset points to the specific entry of the chosen page

All we have to do it replace the VPN with the Physical Page Number (PPN) and use the offset to read the data.

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

What is page table entry (PTE)?

A

One entry in the page table that indicates the translation between virtual pages to physical pages. Typically 4KB.

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

How to calculate the VPN and offset bit sizes.

A

Address space divided by page size = VPN

Eg. 32 bit = 2 ^ 32 size, 4KB = 4096 size = 12 bit

Therefore, VPN size is 20 bits and offset is 12 bits (32 - 20)

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

What are the components of a page table entry (PTE)?

A
  1. Translation from virtual address to physical frame
  2. Valid bit - indicates whether a particular translation is valid. (Unused entries will be indicated as invalid)
  3. Protection bit - indicates whether the page can be read from, written to, or executed from
  4. Present bit - indicates whether the page has been swapped out
  5. Dirty bit - indicates whether the page has been modified since it was brought into the memory
  6. Reference bit - indicates whether the page has been referenced in the past and should be cached
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the advantages of paging?

A
  1. Does not lead to external fragmentation
  2. Flexible enough to enable the sparse use of virtual addresses
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the disadvantages of paging?

A
  1. Slower - more memory access
  2. Memory waste - need to store page table data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly