Week 32 - CST334 Final Week

 CST 334 - Week 8

This is our eighth and final week in CST334, also known as Operating Systems.

In this class we learned about virtualization, concurrency, and persistence.

Virtualization

The OS gives each process the illusion of having the CPU to itself, when in reality it is sharing it with the OS and other processes. The OS does this through a variety of ways:

  • Processes are executed directly on the CPU.
  • The CPU uses interrupts and voluntary yields to regularly switch between different processes.
  • The OS saves the current 'context' of each process when it is paused, and loads it when the process is ran again.
  • Many scheduling policies, such as FIFO, Round Robin, or Multi-level Feedback, exist to give different processes a fair amount of CPU time.

The OS also gives each process the illusion of having all memory to itself, when it is likewise sharing memory with other processes.

  • Each process is presented virtual address, which the CPU translates to a physical address.
  • The CPU uses strategies such as base-and-bounds or segmentation to allocate and translate virtual and physical addresses.
  • The CPU uses paging to help reduce fragmentation.
  • The CPU uses Transaction Look Aside Buffers (TLBs) to store memory in I/O devices when it runs out of room in memory. Multiple strategies exist to manage TLBs in an efficient way.

Concurrency

Processes have separate virtual addresses, which prevents them from easily sharing memory. Thread give processes a way to mimic having multiple processes while sharing their memory.

  • Threads share their code and heap portions of memory with other threads under the same process.
  • Locks, condition variables, and semaphores are used to protect shared variables and portions of memory. 

Persistence

Computers use I/O devices both to store and receive data.

  • I/O devices include hard drives (HDDs), SSDs, keyboards, mice, and more.
  • File systems use inodes to store file metadata, bitmaps to store information about free inodes and data blocks, and Superblocks to store filesystem data.
  • User input devices such as keyboards or mice send a stream of data to the computer, which can be lost if not properly stored or handled.

Comments

Popular posts from this blog

Week 4

Week 2

Week 1