ECE322 T Systems Programming, Autumn 2024
Tues, Thurs at 5:05 p.m. in MM 202

The Book

Examinations:

Assignments

Submit assignments through blackboard. Only blackboard, don't email them.
code, comments, and basic demonstration of it working, in one happily readable document.
If you have a question, don't include it with your work for the assignment because then you won't get an answer until I reach your submission when grading. For questions, email me or get me after class, or in my office.

     1   Due Friday 13th September.
     Interact with a linked list of named places.   
2 Due Friday 27th September.
Make your own shell, part one.
3 Due Monday 4th November.
Make your own shell, part two.
4 Due Thursday 21st November.
Internet chat client and server.

PC log in - use Putty or your own preferred SSH app.
OR mac users: start the terminal app, windows users: start powershell, then type the command
ssh username@rabbit.eng.miami.edu and type your password when prompted.
Windows users beware: you can't use ctrl-V in pico, but page up and page down will do the job.

Class History

Class 1 - Tue 20-8-2024    Quick introductions, things to come:
C programming,
Unix using and programming,
Shells, commands, and scripts,
Processes,
Files, beyond merely reading and writing them,
Communications between programs,
Operations,
Utilities.
Class 2 - Thur 22-8-2024 Starting C.
Major differences from C++.
Strings. We looked in detail at strlen, strcmp, and strcat.
Class 3 - Tue 27-8-2024 #include <string.h>, very important strdup;
It is possible to re-create useful C++ features in C.
A very basic introduction to compiler directives.
A first look at macros, their benefits and extreme dangers. cc -D
Class 4 - Thur 29-8-2024 Where is the source code? Doesn't really matter, it is incomprehensible.
Building our own strtok with static variables.
Implementing a binary tree in the normal C way.
Class 5 - Tue 3-9-2024 Everything (i.e. not much) about gets and fgets.
All the useful printf formats and some scanf too.
Picking up with the tree insert method (done new_node, new_tree, find, and print).
creating processes fork, execlp, exit, wait; running a program from a program.
Fork bombs and quotas, perror, ^Z suspending a process, a few signals.
Class 6 - Thur 5-9-2024 Signals: sending, receiving, ignoring.
execl, execlp, execv, execvp.
WIFEXITED, WIFSIGNALED, WEXITSTATUS, WTERMSIG, the ls -l example again.
Unix file functions, open, close, read(file, pointer, number), write, pipe, dup.
O_RDONLY, 0_WRONLY, O_RDWR, O_TRUNC, O_CREAT, O_APPEND, O_EXCL, O_NONBLOCK, O_SHLOCK, O_EXLOCK.
redirecting output, capturing output.
Class 7 - Tue 10-9-2024 redirect 0 and 1 with a.out >& name. Both is illogical: (a.out > name2 ) >& name1. Remember /dev/tty
sort out capturels.c.
The program that caputures ls -l output to find total size of all files.
some meteorological data. and the program that shrank it to 34%.
Class 8 - Thur 12-9-2024 fopen's "r", "w", "a", "r+", "w+", "a+", "wx", "w+x", and adding "b" to the end. What does binary file really mean?
Unix and C versions of read, write, and seek.
Binary chop search on a file.
Sorting a file (but with slow old selection sort).
How merge-sort works well for files.
Class 9 - Tue 17-9-2024 Give them a quick reminder about gdb (done).
Experimentally discovering what's in a directory. (you can't run this program except as root) ...
... so: the setuid bit and how to take over any unix system.
I-nodes and inode numbers (sometimes file number) unique identifier and root of structure for a file in a disc.
readdir/dirent, the permitted way to read directories.
stat - function and struct to get metadata of files - size, mode, inode, device, uid, etc.
Class 10 - Thur 19-9-2024 All the things that stat will tell you, file mode and type not quite the same thing.
Pipes and named pipes.
Hard links and soft/symbolic links, no hard links to directories because reference counts don't work.
Times, time_t, struct timeval, struct tm; time(), localtime(), etc.
The example of everything.
qsort.
Class 11 - Tue 24-9-2024 Cooperative processes, comparing two trees: the starting skeleton program.
This is the final version of the tree comparing program.
Starting on built-in shell commands and script programming.
Class 12 - Thur 26-9-2024 Lots more on the built-in commands.
Our first useful shell script, a very basic backup utility.
Class 13 - Tue 1-10-2024 A new class you should know about for next Spring.
/etc/csh.login, /etc/csh.cshrc, ~/.login, ~/.cshrc
setting and getting effective and real uis and gid, the su command.
bit stuffing, just a quick exploration today.
Class 14 - Thur 3-10-2024 Bit stuffing, more prettily.
Regular expressions: pico, egrep, an example of regcomp and regexec.
Class 15 - Tue 8-10-2024
Class 16 - Thur 10-10-2024 regcomp and regex with multiple matches.
Counting the number of 1s in a 32 bit number.
Day Off 15th
Class 17 - Thur 17-10-2024 Review for test as needed.
Class 18 - Tue 22-10-2024 First mid-term: a fairly recent sample. Possible topics are:
        C programming and working with strings.
        Processes, fork, exec..., wait, pipe, redirecting i/o.
        File operations, inc. binary, with FILE * f or int fd.
        Using information about files and directories.
Class 19 - Thur 24-10-2024 Internet servers and clients,
small beginnings: gethostname, reverse lookup.
The web client we almost wrote; as always the mistake was trivial and obvious.
Class 20 - Tue 29-10-2024 The almost web server, the inexplicable problem did indeed just disappear.
Class 21 - Thur 31-10-2024 continuing from Tuesday: fdopen could be better.
<setjmp.h>, jmp_buf, setjmp(), longjmp().
Class 22 - Tue 5-11-2024 The web server worked at last (it was really working all along, the unseen part of the
url said https instead of http, and that adds a lot of non-human-readbale interactions).
Properly processing the HTTP request, and handling security concerns.
poll for servicing multiple files/sockets simultaneously (near end of slides for class 19).
Class 23 - Thur 7-11-2024 Terminal attributes.
Threads and mutexes/semaphores.
Class 24 - Tue 12-11-2024 Really controlling the keyboard: echoing a different character.
Pthreads: we've seen the details, now the big picture.
Bash, a popular shell.
Class 25 - Thur 14-11-2024 Using the make utility.
Class 26 - Tue 19-11-2024
Class 27 - Thur 21-11-2024 Second mid-term.
Possible topics:
       General C programming but not strings,
       Signals,
       Reading and dealing with directories,
       Things related to the stat function,
       Shell scripts in tcsh,
       Regular expressions.
sample one, sample two, sample three.
Break 26th to 29th
Class 28 - Tue 3-12-2024