CMPSC
311,
Reading List for Midterm Exam 1
This list simply accumulates the textbook sections mentioned in the
lecture notes and project assignments. The Intro to Unix
notes cover material that is not always in the reading assignments,
so don't forget to review that. Similarly, the Unix
Command-Line Structure notes, and the c2html program, have
useful code examples. The
POSIX Standard is not covered directly in the textbooks.
Don't forget to try the exercises that appear in the lecture notes.
Bryant & O'Hallaron, CS:APP
- Preface
- Ch. 1, A Tour of Computer Systems
- Ch. 2, Representing and Manipulating Information
- intro, pp. 30-33
- Sec. 2.1, Information Storage, except Sec. 2.1.7-2.1.10
- Sec. 2.2, Integer Representations, but it's ok to skip the
"math-ish" parts for the exam prep
- Sec. 2.5, Summary
- Ch. 3, Machine-Level Representation of Programs
- Note on Ch. 3 - there won't be any exam questions on the x86
architecture, so concentrate on the general principles, and
use the x86 material as reinforcing examples. You will
(or already did) see the MIPS side of the same story in CMPEN
331.
- intro, pp. 154-156
- Sec. 3.2, Program Encodings, to the end of p. 161
- Sec. 3.7, Procedures (concentrate on management of the
stack, in Sec. 3.7.1, 3.7.4, 3.7.5)
- Sec. 3.8, Array Allocation and Access, esp. Sec. 3.8.1 and
3.8.2
- Sec. 3.9, Heterogeneous Data Structures
- Sec. 3.10, Putting it Together: Understanding Pointers
- Sec. 3.12, Out-of-Bounds Memory References and Buffer
Overflow
- Sec. 3.15, Summary
- Ch. 7, Linking
- intro, pp. 654-655
- Sec. 7.1-7.4, 7.8-7.10, 7.13
- Ch. 8, Exceptional Control Flow
- intro, pp. 702-703
- Sec. 8.2, Processes
- Sec. 8.3, System Call Error Handling; see also, App. A,
Error Handling, p. 999
- Sec. 8.4, Process Control
- You should definitely know about fork(), exit() and waitpid(), at the
level of the Intro to Unix notes, and can skip details at
the level of WNOHANG.
- Sec. 8.4.2, Creating and Terminating Processes (p. 719 is
enough for this part of the course)
- Sec. 8.4.5, Loading and Running Programs, is important for
understanding organization of the stack segment.
- Sec. 8.4.6 will be covered later in the course.
- Sec. 8.5, Signals - see the Intro to Unix notes instead
- Ch. 9, Virtual Memory
- intro, pp. 776-777
- Sec. 9.1-9.2
- Sec. 9.7.2 (esp. Fig. 9.26, which you have now seen many
times)
- Sec. 9.8.3, The
execve
Function Revisited
- Sec. 9.8.4, User-Level Memory Mapping with the
mmap
Function
- Sec. 9.9, Dynamic Memory Allocation, intro, Sec. 9.9.1,
9.9.2, 9.9.3
- Sec. 9.11, Common Memory-Related Bugs in C Programs
- Ch. 10, System-Level I/O
- intro, p. 862
- Sec. 10.1-10.3, 10.8-10.10
- App. A, Error Handling, p. 999
King, CP:AMA
- Don't forget to look at the Q&A at the end of each
chapter.
- Preface
- Ch. 1, Introducing C
- Ch. 2, Fundamentals (this should be mostly review for you, but
read it anyway)
- Sec. 3.1, The
printf
Function
- Ch. 4, Expressions, with attention to these parts:
- Sec. 4.1, top of p. 55, Implementation-Defined Behavior
- Sec. 4.2, top of p. 59, Side Effects; p. 59-60, Lvalues
- Sec. 4.3, Q&A, top of p. 68, Sequence Points
- Sec. 4.4, middle of p. 65, Undefined Behavior
- Ch. 7, Basic Types
- Sec. 7.3, Character Types
- Sec. 7.6, The
sizeof
Operator
- Ch. 9, Functions
- Ch. 11, Pointers
- Ch. 12, Pointers and Arrays
- Ch. 13, Strings (except scanf()
and gets() in Sec.
13.3)
- Ch. 14, The Preprocessor
- Ch. 15, Writing Large Programs
- Sec. 15.2, Header Files (#include)
- Sec. 15.4, Building a Multiple-File Program (make)
- This chapter is important; we'll get to it all eventually.
- Ch. 16, Structures, Unions, and Enumerations
- Sec. 16.5, Enumerations, can be skipped
- Ch. 17, Advanced Use of Pointers, esp. Sec. 1-5 and the
Q&A
- Ch. 21, The Standard Library
- Ch. 22, Input/Output
- Sec. 22.1, Streams
- Sec. 22.3, Formatted I/O
- Sec. 22.4, Character I/O
- Sec. 22.5, Line I/O
- Ch. 23, Library Support for Numbers and Character Data
- Sec. 23.2, The <limits.h>
Header: Sizes of Integer Types
- Sec. 23.5, The
<ctype.h>
Header:
Character Handling
- Sec. 26.2, The <stdlib.h>
Header: General Utilities
- p. 687-9 (incl. third and fourth Q&A, p. 701-2)
- Sec. 26.3, The <time.h>
Header: Date and Time
- Ch. 27, Additional C99 Support for Mathematics
- Sec. 27.1, The
<stdint.h>
Header (C99):
Integer Types
- Sec. 27.3, Complex Numbers (C99)
- Sec. 27.4, The
<complex.h>
Header (C99):
Complex Arithmetic
- Sec. 27.5, The
<tgmath.h>
Header (C99):
Type-Generic Math
- App. B, C99 versus C89
- App. C, C89 versus K&R C
- App. D, Standard Library Functions
- App. E, ASCII Character Set
Skill set
- You should be able to read a man page, or find equivalent
information on the web. But since the exam is closed-book,
closed-computer, we won't test this skill directly.
- You should be able to read a makefile. By the time of
the second exam, you should be able to write one.
- You should be familiar with the Unix utilities that have been
demonstrated in the lectures and that were useful on the
projects. For example, od (octal dump, to see the bytes of a
file), elfdump (to
interpret the bytes of an executable file), etc.
- There won't be any questions on the Unix editors, since we
never specified which one you should use.
- Generally speaking, any programming example in the lecture
notes or project solutions would be good to know.