a2sp06solutions - CS 414 Assignment 2 Solutions Include...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 414 Assignment 2 Solutions February 10, 2006 Include your netid on every page of the submitted file (there were a couple of submissions without their netids, we did not penalize them this time but we will in future). 1. Suppose that you are writing an operating system for a standard PC and wanted to build in some logic for determining whether or not the OS was actually running in a virtual machine monitor as opposed to running on the raw hardware. Here are some ideas for how you could do that. Indicate for each one whether or not it would work, and give a short reason. (If the idea includes a completely wrong assertion, explain what is wrong about it). (a) The O/S could include some sort of compute-intensive program. By testing on the same platform, the O/S should have a pretty good idea of how long this takes to run on a raw CPU and can compare with the timing it actually sees. If the O/S is running in a virtual machine, this will slow things down so much so that it will be obvi- ous. Solution Would not work. The VMM only has to intercept privi- leged instructions, a compute intensive program will have only a few privileged instructions and hence it essentially runs on the raw hard- ware. Comments Would not work if the OS was determining time locally. The only way it can determine time elapsed is by accessing the hard- ware clock which the VMM can intercept. The situation changes if the OS can get time from external servers (through the network).
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern