class: title # Paging ## CSC 213 – September 18, 2026 --- # Agenda for Today 1. Department Events 2. Upcoming Work 3. Hexadecimal Review 4. Paging 5. Wrap Up --- # Department Events ## CS Table: Digital Sovereignty .indent[ Tuesday, September 22nd at noon in JRC 224C ] ## CS Picnic (RSVP Required) .indent[ Friday, September 25th at 5pm in Merrill Park East RSVP by Monday (link in email) ] *To receive a token, send an email to let me know you attended no more than 48 hours after the event.* --- class: section, blue # Upcoming Work --- # Assignment 3: Archive Printer **Due:** Monday, September 21st by 11:59pm **Late Deadline:** Wednesday, September 23rd at 10:00am ## Questions **Should the archive printer just display the contents of one archive?** Yes. When you reach the end of the archive data, just return from `print_contents` and the program will exit. --- # Virtual Memory Lab **Due:** Wednesday, September 23rd by 11:59pm **Late Deadline:** Monday, September 28th by 11:59pm ## Questions *No new questions yet.* --- class: section, blue # Hexadecimal Review --- class: section, gray # Whiteboard: Hex Digits --- # Hexadecimal Math Consider two pointer values: - `p = 0x7FF25310` - `q = 0x7FF2430C` 1. Which pointer has a lower address? 2. If these pointers are the start and end of an array, how large is the array in bytes? *(Hint: the end of an array is a pointer just past the last byte.)* 3. How many bytes do you think an element of the array takes up? --- # Pointer Alignment Which of these pointers are aligned to multiples of 8 bytes? What about 16 or 32 byte alignment? 1. `0x55500410` 2. `0xCA7F00D5` 3. `0x00400008` 4. `0x7FFD1040` 5. `0x64430CC0` 6. `0x1D2C3B4A` --- class: section, blue # Paging --- class: section, gray # Whiteboard: Basic Paging Example --- # Real Parameters for 32-bit x86 Let's consider how the basic paging scheme we just discussed would work on a 32-bit x86 machine. The design of x86 gives us two important parameters: **Pointer Size:** 32 bits (four bytes) **Page Size:** 4096 bytes (4KB) -- From those parameters, we can determine more information about the address space: 1. How large is an address space? In other words, how many bytes can we address with a 32-bit pointer? 2. How many pages make up an address space? 3. Let's assume a single entry in a page table takes up 4 bytes (32 bits). How large will one page table be? --- class: section, gray # Whiteboard: Multi-Level Page Tables --- # Reminders ## Upcoming Deadlines - **Archive Printer:** due next Monday, or Wednesday morning with a token - **Virtual Memory Lab:** due next Wednesday, or the following Monday with a token ## Need help? Use your resources! - Book an appointment during office hours - Attend mentor office hours - Review slides, readings, and other course resources - Use tools like `gdb` and AddressSanitizer to catch and diagnose issues ## Reading - **Beyond Physical Memory: Mechanisms** (OSTEP, Chapter 21) - **Beyond Physical Memory: Policies** (OSTEP, Chapter 22)