<<

COS 350: Systems Programming – Spring 2018 Revised Mon, Wed 11:45 – 1:00 in 209 Payson Smith

Professor: Office Hours: Bob Boothe Mon, Wed 1:15 – 2:30 Office: 230 Science or by appointment Phone: 780-4789 Email: boothe @ maine.edu Web: www.cs.usm.maine.edu/~boothe

Course Description: A study of systems programming concepts and , including the C programming language and the programming environment and interface. Students develop their abilities in these areas through programming exercises and projects.

Schedule: Lec Date Unix topics Main topics Readings Assign Due L1 1/22 , , , … man intro to systems programming & C L2 1/24 gcc, cpp C functions and scope L3 1/29 C-c, C-z, fg, bg C arrays, , line args L4 1/31 , , … streams, case study: cat Chapter 1 prog1 L5 2/5 gdb & ddd C string functions, strtok, struct L6 2/7 file descriptors, case study: who Sections 2.1-2.5 L7 2/12 case study: cp, buffering, bitwise ops Sections 2.6-2.10 prog2 prog1 L8 2/14 C lseek, pointers to functions, qsort L9 2/21 , C malloc & free L10 2/26 reading directories, case study: ls Sections 3.1-3.5 L11 2/18 subfield coding, stat, case: ls –l Sections 3.6-3.9 prog3 prog2 L12 3/5 , unlink file & directory organization: Chapter 4 L13 3/7 devices, write, stty, terminal modes Chap 5, Secs 6.1-6.3 L14 3/19 signals, alarms, case study: Secs 6.4-6.7, Sec 7.5 L15 3/21 crontab timers, signal handling Sections 7.6-7.10 prog4 prog3 L16 3/26 & sdiff catch up & review L17 3/28 Midterm Exam L18 4/2 process control, case study: shell Sections 8.1-8.4 L19 4/4 writing a shell, case study: time Sections 8.5-8.7 L20 4/9 source, set, shell scripting Sections 9.1-9.3 prog5 prog4 L21 4/11 while [ ], pushd SAMPLEshell and environment variables Sections 9.4-9.7 L22 4/16 I/O redirection I/O redirection using file descriptors Sections 10.1-10.4 L23 4/18 pipes Sections 10.5-10.6 L24 4/23 threads, mutex Sections 14.1-14.4 prog6 prog5 L25 4/25 gzip threads, condition variables Sections 14.5-14.7 L26 4/30 tar case study: malloc L27 5/2 C declarations, typedef prog6 5/9 Final Exam 10:45-12:45

Student Outcomes: During this course students will:  Learn to use many common unix commands and tools.  Learn to design and implement programs in C that directly use operating system level functionality such as terminal modes, timers, signals, pipes, and the file system.  Learn how to use the principles of concurrency through unix processes and threads.

Copyright 2018 Bob Boothe Prerequisites: COS 285: Data Structures, COS 250: Computer Organization Textbooks: “Understanding Unix/Linux Programming” by Bruce Molay In addition to the above textbook, we will be using and learning the C programming language and the Unix/Linux operating system. Documentation is available on Unix/Linux using the “man” command, as well as on the Web. These sources combined with lectures should be adequate for this class; how- ever some students may find it helpful to obtain additional books for C and Unix. Unix Computer Lab: The Unix computer lab is located in 103 Science, and is accessible when the building is unlocked: roughly 7:00 am – 10:00 pm M-F. You are permitted to stay later if you are already in the lab. Grading: The total score will be calculated: A total score of: 6 programs 35%  90% will receive least an A- experiments (best 18 of 21) 15%  80% will receive at least a B- Midterm 20%  70% will receive at least a C- Final 30%  60% will receive at least a D

Class Policies: Handing in Assignments: All assignments will be due at the beginning of class. Solutions will be discussed the same day that assign- ments are turned in. Late Assignments: Late assignments will be marked down 20% per class meeting that they are late (except under special cir- cumstances such as illness or other unanticipated impediments). All assignments should be turned in by the last class meeting. Collaboration: Students are encouraged to assist each other in learning to understand the subject matter of this course. You will be expected to work cooperatively in class with other students in small groups. All programming assignments may be done in teams of up to 3 students. It expected that all team mem- bers will contribute equally. You are expected to discuss the design and to review each other’s code. Turn in only 1 group assignment. Plagiarism: All work turned in should be your own work. Copying someone else’s work or allowing someone to copy your work may result in failingSAMPLE the course as well as appropriate disciplinary action. It is your responsibility to not leave your work where others might copy it. Crib Sheets: Exams are closed book, however students will be allowed to use the quick reference cards handed out in class as well as a 1 page crib sheet for the midterm and 2 crib sheets for the final. Conservation: USM encourages everyone to be good global citizens by conserving resources and avoiding waste. As com- puter science students you can contribute by: avoiding excessive printing, print more compactly (on Unix use a2ps), reusing scrap paper, and by recycling. You can help conserve electricity by turning monitors off when logging out and lights off when rooms are empty.

Copyright 2018 Bob Boothe