CST334: Operating Systems, Week 3
Identify the topics we covered in class -- you can start by listing them.
- Address Spaces
- C Memory API
- Address Translation & Base-and-Bounds
- Segmentation
- Paging
Explain what each of the topics were in your own terms -- take the identified topics and add a sentence or two explaining them
Address Spaces
An address space is the program's "view" of memory. It includes code, the stack, and the heap. The OS gives the illusion that it has its own private chunk of memory. In actuality, the OS is juggling many processes all at once and is keeping them isolated.
C Memory API
This covers how memory is actually allocated in C. Stack memory is created when a function is called, and heap memory is allocated manually using malloc() and freed with free(). We also discussed the common mistakes about allocating memory, not allocating enough memory, or forgetting to free it.
Address Translation & Base-and-Bounds
The CPU takes a virtual address from a program, adds the base value, checks the bounds to make sure it's legal, and translates it into a physical address. These steps are critical in virtualizing memory.
Segmentation
Segmentation gives each logical part of the program (code, stack, heap) its own base and bounds pair. This allows each segment to sit anywhere in physical memory, reducing waste and supporting larger address spaces.
Paging
Paging divides memory into fixed-size chunks instead of variable-sized segments. Each page maps to a physical frame, and a page table tracks all the mappings. This avoids fragmentation and makes memory more flexible.
Identify least-understood topics -- of these topics, which was the hardest for you to write the descriptions.
I struggled with segmentation when it came to the negative growing stack and how to calculate the offsets. I understand the general idea behind segmentation, but the math around getting the offset was shaky for me.
Identify "aha" moments -- which topic did you find it easiest to write about, and why did it make sense?
Paging came easily to me. Breaking everything into fixed-size pages was straightforward. The VPN + offset split was easy to deal with.
Ask questions -- what do you think will come next? Are there any gaps that don't seem to be explained yet?
How does the OS handle page tables for very large address spaces without the tables becoming unmanageable? How does the OS decide what pages to keep in memory vs swap out when physical memory becomes full?
What connections did you see to other classes and applications -- have you used/heard/thought about these topics before?
This week's material connected to what I learned in data structures. Page tables feel like big arrays with structured lookups, while translation itself reminded me of indexing into hash maps or nested structures. Segmentation even feels similar to the idea of breaking a problem into logical subcomponents, which came up a lot in previous CS courses.

Comments
Post a Comment