CS 307 Assignments

Things to hand in

  1. Assigned 5/15/96, due 5/20/96. Go on a linux-code scavenger hunt. Research and answer at least two of the following. (Two will be sufficient for full credit on the assignment, and I won't give extra credit. On the other hand, the more questions you try to answer, the more you will learn.) Write your answers as you would write a short paper for any class, with complete sentences and paragraphs, references (to documentation, source files, etc.), and so on. Include relevant pieces of code at appropriate points in your exposition (and make sure to say where the code came from). Assume your reader is a member of this class who stopped coming to class just before we started looking at the linux code.

    Most of the code you need can be found in /usr/src/linux/... on a linux system, or in /Accounts/courses/cs307/Linux2.3/linux-1.2.8/... on the NeXTs. Lots more code is in /Accounts/courses/cs307/Linux2.3/source/....

    Have fun.

  2. Assigned 4/22/96, due 4/26/96. Do problems 3, 5, 12, 13, 14, 19, 25, and 28 from Chapter 3 of Tanenbaum.
  3. Assigned 4/12/96, due 4/17/96. Using linux, write two programs, each of which does the following:

    The difference between your two programs will be that one will use semaphores to enforce the alternation, while the other will use message queues. See the linux manual pages and ipc.info for documentation of the linux IPC constructs. See norace.c for shared memory and semaphore examples.

    Since we have set up linux to not have access to the network, you'll need to move files around on DOS floppies. NeXTStep can handle DOS floppies. Put the floppy in the drive, get the File Viewer in front, and select Disks:Check for disks from the Workspace menu. The floppy can now be treated like any NeXTStep folder. To safely remove the disk, select Disks:Eject from the Workspace menu.

    To use a DOS floppy from linux, login as root, cd to your own directory, do "mkdir floppy" or something similar, insert the disk into the drive, and then mount the disk like so: "mount -t msdos /dev/fd0 floppy". Now your DOS disk acts like an ordinary linux directory, and you can copy files to and from it. When you're done moving files around, unmount the disk with "unmount floppy". Questions? Mike, Jeremy, or I can help you, as can many of your other classmates, probably.

    By the way, we're using DOS floppies instead of linux floppies because NeXTStep recognizes the one but not the other.

  4. Assigned 4/10/96, due 4/15/96. Do problems 5, 7, 15, 22, and 30 on pages 71ff of Tanenbaums.
  5. Assigned 3/29/96, due 4/3/96. Using the C language in a NeXTStep Unix environment (sheesh, Jeremy, you force such precision!), write a command shell that

    Your shell should also trap CTL-C's and tell the user to type CTL-] followed by <return> to quit your shell.

    Plan carefully. You'll be expanding on this later.

    Work in groups of 2 or 3. No solo programs, please.

    Here are a few technical points that may interest you:

Suggested Reading, other activities

  1. 3/27/96. Check out the manual pages for the Unix command "ps," and for the system calls fork(), exit(), wait(), execl(), getpid(), and getppid(). Also, look at the manual page for "csh," where you will find (among many other things) a description of the notion of a "job" and the "jobs" command.
  2. 3/25/96. Read Chapters 1 and 2 of Tanenbaum.




Jeff Ondich, Department of Mathematics and Computer Science, Carleton College, Northfield, MN 55057
(507) 663-4364, jondich@carleton.edu