Virtual memory and paging

Virtual and physical addresses, page and frame, page number and offset, page table, MMU and TLB, present bit, page fault and segmentation fault: translating an address and saying who does what.

  • 28 cards
  • 4 topics
  • Free

The outline, topic by topic

Each topic is weighted the way the exam weighs it.

  1. Concepts
  2. Questions
  3. Sort and link
  4. The numbers

A few cards from the deck

  • Address space: what is it?

    Show the answer

    The set of addresses a process believes it can use, from 0 up to a maximum; each process has its own, and its size does not depend on that of physical memory.

    Two processes can use the same virtual address without seeing each other: it does not designate the same physical memory cells. This is what isolates processes.

  • Pages are 4 KiB. The process reads virtual address 0x3A7C; the page table puts page 3 in frame 9. What is the physical address?

    • 0x9A7C
    • 0x3A79
    • 0x93A7
    • 0x9A73
    Show the answer

    0x9A7C

    4 KiB = 2^12: the last 12 bits (3 hexadecimal digits) form the offset 0xA7C, the rest, 0x3, is the page number. Replace 3 with frame number 9 and keep the offset: 0x9A7C.

  • A virtual address splits into a …, used as an index into the page table, and an …, which is copied unchanged into the physical address.

    Show the answer

    A virtual address splits into a page number, used as an index into the page table, and an offset, which is copied unchanged into the physical address.

    Only the page number is translated into a frame number; the position within the page does not change, since page and frame have the same size.

  • Virtual memory: what is it?

    Show the answer

    The mechanism that gives each process addresses of its own, translated at every access into physical memory addresses, and that lets part of the data stay on disk.

    The program only handles virtual addresses; the hardware translates them into physical ones using the tables the kernel maintains.