Skip to content

CS 315-02 Lecture/Lab Meeting Summary — Fall 2025

  • Date: Sep 18, 2025, 02:49 PM Pacific Time (US and Canada)
  • Zoom Meeting ID: 868 6589 0521

Quick Recap

  • Greg announced interactive grading sessions and outlined how students should sign up for Zoom slots.
  • The lecture covered RISC-V memory instructions and struct access, including memory alignment requirements in both RISC-V and C.
  • The session concluded with:
  • Linked list implementation in assembly
  • Memory inspection techniques
  • GDB debugging commands
  • Announcements about uploaded materials and upcoming office hours

Next Steps

  • Students
  • Submit the project by Monday night for Tuesday’s interactive grading.
  • Sign up for interactive grading slots on the Google Sheet.
  • Prepare for interactive grading (code discussion, terminal workflow, etc.).
  • Sign up for assessment slots during or outside lecture periods.
  • Prepare for GDB navigation and code explanation for upcoming assessments.
  • Set up virtual machines as a backup for accessing course resources.
  • Greg
  • Send out a Google Sheet for interactive grading slots on Monday.
  • Speak at Professor Wolber’s Horizons class about AI and AI agents on Tuesday.
  • Arrange assessment slots outside lecture time, especially in the afternoon.
  • Greg, Shreyas, and June
  • Conduct interactive grading sessions on Tuesday.
  • Atreus
  • Provide assessment slots during the regular lecture period on Tuesday.

Summary

Interactive Grading and RISC-V Memory

  • Interactive grading is scheduled for Monday night and Tuesday in 20-minute Zoom slots with Greg, Shreyas, or June.
  • Session expectations:
  • Work from the shell
  • Clone repos
  • Use terminal-based editors
  • Be prepared to discuss and answer questions about code
  • RISC-V memory instructions discussed:
  • Load/store operations
  • Variants such as LB (load byte with sign extension) and LBU (load byte unsigned)
  • Why LDU is unnecessary on 64-bit machines

Struct Access and Memory Alignment (RISC-V)

  • Struct field access was compared to array element access using calculated byte offsets.
  • Alignment rules highlighted:
  • Words align at addresses that are multiples of 4
  • Doubles align at addresses that are multiples of 8
  • Practical motivations (briefly noted): hardware efficiency and cache behavior.

C Memory Alignment and VM Performance

  • C compilers insert padding in structs to satisfy architectural alignment constraints.
  • Examples demonstrated how field offsets and padding affect layout.
  • VM performance updates:
  • Sam is reducing Ubuntu image startup time.
  • Greg is preparing a lighter Debian-based image for faster boot and SSH.

Assembly Structs and Load Instructions

  • Accessing struct fields in assembly:
  • Use LWU for unsigned loads and LB (or other signed loads) appropriately to avoid sign-extension issues.
  • Demonstrated generating assembly from C with GCC and compared unoptimized vs. optimized output.
  • A short break preceded the linked list segment.

Linked Lists: Concepts and C Implementation

  • Overview of singly vs. doubly linked lists:
  • Singly linked lists use a next pointer.
  • Doubly linked lists use next and previous pointers for efficient removal.
  • Covered node structure and pointer sizes on 64-bit systems.

Assembly Linked List Implementation Demo

  • Built a linked list in assembly by creating nodes on the stack and linking via pointers.
  • Walked through a list-counting routine, detailing instruction flow and register usage.
  • Used GDB to debug and inspect memory values.
  • Previewed future tasks: finding maximum values and implementing printf.

Memory Inspection and List Traversal

  • Demonstrated techniques for:
  • Examining memory and pointer updates
  • Inspecting node layout relative to struct alignment
  • Stepping through a traversal loop until the terminal null pointer

GDB Debugging Commands Clarified

  • Clarified step vs. next:
  • step: executes into calls (single instruction granularity)
  • next: steps over calls
  • In assembly contexts, both may behave similarly depending on the environment
  • Materials from recent lectures were uploaded; today’s content will be posted later.
  • Office hours will be held tomorrow and Monday.

Note on Transcript Gaps

  • Portions of the transcript were informal and fragmented, without actionable items or substantive topics; those sections were omitted for clarity.