Posts

CST334 Persistence, IO Devices

 As is pretty much every topic in this course so far, this week's persistence topics were very illuminating.  We covered IO devices with a specific focus on hard drives.  Not only hard drives, but some of the topics about legacy hard drives, the platter kind that I grew up with.  On my old 386, I recall having to set up the drive specifications in the main board's BIOS for it to recognize and use the drive correctly.  I didn't entirely understand  what  I was inputting for settings, but this week brought it home.  We also discussed file systems, how they can be organized, and how they can be accessed.  An important distinction was made between two different types of IO devices.  There are block devices such as hard drives, and there are character devices.  Character devices stream data byte-by-byte.  This data stream can be ephemeral; if the data fails to be captured at the other end, it is gone.  Though I presume th...

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...

CST334 OS Week 1

 Intro Week We covered: Introduction to Operating Systems Computer Architecture Linux and the Shell Programming in C Command Line Intro Math (binary <-> hex) GDB debugging Operating systems provide a way to connect user space programs to the hardware and resources in a safe and shared manner. Computer architecture discusses the role of the cpu, memory, persistent storage, and other input/output devices like keyboards, mice, printers, displays, etc. The history of Linux, Unit, and other *nix/Posix OSes were discussed.  Linux was derived from Unix ideas and approaches, but not from Unix code, as Unix code was closed source.  Richard Stallman created the GNU Project, the open source effort to deliver Unix-like tools (and more).  Linus Torvalds developed, and still maintains, the Linux kernel.  Today, the two together make GNU/Linux. Programming in C is difficult.  It is difficult because, unlike a lot of other languages we've used up until now, C is "sim...

CST363 Database Week 0 and 1

Week 1 introduced us to the class topics, our professor, our tech setup. This class uses Postgres hosted inside of a docker.  The professor made it easy to set up with an image ready for us to download.  I've used MySql, MariaSql, and SqlLite before, but not enough to become very familiar with them.  I'm looking forward to learning more about Postgres. It looks like we'll be using some Python as well.  Our first homework had us using Python to manage a kind of table with functions to create, update, and delete rows. The labs take the form of long .sql files.  Questions are asked and the answers come in the form of sql statements.  I'm really enjoying this format so far; I already feel like I have more experience with typing and remembering sql.