Posts

Showing posts from July, 2026

CST334 Rain Drop Lock Lock

We had our midterm this week!  Even though it was open book, open internet, I was challenged.  I thought I understood paging, page segmentation, page tables and entries, etc better but even with the material in front of me, I struggled.  The caching wasn't as much of a challenge, but I had a block when visualizing the segmented page table or indices.    This week was all about the concept of mutual exclusion and mutex objects.  We lock and unlock mutex objects to make sure that, during multi-threaded programming, the OS is not interrupting a specific block of code during some critical moment.  Even a line of C as simple as int counter += counter is not as simple as a single step.  A scheculding timer interrupt could pause this calculation and some other thread could totally mess it up by accessing the same shared variables and performing it's own logic on them.  I had been spooked by multi-threaded libraries when I tried to do some pytho...

CST334 OS More Memory Management!

 This week we continued our learning about memory management.  The main topics were paging and swapping.    Paging is a challenge because even keeping track of all the pages can take up an enormous amount of space in memory.  But, if the paging structure can be reduced to just the entries that are occupied, then we can avoid tracking the empty pages and only address the pages in use.  The page directory is the structure used to do so.  The page directory only tracks the pages in use; no need to track empty pages.  This does require some additional overhead in the storage of page directory bits.  But the payoff is big in the form of freed memory. Swap memory lets us access a memory space beyond our physical RAM.  Less used pages are written to the swap file.  If they are required again, they can be promoted back into RAM; at that time, another lesser used page will be written to the swap file.  This is a kind of caching whe...

CST334 OS Week 3 Memory Management

 This week we learned about memory management.  Two approaches were covered: Base and bounds Paging  It is a difficult topic to understand; I spent a lot of time with the reading and the videos.  The page table, especially in the programming assignment, took me a while to wrap my head around how to interact with it in the code.  The concept isn't hard, but I did stumble on VPNs being a certain length compared to PFNs and how both have separate components on the most and least significant sides of the bits.  The base and bounds one really surprised me; I would not have thought there were registers in the CPU that are constantly being swapped out per process and per instruction.  It does make a lot more sense now in light of all the context switching topics discussed previously; I'm truly beginning to appreciate how the CPU really does everything one at a time, no matter how fluid it seems to everyday computer users. I have an old Epson HX-20 that I want...

CST334 OS Week 2

 A lot of topics covered were covered this week. fork() for spawning a new child process from a parent process additional functions exec(), wait() to manage the situation after forking mechanisms, traps, system calls, user mode and kernel mode policies and scheduling processes fifo, sjf, stcf, round robin multi-level feedback queues making sure processes aren't abandoned due to being de-prioritized into oblivion  The fork() concept was interesting to learn about.  The C syntax is so plain but so much is happening when using fork().  How fork() related to the behavior of a shell or command line was very fun to learn about; I'm sure there is a lot more going on there and I'd like to take a deeper dive. I'll admit that after reading about traps - I thought back and barely recalled what I had just read.  Even now as I'm writing about it I'm unsure of it.  There is a trap table, and this table will be used to call specific types of traps, which will in tern jump...