assignments
due Tue Sep 7
getting started
- Reading
- Read chapter 1 in the text, "A tour of computer systems"
- Start reading chapter 2.
- Browse the links on the resources page.
- Browse Norm Matloff's unix and C tutorials
- Installing
- Get your tools in order: gcc, an editor, access to the unix command shell
- Writing
- First, tell me how all of the stuff above hit you: review? way over the top? somewhere between?
- Compile, write, and run the classic "hello world" program in C, as described at wikipedia: Hello_world_program.
- If time allows and you get this far, write a C program to solve project euler's problem 9 : find a pythagorean triple whose sum is 1000.
due Tue Sep 14
C, bits, integers
- Reading
- Read about C pointers and structs.
- Read chapter 2, particularly the integer parts.
- Writing (Get as far as you can with this in the time you have. Do get hints from other folks if you need them.)
- Explain exactly why the pythagorean program with the number I showed in class gave the wrong answer. How would you fix it? How about for really big numbers?
- Write a C program that implement a list of words. Either allow up to a fixed number of words (say 100), and use a fixed array to store the list or implement a linked list made up of nodes with pointers. In either case, from the main program you should be able to call routines to (a) add words to the list, (b) print the whole list, one word per line, and (c) print the n'th word. If you're really having fun, do both.
- In the text, do the following problems from chapter 2, page 119 and following : 2.55, 2.58, 2.61, 2.64, 2.79.
due Tue Sep 21
more C and bits
- Reading
- Finish reading chapter 2. If time permits, start looking at chap 3.
- Review my C code examples
- Exercises
- Finish any of the exercises from last time that you haven't done yet.
- Do 2.68 and 2.89.
- Coding
- Finish the string C assignment, if you haven't yet.
- Write a two file C code that has implements functions to create, modifiy, and print a list of (x,y) points in list.c and list.h, and tests that with a main() routine in test.c. Brownie points for (a) avoiding the use of globals, (b) allowing points to be inserted into the middle of the list.
due Tue Sep 28
IA32 : data movement and arithmetic
- Read chapter 3 through page 184, sections 3.1 to 3.5.
- Install gdb and ddd and start playing around with them on some dirt simple C programs. See the resources page and Matloff's tutorials listed there for sources and docs. Report on your findings.
- Do practice problems 3.1 through 3.5 in the text. You don't have submit everything (since the solutions to those are at the end of the chapter, so you can check your results), but give a representative sample of your work, and tell me how it went.
- Do (and turn in) problems 3.54 and 3.55 on page 294 and 295.
due Tue Oct 5
IA32 : conditions, jumps, procedures
- Read 3.6 (control) skip the later "switch" bits, 3.7 (procedures), 3.11 (GDB). Skim the between sections on arrays.
- Do practice problems 3.7, 3.10, 3.13, 3.16, 3.22, 3.30, 3.33
- Either with my small.c or some simple C program of your own, use GDB to explain and annote the corresponding IA32 assembler. (This is a fairly open-ended invitation to start trying to do the sort of things you'll need to do for the bomb lab.) In particular, put in some strings passed into functions, and make sure you can see the string from within GDB by looking at the stack and registers.
due Tue Oct 12
bomb lab
- We'll discuss in class Tue where this is ... it may be that we'll look at the first few, and give you more time to continue.
- This is your first graded project. Good luck.
- See oct 5 notes for a discussion of how to run the bomb lab.
- Your mission : do as much as you can.
- Write a paper describing/explaining your understanding of the the disassembled x86 code.
- You'll be graded primarily on the paper, not just "solving" it per se (although as much as you can would be great).
- Discuss in the paper as much x86 stuff as you can from the last few weeks.
due Tue Oct 26
crashing the stack
- Work through as much as you can of the buffer lab, which is here.
- You can work on cs as before, or copy the files to another linux machine.
- Write up what you see and how far you get.
- Feel free to work in groups if you like, and/or ask for help; if so, each person should submit their own write-up (showing their understanding), and describe who did what work. (As usual, credit where credit is due.)
due Tue Nov 2
memory
- Read chapter 6
- Do 6.35 and 6.36 on pg 235, and 6.39, 6.40 on pg 638.
- Compile and play around with the "memory mountain" code on pg 622. Explain what is going on: what is this measuring, and how?
due Tue Nov 9
linking
- Read chapter 7, linking
- Do exercises 7.4, 7.5, 7.9
- Go back to one of the simple C programs that we wrote at the beginning of the term. Compile one of them in two ways, using different gcc options, to use static vs dynamic libraries. Compare the size of the executable, and discuss the differences. If you like, use gdb and/or readelf to explore the executables.
- As described on pages 668 and 682, create a static library archive (.a) and shared library (.so) from a few simple utility routines of your choice. (In other words, write some simple C routines analogous addvec and mulvec on page 669, and compile them into an archive and a shared library.)
- pg 664 through 665 discuss some bugs that can occur when linking multiple C programs with mixtures of strong and weak symbol names. Try out a few of these yourself (type in the code, compile it, run it, use gdb to see what's going with the symbols and addresses), and discuss what you find.
due Tue Nov 16
exceptional flow control
- Read chapter 8 - lots of good stuff.
- Do 8.3 on pg 726, 8.6 on pg 733, 8.7 on pg 744
- And 8.15, 8.18, 8.20 on pages 766-768
due Tue Nov 23
shell lab
- start reading chapter 9, on virtual memory.
- start working through the shell lab.
- turn in some shell lab work, and a brief description of how that's going.
- (A more complete shell lab and writeup will be the final term project.)
due Tue Dec 7
virtual memory and sockets
- finish reading chapter 9, particularly malloc and C bugs.
- write a C program that shows these bugs (and their fixes) in action. The "linked list of strings" assignment from the beginning of the semester could be a good example to use, particularly if it has routines to create and dispose of the nodes in the list.
- skim chapter 10; read chapter 11, on network sockets.
due Fri Dec 10
final term project
- See how far you can get through the shell lab.
- In a short paper, describe what you did, and demonstrate your understanding of the material from the signals and processes chapter.
term grade
- A place for Jim to record the course grade.