Computer
Organization and Design
(Textbook. Click for information.)

 CS 2731, Spring 2004
 Computer Organization II

 Recitation 1: January 12, 14
 Introduction to the Linux Lab
    MW   02:00-02:50 pm, SB 3.01.04
 Due: 2004-01-21 23:59:59

Recitation 1 must be submitted following directions at: submissions on or before
  • 2004-01-21  23:59:59 (that's Wednesday, 21 January 2004, 11:59:59 pm) for full credit.
  • 2004-01-25  23:59:59 (that's Sunday, 25 January 2004, 11:59:59 pm) for 75% credit.

Outline: Recitation 1 is an introduction to the Linux Laboratory, to the Unix systems, and to the mechanics of assembling programs. The CS Linux Laboratory is located in room 3.01.04 SB. The lab will meet formally in 3.01.04 SB at 2 pm on many Mondays for a 10-minute Recitation Quiz. After the quiz, students can work informally on their recitation assignment and can get help from the recitation instructor.

You can download the MIPS simulator software (which also runs on other Unix flavors such as Mac OS X, as well as (gulp!) Xxxrosoft Zzzindows) and do much of the work at home, if that is more convenient.


Detailed Requirements:
  1. CS network accounts are now supposed to be assigned automatically at the beginning of the semester. If you are new, an account should be created for you. If you end up with no account on the CS network, get an account form just inside the lab door, fill it out, sign it, and leave it in the CS Department Office.

  2. You will be getting familiar with the Unix environment during this course. The first recitation starts this process. You could use some Unix reference book, such as the old CS 1713 text: UNIX SYSTEM V A Practical Guide, by M. Sobell.

  3. You should become familiar with the following UNIX features:

    If you are a new user, you may want to download a sample C shell initialization file: sample.cshrc, which you could use as your .cshrc (These directions are now a little out of date, since on Linux the default shell is bash.)

  4. If you do not already have a personal homepage, you should set one up by following these directions. Even if you have your own personal homepage, you should create a homepage at UTSA as described above, and this page can just have a link to your "real" homepage. You may use UTSA as the main location for your email. Even if you do your email at a separate location, you should also set up things at UTSA so that mail to your UTSA email account is forwarded to your "real" email address.

  5. We will be using the MIPS simulator xspim to run our MIPS assembly language. Documentation for this simulator can be found in your textbook and online in Postscript or PDF. This simulator runs directly on the Sun machines. On the linux machines, you must create a secure shell from a terminal to get a connection to the Sun machines, as is described in the page on submitting references. Then you can use spim and xspim.

  6. Appendix A of your text gives very good documentation for the MIPS assembly language (although maybe more detail than you want), and it is available online in Appendix A (PDF).

  7. Download the MIPS assembly language test program fact.s into a convenient directory. (You can just select the contents of this web page and copy it into your own file named fact.s.) This is a sophisticated MIPS program which you are not expected to understand at this point.

  8. Run the simulator on fact.s by typing:

        pandora% spim -file fact.s
    

    (You should type 4 (carriage return) at the prompt; then the program will calculate and print 4! or 24.)

    Next use the xwindows (interactive) version of spim, by typing:

        pandora% xspim -file fact.s
    

    When the simulator comes up, you can click on run to execute the entire program. After clicking on ok, you will get the same prompt in a new window as before. After entering 4 followed by Return, the program will respond with 24 just as before. Finally click on quit (twice). It is more interesting and useful to execute one instruction at a time: after invoking xspim, click on step instead of run. In the small prompt window, you should keep clicking on step to execute one MIPS instruction at a time.

    After 4 steps, you will next execute the instruction jal 0x0040020 [main], followed by the first actual instruction of the fact.s program: addu $s7, $zero, $ra, which appears as addu $23, $0, $31 in the xspim window.

    Continue stepping. When you execute the first syscall MIPS instruction, a window with an Enter n: prompt will appear. After executing the next syscall type 4 and Return as before. Then after over 66 more steps, the program will eventually respond with the value 24 and then a newline. (You must enter the 4 and return immediately after stepping through the second syscall instruction.)


What you should submit: Refer to the submissions directions and to deadlines at the top of this page. The text file that you submit should first have Your Name, the Course Number, and the Recitation Number. The rest of the file should have the following in it, in the order below, and clearly labeled, including at the beginning the appropriate number 1-4.

  Contents of submission for Recitation 1:

Last Name, First Name; Course Number; Recitation Number.

  1. Your preferred email address.

  2. A statement that you have email working at UTSA, using the email address acctname@cs.utsa.edu, where acctname is the name of your account on the CS network. Possibly this email is simply forwarded to another email address.

  3. A statement that you have a working UTSA webpage, using the URL http://www.cs.utsa.edu/~acctname/index.html, where acctname is the name of your account on the CS network. Possibly this webpage just has a link to another webpage.

  4. A log showing a run of fact.s using spim with input value 4, and showing the resulting output.


Revision date: 2003-12-14. (Please use ISO 8601, the International Standard.)