CS 630 PROJECT #1 Due Date: 7:30pm Tuesday 09/30/2008 This project asks students to examine carefully the details for x86 privilege-level transitions, by elaborating on our 'tryring1.s' example. PROBLEM DESCRIPTION Design your own code for an elaborated version of a ring-transition demo-program which incorporates the execution of a code-fragment at each of the processor's four privilege-levels, as follows: 1) your program enters protected-mode at privilege-level 0 2) your program then transfers from ring0 to ring3 using 'lret' 3) your program then transfers from ring3 to ring1 using 'lcall' 4) your program then transfers from ring1 to ring2 using 'lret' 5) your program then transfers from ring2 to ring0 using 'lcall' 6) your program leaves protected-mode from privilege-level 0 Upon entering each new privilege-level, your program writes a message to the video display-terminal which confirms its arrival in that new ring. REQUIREMENTS Your program must be designed to reside in the memory-arena located at the physical address-range 0x00010000-0x0001FE00 (so it can be loaded from the disk-partition named '/dev/sda4' by our 'cs630ipl.s' bootstrap- loader). Of course, this requirement implies that the word-value 0xABCD must occupy the first two bytes of your binary-executable file, and that 'signature' value must be immediately followed by your program's initial executable instruction (i.e., at offset 0x0002). In order to support execution of code in each of the four privilege rings, your program will need to create a Task-State Segment with a size large enough to include the 'stack-pointer' fields for each stack-switch accompanying an inward-directed ring-transition (i.e., any transfer that makes a call through a call-gate from a lesser-privileged ring to a more privileged ring). You will, of course, need to allocate stack-space for each of the four privilege-levels utilized by your demo-program. PROJECT SUBMISSION To facilitate the grading-process you are asked to use 'ringhops.s' as the filename for your program's source-code, and to copy that source- file (along with its object-file 'ringhops.o' and its binary-executable 'ringhops.b') into the root-directory of your CS630 '/submit' folder. [stargate]$ cp ringhops.* /home/submit/cs630//. In addition to this electronic-submission of your project-files, you are asked to turn in to your Instructor a printout of your 'ringhops.s' file that was printed using the 'ljpages' utility-program (from our website). (The purpose of this last requirement is to assure that your hardcopy is easily readable by your Instructor, with room for handwritten comments). ________________________________________________________________________ Allan B. Cruse University of San Francisco Fall 2008