Thursday, August 8, 2024

Operating Systems - Week 8: Persistence

Persistence in terms of both an operating system and in life, takes work.  Going through this operating systems course we learned about how persistence enables us to save the state of a system, through writing to a something that survives power state changes of your program (or operating system).

The same is true for things we learned in life, we need to over come the challenge of learning new concepts and saving that information for new use.  Thankfully our brain works a little different than a computer and typically commits concepts we learned automatically.  But sometimes it takes repeated attempts at learning a concept to really commit that knowledge to permanent storage in our brain. Think of it as maybe first pass of learning a concept you’re only able to service tier 1 priority concepts.  But given time and going back to refresh, tier 2 and tier 3 concepts are able to be absorbed by our brain. And sometimes things we learn sometimes take a random thought or interruption to remember what we once learned, sort of like needing to XOR something out of parity data.

Overall, Operating Systems and life have a lot in common, key amongst them is persistence.  In order to learn anything and truly understand a concept it takes persistence, both to understand and commit it to permanent knowledge.

Saturday, August 3, 2024

Operating Systems - Week 7: Persistence

 This week we learned a lot about how computers manage and store all that data they can generate.  CPU and RAM are great, but once the power goes out without any persistent storage computers become a whole lot less efficient.  And, well it's not just after the power goes out, but what about when a program crashes or terminates, does it need to compute everything from the start again?

In this week's course, we started from the bottom up.  We learned about different I/O devices a computer can have, and how the CPU or DMA controller can communicate and save data to them.  We covered a particular I/O device, a hard disk, in detail.  Though hard disks with spinning disks are becoming less common today, they are still widely used in cases where capacity and longer term storage are import.  We leaned a great detail about how a hard disk works physically with the head writing data to the platter and why random vs sequential has such a huge gap (due to drive head having to seek).  We covered how you can use multiple disks together in RAID for different advantages.  For example, RAID0 giving you a performance boost as the data is striped across multiple disks, or RAID5 or RAID6 giving you a bit of a performance boost (not quite as much as RAID0 using the same amount of drives), but possibly more important (depending on the use case) it gives you redundancy.  RAID5 or RAID6 allow you to have 1 or 2 hard disks fail, respectively, and not loose any data.  We then covered filesystems and how an operating system stores data to an I/O device.  File systems help to organize the data and metadata in a fashion that's easy to represent to an end user.