Learning Journal - Week 29
From this past week in CST-334, we spent some time learning about how memory in managed in the operating system, and specifically about the concept of Virtual Memory. I learned that the operating system doesn't let programs directly access real physical memory, but rather only a virtual slot of memory, and then the Memory Management Unit built in the CPU translates the virtual memory address into a real memory address.
With the concept of memory in mind, we also went over how the C programming language gives us tools to interact with memory using functions like malloc() to manually allocate memory and free() to manually designate memory as freed.
We also spent time investigating deeper into how the MMU actually translates virtual memory into physical memory using processes like Base and Bounds which denotes the start point of an address and how much space it can cover, as well as the strategy of Segmentation which splits up the memory into 3 separate segments and splits them across physical memory.
We also learned about Paging -- a more modern solution for memory management, which aims to solve some of the downfalls of base and bounds. Where base and bounds can leave unused, wasted space inside of and between memory (called Fragmentation), Paging divides the memory into fixed sizes and splits virtual addresses across the equal-sized parts of the physical memory.
One thing I wasn't 100% sure on were the different algorithms of segmentation, but after reading some peer discussion posts on it it did make it more clear to me. It was a subject of the reading, but it was only briefly mentioned. These three algorithms are best-fit, worst-fit, and first-fit. I found a resource that goes more in-depth on how it operates, so I think I'll check it out and spend some more time understanding them: https://www.geeksforgeeks.org/operating-systems/partition-allocation-methods-in-memory-management/
Other than that, I found the whole section relatively easy to follow and being able to play along with memory in C really helped to tie everything together. I've overall gotten a deeper appreciation and understand for how operating systems manage memory, and I found myself genuinely interested by the whole process of memory virtualization.
A lingering question I did have, however, was what exactly 'Awk' is? I found it in one of our discussion posts, but I couldn't find any resources on it from this week's learning; doing some surface level research it appears to be a way to manage results in terminal. The examples I found really made it seem like it was used as a column filter, much like how a projection works in a database or SQL.
I'm sure in the coming weeks we'll dive more into memory management, and maybe we'll spend some more time looking at how the terminal works and the deeper operations we can use with it.
Comments
Post a Comment