Timedora
Free Practice Quiz Question List

Vm Online Quiz Questions

Use this free practice quiz with 20 questions to review Vm, test your knowledge, and prepare for your next test or exam.

20 questions
01
Choose one
1 point

How do virtual address spaces and hardware address translation give processes an isolated view of memory?

  1. A

    Every process uses the same physical addresses directly, and the OS prevents overlap by assigning unique addresses.

  2. B

    Each process has its own virtual address space, and hardware translates its addresses to physical memory using its page table.

  3. C

    Each process receives a separate physical memory device.

  4. D

    Processes avoid conflicts by choosing virtual addresses that no other process uses.

02
Choose all
1 point

Select all statements that correctly describe how virtual memory can enable processes to share physical memory.

  1. A

    Virtual addresses in different processes can map to the same physical address.

  2. B

    Processes needing the same BB bytes of data can share those physical bytes instead of keeping a separate copy for each process.

  3. C

    Processes can share a read-only memory region containing library code.

  4. D

    Processes can communicate through a memory region that they share.

03
True or false
1 point

True or false: A page fault always means that the accessed page was swapped out to disk.

  1. A

    True

  2. B

    False

04
Written response
1 point

What is the name of the special on-chip cache that stores page-table information to reduce address-translation costs?

05
Fill in the blank
1 point

During a context switch, the OS sets the RISC-V register to the physical address of the incoming process’s page table, which the MMU then uses for address translation.

06
Open ended
1 point

Explain how the valid bit and the R, W, and X protection bits in a page-table entry govern access to a virtual page. Include the purpose of the W^X restriction.

07
Choose one
1 point

For a system with 4 kB pages, a virtual address has VPN vv and offset oo, and the page table maps vv to PPN pp. Which expression gives the physical address?

  1. A

    PPN×212+offset\text{PPN} \times 2^{12} + \text{offset}

  2. B

    VPN×212+offset\text{VPN} \times 2^{12} + \text{offset}

  3. C

    PPN×212+VPN\text{PPN} \times 2^{12} + \text{VPN}

  4. D

    PPN×212\text{PPN} \times 2^{12}

08
Choose all
1 point

Select all statements that correctly explain dense page-table space costs and how multi-level page tables can help with sparse virtual address spaces.

  1. A

    A dense page table stores entries for every virtual page, including invalid pages.

  2. B

    A multi-level page table can reduce wasted space when allocated pages are scattered across a large virtual address space.

  3. C

    A multi-level page table stores a separate entry for every byte rather than every page.

  4. D

    A multi-level page table is a tree-shaped alternative that can provide sparsity benefits at lower cost than the described hash-table approach.

09
True or false
1 point

True or false: When a program maps a file into memory, the entire file must be read into physical memory immediately, before the program accesses the mapped region.

  1. A

    True

  2. B

    False

10
Written response
1 point

What is the name of the RISC-V register that the OS sets during a context switch to identify the active page table?

11
Fill in the blank
1 point

Processors use a to cache page-table information and reduce the cost of address translation.

12
Choose one
1 point

A Unix program uses mmap to associate a virtual-memory region with a file. Which statement best describes how the file's contents become available to the program?

  1. A

    The entire file must be read into main memory before the program can use the mapped region.

  2. B

    The OS loads file pages on demand as the program accesses the mapped region.

  3. C

    The program receives the file's physical disk addresses and reads the disk directly.

  4. D

    The mapped region contains only a duplicate of the file created when the program starts.

13
True or false
1 point

A tree-shaped multi-level page table can reduce the space cost of representing a sparse virtual address space compared with a dense table.

  1. A

    True

  2. B

    False

14
Written response
1 point

For a 4,096-byte page, how many bits are used for the offset within the page?

15
Choose one
1 point

How do virtual address spaces and hardware translation let two processes use the same virtual address without necessarily referring to the same data?

  1. A

    The OS assigns every process a permanently separate range of physical addresses, and programs use those physical addresses directly.

  2. B

    Programs in all processes use the same page table, which makes identical virtual addresses refer to the same data.

  3. C

    Each process has its own virtual address space, and hardware translates its virtual addresses using that process's page table.

  4. D

    The MMU changes each program's virtual addresses before the program executes its memory instructions.

16
True or false
1 point

Virtual addresses in different processes can map to the same physical memory, allowing the processes to share data.

  1. A

    True

  2. B

    False

17
Written response
1 point

What event occurs when a process accesses an invalid virtual page and control is transferred to the kernel?

18
Choose one
1 point

A program tries to store data to a page whose W protection bit is zero. What does the page-table protection setting indicate?

  1. A

    The R bit, which determines whether a page is mapped.

  2. B

    The W bit, which determines whether a page can be written.

  3. C

    The X bit, which determines whether a page can be read.

  4. D

    The valid bit, which determines whether instructions may execute on a page.

19
Written response
1 point

Which single-letter R/W/X protection bit controls whether a process may write to a page?

20
Choose one
1 point

What is the role of a translation lookaside buffer (TLB) in address translation?

  1. A

    A special on-chip cache for page-table information.

  2. B

    A disk area where the OS stores pages that have been swapped out.

  3. C

    A register holding the physical address of the active page table.

  4. D

    A tree-shaped structure that stores page-table entries only for allocated pages.