EEN322 T (Systems Programming) Autumn 2016
Tues, Thurs at 5:00 pm in MM-101

The Book

Examinations:

Assignments

Submit by email to grader322 at rabbit.eng.miami.edu with subject line = your name + which assignment,
code, comments, and basic demonstration of it working, in one happily readable document.
     1   Due Sat. 17th September
     Safe handling of evil files and strings.   
2 Due Tues. 11th October
Shell Preparation
3 Due Sat. 3rd December
Better Shell
4 Due Thur. 8th December
Interactive UDP Chatter
5 Due Mon. 12th December
Documentation/Report
Deadline - Last day anything (except the final project) can be accepted for grading: ???.

Class History

Class 1  Tue 23‑8‑2016   Quick introductions, what the class is about, etc.
Starting to program in C: a mere binary tree to start with.
Class 2  Thur 25‑8‑2016   Lots of clever printf tricks, and how it helps trace recursion.
Random numbers - remember to use srandomdev(), srandom(), random() when they're available.
Accessing the command line, making a dynamic array.
Class 3  Tue 30‑8‑2016   Unix (as opposed to C) input and output.
1: writing the contents of the tree as a "binary" file.
2: Reading that binary file. Also remember the "od" utility.
3: Modifying them so the talk to each other directly.
The very special system function "fork".
Class 4  Thur 1‑9‑2016   It's control-six!
More about fork, Understanding the weird behaviour of this program.
It's easier with some sleep()s in there, try it without the wait()s.
pipe().
Our target at last, comparing the contents of two trees with multiple processes.
Class 5  Tue 6‑9‑2016   Strings in C. Be careful to terminate: before, after.
char * and char[] can both be strings. With char *, be careful to allocate and beware of shared pointers.
Where to put the const: const char * a, char const * b, char * const c, or const char * const d?
String functions: strcpy, strlen, strdup, strcmp. Write them clearly, avoid the "bad" way.
static and inline for functions.
Class 6  Thur 8‑9‑2016   The useful strtok() and static local variabes.
fopen, fclose, fgets, getchar, fgetc, putchar, fputc, fseek.
Shell substitutions, "quotes", 'quotes', $variable, set, alias, path, rehash, $status.
The family of exec() functions needed to make a shell.
Class 7  Tue 13‑9‑2016   Make sure there's no k in pico's alias.
A bit of shell programming.
Time functions.
Class 8  Thur 15‑9‑2016   Reading directories, and inspecting a file's meta-data.
Inodes, reference counts, hard and soft links, opendir, readdir, stat, stat's modes.
Class 9  Tue 20‑9‑2016   Regular Expressions and searching with egrep.
Bitwise operations and some tricky tricks: Finding the last 1 in an int, Adding up all the bits in an int.
Class 10  Thur 22‑9‑2016   Discussion/Help sessions.
Internet Communications pptx, ppt.
UDP programming, the anticlimactic in1.c and in2.c. See if you can spot the deliberate mistake.
Class 11  Tue 27‑9‑2016   Completing UDP programming: send, receive.
And a quick look at how TCP is different.
Class 12  Tue 4‑10‑2016   ed's man page.
"Raw" input from the terminal. How would we make normal programs (like ed) respond to the arrow keys?
Class 13  Tue 11‑10‑2016   Pre-test review, and The C++ sample for translation.
Class 14  Thur 13‑10‑2016   Further with the translation, esp. the ifstream constructor.
Clarification of the interactions and differences bertween % g /re/ s p in ed.
Introducing awk: find the next free uid in a partial /etc/passwd.
First serious thoughts on shell command-line processing
Class 15  Tue 18‑10‑2016   Shell command line processing - lots of details.
A trick in the unused 128 bit in ASCII.
Trying to make awk -F: '$1 == cat { print $0 }' dict.txt into a useful alias.
Class 16  Tue 25‑10‑2016   Test day. Unix level i.o; C++ to C conversion; C level i/o; C strings; fork exec wait etc; UDP communications.
Class 17  Thur 27‑10‑2016   Defeating a zombie army in one move.
regcomp and regexec's man page simple pattern, complex pattern.
The qsort function (heapsort, mergesort are the same).
Class 18  Tue 1‑11‑2016   Examining our memory allocation and comparing with /proc/pid/map
ftok, shget, shmat, etc, adding (shared) memory.
Class 19  Thur 3‑11‑2016  
Class 20  Tue 8‑11‑2016   Observations from the test.
More on shared memory. Critical sections - what are they?
Class 21  Thur 10‑11‑2016   Semaphores and threads.
Class 22  Tue 15‑11‑2016   Help! Remember class 19 ! ?
IBM visit on Thursday.
Full shared memory and semaphore example.
Small pthreads example, see if you can work out what it does.
The full tree-linearising pthreads example.
Class 23  Thur 17‑11‑2016   Second Test Day. Possible topics are:
String functions, shell command line processing, UDP, regular expressions/egrep/sed, shared memory.
Class 24  Tue 29‑11‑2016   Class participation day - The backup utility.
Class 25  Thur 1‑12‑2016   umask, limits.h, long jumps, more signals, and reminders.
Class 26  Tue 6‑12‑2016   A restored reading day. Questions and problems only, no new material.