Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

24 Questions on Computer Systems Engineering - Midterm Exam 2 | ECE 391, Exams of Electrical and Electronics Engineering

Material Type: Exam; Class: Computer Systems Engineering; Subject: Electrical and Computer Engr; University: University of Illinois - Urbana-Champaign; Term: Fall 2007;

Typology: Exams

Pre 2010

Uploaded on 03/11/2009

koofers-user-8lw
koofers-user-8lw 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE391: Computer Systems Engineering Fall 2007
Study Guide
Sample Questions for the Second Midterm
This guide contains example questions to help you study for the coming midterm. As was the case with the previous
guide, most of these questions are short answer, whereas the test will include a larger portion of questions that require
some code or analysis of code. The questions here are also not as carefully designed for clarity, in part so as to
encourage you to think about different angles. On tests, we try to make our questions more precise.
You may bring two 8.5x11” sheets (both sides) of handwritten notes to the test. No other materials are allowed. No
calculators or other electronic devices are allowed.
Topics emphasized in exam 2: Virtual Memory, Interrupts, and System Calls
1. Explain how a virtual address is translated to a physical address using a two-level page table hierarchy. Count the
number of memory accesses involved.
2. How does use of virtual memory prevent a malicious program from contaminating or destroying another program’s
memory?
3. Give an example of how memory fragmentation can negatively impact a system without virtual memory.
4. How does the Linux kernel track the number of uses of a file structure, memory map, or other structure shared
between multiple tasks? Why does it do so?
5. Explain the advantages and disadvantages of using a 4-MB page size rather than a 4-kB page size to support paging.
6. Virtual memory is useful for protection, sharing, avoiding fragmentation, and avoiding code and data relocation.
Compare the effectiveness of segmentation with that of virtual memory for these four goals.
7. Explain the advantages of abstracting a memory map as a set of contiguous regions rather than relying directly
on the page tables for descriptive information. Hint: don’t forget one the original goals of using virtual memory, in
addition to any other advantages.
8. Explain the tradeoffs between handling translation lookaside buffer (TLB) misses in hardware and handling them
in software (via an exception mechanism).
9. Why are I/O ports protected using a processor’s hardware privilege level support?
10. Explain the purpose and benefits of stack swapping. What additional support is necessary for tracking stack
pointers when more than one program is allowed to exist at a time?
11. Memory allocation systems that use exponentially-sized bins (e.g., powers of two) rather than fitting memory
exactly to the requested size waste space by returning more memory than is necessary. Extra memory returned in this
manner is then waste space. Calculate the minimum and maximum amount of memory wasted in terms of the total
memory requested from such a system, given power-of-two bin sizes. Next, make reasonable assumptions about the
distribution of requested sizes and calculate the expected waste space (again in terms of the requested space).
12. In the MP2 code, the maze game provides a virtual world of maze pixels, and the mode X code maps that world
into mode X planes before storing the pixels to be displayed in the build buffer. As a result, planes in the build buffer
must be remapped into the VGA planes when displaying a new screen. Consider two alternatives. First, one might
instead draw a graphical image in a form convenient to C in the build buffer, then map to planes when copying to
video memory. Second, one might map the window being displayed (a sub-portion of the virtual world provided by
the maze) into logical planes, allowing the mapping to video memory to occur without plane-to-plane remapping.
Explain why neither alternative is attractive.
13. Using the game controller from MP2 as an example, give two reasons for performing port I/O in the context of a
device driver rather than allowing applications to access the device’s ports directly.
14. How does software disablement of hard interrupts work in Linux? Also comment on how happens if the system’s
pf2

Partial preview of the text

Download 24 Questions on Computer Systems Engineering - Midterm Exam 2 | ECE 391 and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

ECE391: Computer Systems Engineering Fall 2007

Study Guide

Sample Questions for the Second Midterm

This guide contains example questions to help you study for the coming midterm. As was the case with the previous guide, most of these questions are short answer, whereas the test will include a larger portion of questions that require some code or analysis of code. The questions here are also not as carefully designed for clarity, in part so as to encourage you to think about different angles. On tests, we try to make our questions more precise.

You may bring two 8.5x11” sheets (both sides) of handwritten notes to the test. No other materials are allowed. No calculators or other electronic devices are allowed.

Topics emphasized in exam 2: Virtual Memory, Interrupts, and System Calls

  1. Explain how a virtual address is translated to a physical address using a two-level page table hierarchy. Count the number of memory accesses involved.
  2. How does use of virtual memory prevent a malicious program from contaminating or destroying another program’s memory?
  3. Give an example of how memory fragmentation can negatively impact a system without virtual memory.
  4. How does the Linux kernel track the number of uses of a file structure, memory map, or other structure shared between multiple tasks? Why does it do so?
  5. Explain the advantages and disadvantages of using a 4-MB page size rather than a 4-kB page size to support paging.
  6. Virtual memory is useful for protection, sharing, avoiding fragmentation, and avoiding code and data relocation. Compare the effectiveness of segmentation with that of virtual memory for these four goals.
  7. Explain the advantages of abstracting a memory map as a set of contiguous regions rather than relying directly on the page tables for descriptive information. Hint: don’t forget one the original goals of using virtual memory, in addition to any other advantages.
  8. Explain the tradeoffs between handling translation lookaside buffer (TLB) misses in hardware and handling them in software (via an exception mechanism).
  9. Why are I/O ports protected using a processor’s hardware privilege level support?
  10. Explain the purpose and benefits of stack swapping. What additional support is necessary for tracking stack pointers when more than one program is allowed to exist at a time?
  11. Memory allocation systems that use exponentially-sized bins (e.g., powers of two) rather than fitting memory exactly to the requested size waste space by returning more memory than is necessary. Extra memory returned in this manner is then waste space. Calculate the minimum and maximum amount of memory wasted in terms of the total memory requested from such a system, given power-of-two bin sizes. Next, make reasonable assumptions about the distribution of requested sizes and calculate the expected waste space (again in terms of the requested space).
  12. In the MP2 code, the maze game provides a virtual world of maze pixels, and the mode X code maps that world into mode X planes before storing the pixels to be displayed in the build buffer. As a result, planes in the build buffer must be remapped into the VGA planes when displaying a new screen. Consider two alternatives. First, one might instead draw a graphical image in a form convenient to C in the build buffer, then map to planes when copying to video memory. Second, one might map the window being displayed (a sub-portion of the virtual world provided by the maze) into logical planes, allowing the mapping to video memory to occur without plane-to-plane remapping. Explain why neither alternative is attractive.
  13. Using the game controller from MP2 as an example, give two reasons for performing port I/O in the context of a device driver rather than allowing applications to access the device’s ports directly.
  14. How does software disablement of hard interrupts work in Linux? Also comment on how happens if the system’s

PIC does not support masking of individual interrupts. In particular, how is a hard interrupt deferred, and when and how is it eventually executed?

  1. Explain the benefits of using linked lists of handlers (actions) to support interrupt chaining. Comment on the drawbacks of chained handlers in general.
  2. Describe the assembly linkage used to map hard interrupts into calls to do IRQ.
  3. In what cases is having more than two levels of protection supported by hardware be useful?
  4. Are system calls synchronous or asynchonous with respect to a program? Are they expected or unexpected? Explain any implications of your answers.
  5. Your friend, Ben Bitdiddle, suggests that mapping the 8259A interrupts into the 0x00 to 0x0F range of the Interrupt Descriptor Table can save time on translations between vector number and IRQ. Explain why such a mapping does not work as expected.
  6. Threads share a single address space, which in Linux is represented as a memory map. Explain how Linux supports sharing of memory maps between threads.
  7. As part of debugging your device driver, you decide to count the number of command requests made to the device that have yet to generate an interrupt. One approach to doing so is to use a shared variable incremented by the command request code and decremented by the interrupt handler. Suggest a better method that does not involve sharing data between these two pieces of code.
  8. Explain two advantages of using an interrupt controller over an OR gate for bringing device interrupt lines into a processor’s interrupt input.
  9. When do tasklets run in Linux?
  10. Explain the differences between disabling an interrupt in software and executing CLI.