Homework 1 - Examaning Process State in Linux
Due before class January 18 , 2017

Within an operating system, a running program is called a process. The goal of this assignment is to both make you familiar with the basic operation of the linux command line and to take a look at how processes operate in the Linux operating system.

This semester we will be doing several projects on a instructional linux system dedicated specifically to this class. If you have used unix or linux before, then some of this material will be new. Some of it may not be.

For this assignment, you are to use your account on the mclovin.cs.georgetown.edu machine. The account has been created for you with your netid. The default password will be told to you in class. You will have to use ssh to reach mclovin. A free ssh client (for Windows) is available at this link.

Mac OS X already has a ssh client available through the terminal application. It is also available from the command line of most linux systems.

You will quickly notice that linux 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. I have been using unix and linux for about 20 years now, and keep learning things.

First Off

First, you need to know that you can get what passes for help for any command on a linux system by typing:
man <command> or
info <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.

To see what man and info can tell you about itself try: man man or
info info

Reference information

A number of good tutorials exist that will teach you all you need to know about lunix, and more.
Tutorials and Guides
http://www.ee.surrey.ac.uk/Teaching/Unix/
http://heather.cs.ucdavis.edu/~matloff/unix.html

Use that man pages and the tutorials referenced above (other on-line sources are fine too, but ask 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
( signal is not a command, read the man page)
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? Using this, what is the name of the process with the lowest ID?

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) What command would you use to suspend a running process?

The proc file system:
Read through the document titled The /proc file system, then for each question, indicate where you found the information. If you need a specific process ID, the process ID of your current shell (from question 2). Please include the output you used to generate your answer.

8) How many times has your shell process been switched out voluntarily?

9) What is your shell's parent process ID?

10)What is the maximum stack size for your shell?

11)What command line was used to start your shell process?

12)What type of processor is mclovin running on?

13) What are the physical and virtual address sizes used on mclovin?

14) What number interrupt does the USB 1 port use?

15) What version of Linux is mclovin running?

Commands to learn:

strace, ltrace

16) What shared library calls does the command ls make? (I don't need a list with repeated entries, thanks, so don't dump the whole output - just the unique list of calls made.)

17) What system calls does the command ls make? (I don't need a list with repeated entries here either, thanks.)

Machine and Architecture Information

Commands to learn:

arch, uname, pagesize, iostat, vmstat, mpstat

18) What is the kernel architecture of mclovin?

19) How large are the memory pages on mclovin?

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

21) How many context switches have there been since boot on mclovin

What to turn in:

Create a text file in your home directory on mclovin named <netid>-hw1.txt, where <netid> is your netid. Leave it there and also e-mail your solutions in the body of the message to the instructor. Please don't use attachments or fancy things - plain text is fine. You don't need any text for commands - just leave them so they are cut-and-pastable for testing.