CS24 Spring 2016 - 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.

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: 2016-03-28 [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: 2016-03-30 [slides] [recording]
Basic processor components. Basic processor structure. Writing a program in machine code. C logical and bitwise operations.
Lecture 3: 2016-04-01 [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: 2016-04-04 [slides] [recording]
Subroutines. Stacks. Stack frames, frame pointers. IA32 overview.
Lecture 5: 2016-04-06 [slides] [recording]
IA32 instructions. Operand types, memory addressing modes. The cdecl calling convention for C functions: caller-save vs. callee-save registers, passing arguments and return-values.
Lecture 6: 2016-04-08 [slides] [recording]
IA32 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: 2016-04-11 [slides] [recording]
Vector-Add example: IA32 looping, array indexing. Calling malloc() from IA32. Linked lists. Location of stack and heap in process memory layout. Explicit heap allocators: fragmentation, coalescing free blocks, data alignment.
Lecture 8: 2016-04-13 [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: 2016-04-15 [slides] [recording]
Implicit allocators, indirection and references. Garbage collection algorithms: mark-and-sweep, stop-and-copy, generational garbage collection. Reference counting.

Lecture 10: 2016-04-18 [slides] [recording]
Object-oriented programming model. Objects and instance members. Classes and static members. Polymorphism, virtual functions, static and dynamic dispatch.
Lecture 11: 2016-04-20 [slides] [recording]
Exception handling. C setjmp()/longjmp() functions. Exception mechanisms: stack cutting, exception tables and stack unwinding, tradeoffs.

Lecture 12: 2016-04-25 [slides] [recording]
Midterm review.
Lecture 13: 2016-04-27 [slides] [recording]
Physical constraints on memory. Memory technologies: SRAM, DRAM, magnetic disks, Solid State Drives (SSDs).