Schedule


Below is a preview of our week-by-week plan for the entire quarter. There may be slight adjustments and rearrangements as we go. The schedule for the final project is set and will not change.

In the readings below, K&R refers to Kernighan and Ritchie’s classic text The C Programming Language (accessible via Stanford’s subscription to Safari Books Online). Nick Parlante’s EssentialC is another great C reference. Please do the recommended readings before lecture for best effect!

Date Topics/Readings
Week 1
Lecture
Mon 1/7
Introduction and Welcome ( slides )
Lab/assign No lab in first week Assignment 0: Choose Lab Section, Learn Git ( writeup )
Lecture
Fri 1/11
ARM processor and architecture ( slides , code )
Week 2
Lecture
Mon 1/14
ARM assembly and machine code ( slides , code )
Lab/assign Lab 1: Setup your Raspberry Pi ( writeup )

Please do the Lab 1 prelab preparation before coming to lab.

Assignment 1: Implement a Larson Scanner ( writeup )
Lecture
Fri 1/18
From Assembly to C ( slides , code )
  • Review ARM manual section A3.2 and 3.3 on conditional execution and branch instructions
  • Brush up on C basics (syntax, data types, operators, control structures, function calls) via your favorite C reference; sections 1-2 of Nick Parlante’s EssentialC; or chapters 1, 2, and 3 of K&R. Skip content on I/O and standard libraries (we are bare metal!)
  • Read Dennis Ritchie’s account of the history of C.
  • Link to Compiler Explorer demoed in lecture
Week 3
Lecture
Mon 1/21
C Pointers and Arrays ( slides , code )
  • Note: Monday is a university holiday. Julie will cover key content in a makeup lecture so we can keep on schedule. Please come Monday evening 7pm in Gates B12 if you are willing/able (or watch screencast once posted).
  • Before lecture, read EssentialC chapters 3 (skip material on structures) and 6 (skip material on the heap and memory management) or K&R 5.1-5.4. C-strings are primitive compared to Java/C++ strings; take note of the manual effort required to use and pitfalls to avoid.
  • Poul-Henning Kamp’s essay on The Most Expensive One-byte Mistake. Did Ken, Dennis, and Brian choose wrong with NUL-terminated text strings?
  • The screencast of Monday’s night session.
Lab/assign Lab 2: Below C Level ( writeup )

Prelab to prep before lab.

Assignment 2: Implement a Clock ( writeup )
Lecture
Fri 1/25
C Functions ( slides , code )
  • Read up on C functions (Chapter 4 in K&R, or Section 4 in Essential C).
  • Read Thinking Geek’s explanation of the mechanics of local variables and stack frames.
Week 4
Lecture
Mon 1/28
Communication and the Serial Protocol ( slides , code )
  • Read about characters and strings, IO functions (putc,puts,printf), and structures (Sections 1.5, 1.6, 1.9, 5.5, 6, 7 in K&R; or Section 3 in EssentialC).
  • Read Sparkfun’s tutorial on serial communication.
Lab/assign Lab 3: Debugging and Testing ( writeup )

Prelab to prep before lab.

Assignment 3: Implement a String Formatting Library ( writeup )
Lecture
Fri 2/1
Modules, Libraries, and Linking ( slides , code )
Week 5
Lecture
Mon 2/4
Memory Management ( slides , code )
  • Read up on malloc and the operation of the heap (K&R 5.6-5.9 or Essential C Section 6). Consider the comparison/contrast between stack and heap allocation.
Lab/assign Lab 4: Linked and Loaded ( writeup )

Prelab to prep before lab.

Assignment 4: Backtrace and Malloc ( writeup )
Lecture
Fri 2/8
C Mastery ( slides , code )

We’re at the halfway point! We will use this lecture to catch-up/expand on lecture content covered lightly on first pass, and discuss how to further your mastery of C.

Readings:

Week 6
Lecture
Mon 2/11
Keyboards and the PS/2 Protocol ( slides , code )
  • Read Adam Chapweske’s overview of the PS/2 protocol for keyboards and mice.
Lab/assign Lab 5: Keyboard Surfin ( writeup )

Prelab to prep before lab.

Assignment 5: Keyboard and Simple Shell ( writeup )
Lecture
Fri 2/15
Graphics and the framebuffer ( slides , code )
Week 7
Lecture
Mon 2/18
President's Day Holiday
Lab/assign Lab 6: Drawing into the Framebuffer ( writeup )

Prelab to prep before lab.

Assignment 6: Graphics Library and Console ( writeup )
Lecture
Fri 2/22
Interrupts ( slides , code )
Week 8
Lecture
Mon 2/25
Interrupts, cont'd ( slides , code )
  • After we finish interrupts, I hope to have a little spare time for catch up. See C Mastery entry in full schedule for readings/slides on code style.
Lab/assign Lab 7: Raspberry Pi, Interrupted ( writeup )

Prelab to prep before lab.

Assignment 7: System Monitor with Interrupts ( writeup )
Lecture
Fri 3/1
Sensors ( slides , code )
Week 9
Lecture
Mon 3/4
Computer Arithmetic, Signed and Unsigned ( slides , code )
Lab/assign Project Lab 1: What is Your Project? ( writeup )
  • Plan to attend the same lab as your teammates
Final Project ( writeup )
Lecture
Fri 3/8
Performance and Computer Architecture ( slides , code )
Week 10
Lecture
Mon 3/11
Wrap ( slides )
Lab/assign Project Lab 2: How Are You Doing? ( writeup )
  • Plan to attend the same lab as your teammates
  • If not using your PS/2 keyboard for your project, please bring to lab to return to us.
Lecture
Fri 3/15
No lecture (payback for attending on MLK, thank you!)
Week 11
Final projects due Fri 3/22