CS24 Spring 2017 - Lecture Slides and Videos

Slides are made available as PDF files. All lectures are recorded in .mp4 format. Each recording is around 30MB in size.

The previous year's lecture slides and recordings are available here.


Debugging Part 1: General Debugging Approaches [slides] [recording]
Bug = Defect + Failure. Assertions. Reproducing and isolating failures. Keeping a debugging log. Understanding the system. Disabling code: commenting out code, using preprocessor directives. Creating simple test cases. Printing out details: flushing output, making lines unique, disabling debug output. Verification, regressions.
Debugging Part 2: Debugging Tools [slides] [recording]
GDB, Valgrind. Setup for debugging.

Lecture 1: 2017-04-03 [slides] [recording]
Introduction, course overview. Signals and logic gates. Overview of instruction set architecture. Data representation for unsigned integers, and two's complement signed integers. Unsigned addition.
Lecture 2: 2017-04-05 [slides] [recording]
Basic processor components. Basic processor structure. Writing a program in machine code. C logical and bitwise operations.
Lecture 3: 2017-04-07 [slides] [recording]
Branching instruction support. Memory architectures. Harvard architecture vs. Von Neumann architecture. Register file and main memory. Load/Store architecture vs. operand types.

Lecture 4: 2017-04-10 [slides] [recording]
Subroutines. Stacks. Stack frames, frame pointers. x86-64 (aka "Intel 64") overview.
Lecture 5: 2017-04-12 [slides] [recording]
x86-64 instructions. Operand types, memory addressing modes. The "System V AMD64 ABI" calling convention for C functions: caller-save vs. callee-save registers, passing arguments and return-values.
Lecture 6: 2017-04-14 [slides] [recording]
x86-64 implementation of C global variables, local variables, and C functions with arguments and return-values. Position-Independent Code (PIC). The memory heap, malloc() and free(). Overview of C arrays, array indexing and pointer arithmetic.

Lecture 7: 2017-04-19 [slides] [recording]
Vector-Add example: x86-64 looping, array indexing. Calling malloc() from x86-64. Linked lists. Location of stack and heap in process memory layout. Explicit heap allocators: fragmentation, coalescing free blocks, data alignment.
Lecture 8: 2017-04-21 [slides] [recording]
Allocation strategies: first-fit, last-fit, best-fit. Implicit free-lists, explicit free-lists. C structs, unions. Data alignment and optimization. Buffer overflows and overflow exploits. Array bounds-checking. Introduction to higher-level language facilities.

Lecture 9: 2017-04-24 [slides] [recording]
Implicit allocators, indirection and references. Garbage collection algorithms: mark-and-sweep, stop-and-copy, generational garbage collection. Reference counting.