CST 334 - Week 3

This week, I learned about the various factors of free space management. This includes the way operating systems virtualizes memory through the use of virtual addresses. This is when a process tries to load into an address, the OS works with the support of hardware will ensure that it goes into a different virtual address. This gives the illusion that there is a large, private address space for each running program. This tactic is transparent to the programs where only the OS knows where in the physical memory the instructions and data resides. To help eliminate the waste of free space in the memory, a segmentation tactic is used where a base and bound pair is is generated for each logical segment instead. With this tactic, the code, stack, and heap are now placed in different parts of physical memory independently of one another by the OS. 

I spent a significant amount of time practicing and ensuring I identified the patterns in getting the calculations correct when determining the physical address. If the values are given in hex, I would convert it to binary, so I can see the first two bits of the virtual address, which will tell me which segment it is in. 0b00 is the code segment and 0b11 is the stack segment. From here, I will take the last half of the virtual address (the offset) and check if it is within the segment's bounds.  If the offset is greater than the bounds, then it is invalid. If it is within the bounds, the offset is then added with the applicable segment's address. In retrospect, this is fairly simple to calculate. I struggled a lot with the finer details like locating the offset, padding with zeros as necessary, and determining the segment. I am glad I took the virtual memory quiz several times as the calculation became much easier afterwards.

Comments

Popular posts from this blog

04 February 2025

Week 7

January 21, 2025