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).

Lecture 14: 2016-05-02 [slides] [recording]
Caching: motivations, general approach. Memory hierarchy. Cache design and layout. Direct-mapped caches, fully associative caches, set-associative caches.
Lecture 15: 2016-05-04 [slides] [recording]
Direct-mapped caches, fully associative caches, set-associative caches (cont). Cache performance analysis: modeling and testing performance. Cache utilization and memory mountain. Impact of multi-core on hardware caching.
Lecture 16: 2016-05-06 [slides] [recording]
MSI cache coherence protocol. Multi-core caching protocols: MESI, MOSI, MOESI, MESIF. Multicore cache performance issues: false sharing, ping-ponging. Virtualization: virtual processors, processes, process context. Context-switch mechanism.

Lecture 17: 2016-05-09 [slides] [recording]
Virtualization: control process, privilege levels, operating modes. Exceptional control flow: interrupts, traps, faults, aborts. IA32 privilege modes, gates, INT and IRET instructions. Operating systems and kernels.
Lecture 18: 2016-05-11 [slides] [recording]
UNIX operating system calls via IA32 Traps. Direct Memory Access (DMA) and DMA transfers. User-mode exceptional flow control: UNIX signals, signal handlers.
Lecture 19: 2016-05-13 [slides] [recording]
UNIX signal handlers and reentrancy. Guranteed-reentrant UNIX functions. Process "pending" and "blocked" signal-masks. sigsetjmp(), siglongjmp(), and signal masks. UNIX process model: process IDs, forking processes, process termination status, reaping zombie processes.

Lecture 20: 2016-05-16 [slides] [recording]
Signal handlers and multiple signals. Operation of execve(). New program's stack layout: environment, command-line arguments. Command shells, fork() and execve(). UNIX process model implementation: states (ready, running, blocked, suspended, ...).
Lecture 21: 2016-05-18 [slides] [recording]
Process Control Blocks. Process management operations. Scheduling. Process behavior categories: interactive, long-running/compute-intensive, real-time. Scheduling algorithms: Round Robin, Shortest Jobs First.
Lecture 22: 2016-05-20 [slides] [recording]
Scheduling algorithms: Earliest-deadline first, multilevel feedback queues. Introduction to virtual memory and address translation. Memory management unit. Isolated process address-spaces. Shared memory. Fast context-switches.

Lecture 23: 2016-05-23 [slides] [recording]
Disk-backed virtual memory. Page-faults and pagefiles. Memory-mapping files with UNIX mmap(). Page permissions and general protection faults. Translation Lookaside Buffers (TLBs). Multi-level page tables: page directories, page tables.
Lecture 24: 2016-05-25 [slides] [recording]
IA32 page directory entries and page table entries. Translation Lookaside Buffers (TLBs), TLB hits, TLB misses, partial TLB hits. Linux process memory layout: kernel code/data region, process virtual memory structures, resolving faults.

Lecture 25: 2016-06-01 [slides] [recording]
The anonymous file. Shared memory objects. Private memory objects, private copy-on-write (COW). fork() and private-COW. execve() and Linux process virtual memory structs.
Lecture 26: 2016-06-03 [slides] [recording]
Final exam review.