Srping 2005

Clay Shields


front | classes | research | personal | contact

Homework 1 - Examining process state in Unix

Due in class January 25th, 2005.
This semester we will be doing several projects on a Unix system. If you have used Unix before, then some of this material will be new. Some it will not be.

For this assignment, you are to use your own Unix account on GUSUN. Other machines may not have the commands installed for you to use.
If you do not already have a GUSUN account, you can get one at:

http://www.georgetown.edu/uis/web/gusun.

If you need to access GUSUN from home, use SSH. A free SSH client (for Windows) is available here. Mac OS X has SSH installed as a command by default and can be reached through the terminal application. Linux users sneer at Mac and Windows users for not already knowing about SSH.

You will quickly notice that Unix has a command line interface. You will have to type commands you want executed. This is good and bad. You have more control over what happens, but you have a lot to learn instead of having someone else choose all possible options for you.

First Off

I would recommend using tcsh as a shell. bash is good too, but most of the tutorials cover using tcsh. To start tcsh, On GUSUN type "tcsh" first thing when you log on. You might have to type "logout" or "exit" twice to log off if you do this.

Also,  you need to know is that you can get what passes for help for any command on a Unix system by typing:

man <command>

where <command> is the command you want information about. The man pages are not always useful in a tutorial sense, but they will explain the variety of options available for each command.

Try "man man" to see what man can tell you.

Unix reference information

A number of good tutorials exist that will teach you all you need to know about Unix, and more. You should look through these tutorials as you answer the questions below.

http://www.ee.surrey.ac.uk/Teaching/Unix/
http://www.ctssn.com/
http://heather.cs.ucdavis.edu/~matloff/unix.html
http://wks.uts.ohio-state.edu/unix_course/
http://wks.uts.ohio-state.edu/sysadm_course/sysadm.html

The last two links are also available as printable books. They seem like good references to me.

Intro to Unix
http://wks.uts.ohio-state.edu/unix_course/unix_book.pdf

Intro to System Administration (more in-depth)
http://wks.uts.ohio-state.edu/sysadm_course/sysadm_book.pdf


Your assignment:

Use the man pages and the tutorials refernced above (other on-line sources are fine too, but talk to me before you talk to others about the assignment) to figure out how to do the following things on a unix system.

Process Management and Information

Commands to learn:

top, ps, nice, nohup, kill, signal

1) What command can you use to show all the processes that you are running?

2) What is the process ID of the shell you are currently using?

3) What command can you use to show all the processes that are running on the system?

4) What command can you use to see the top few most active processes on a system?

5) How could you cause a command to run with a lower priority than it otherwise would?

6) What command can you use to send signals to running processes?

7) Describe 5 different types of signals you can send, and their likely effects. Commands to learn:

Run each of these commands on the process ID of your current shell (from question 2). For each question, indicate which command you used.

pflags, pcred, pmap, pldd, psig, pstack, pfiles, pwdx, ptree

(you will need to be on a SunOS machine, such as GUSUN, to use these)

8) What is the address of the stack of your shell process?

9) What is the root of the process tree of your shell process?

10) What is the working directory of your shell process?

11) What is the user id that your shell is running with?

12) What files does your shell have open?

13) What shared libraries is your shell using?

14) What will your shell process do to process each possible signal it can receive?

15) What does the stack of your shell process look like?

Commands to learn:

apptrace, truss

(you will need to be on a SunOS machine, such as GUSUN, to use these too)

16) What shared library calls does the command ls make?

17) What system calls does the command ls make?

Machine and Architecture Information

Commands to learn:

arch, uname, pagesize, iostat, vmstat, mpstat, busstat

18) What is the kernel architecture of GUSUN?

19) How large are the memory pages on GUSUN?

20) What percentage of the time has the CPU on GUSUN been idle?

21) What type of interrupt is most common on GUSUN?


What to turn in:

You should submit the answers to this assignment on paper in class.