Posts

cd week_seven

Journal Entry Week 7 This week we started looking at how computers actually deal with real-world stuff like disks and devices, and then ended up inside how file systems are built from scratch. Topics We Covered I/O Devices (how the OS talks to hardware) Types of devices (block vs. character/stream) Polling, interrupts, and DMA Device drivers Hard drives (structure + performance) Disk scheduling (SSTF, elevator/SCAN) Files and directories (what they actually are) Inodes and links (hard vs symbolic) File system implementation (vsfs, bitmaps, superblock, etc.) How file access actually works (step-by-step reads/writes) Explaining the Topics I/O devices are basically everything that lets the computer interact with the outside world—keyboard, disk, screen, etc. The OS doesn’t talk to them directly in a messy way—it uses a structured system with registers (status, command, data) to communicate. There are two main device types: Block devices (like hard drives) --> you can jump to any locati...

cd week_six

Journal Entry Week 6 Topics We Covered The main topics we covered were: Anderson-Dolan method Using locks and condition variables to make a normal class thread-safe State variables in concurrent code Why busy waiting is bad Why wait() is different from a normal loop Synchronization barriers with semaphores Reusable barriers Turnstile pattern with semaphores How semaphores compare to locks and condition variables Explaining the Topics The Anderson-Dolan method felt like a step-by-step recipe for taking a normal class and turning it into a thread-safe one. Instead of just randomly throwing locks into code and hoping it works, it gives a process: start with a normal design, add a lock, protect the methods, add condition variables, add signal or broadcast, and then add waits inside loops. I liked that because concurrency usually feels messy, and this made it feel more structured. State variables were also a big deal this week. What clicked for me is that they help describe w...

cd week_five

Journal Entry Week 5 This week we moved deeper into concurrency, and now it’s not just “threads exist,” it’s like “threads can absolutely destroy your program if you’re not careful.” At first, I thought threads were just about doing multiple things at once, but now I’m realizing it’s really about controlling that chaos so everything doesn’t break. Topics We Covered Threads and concurrency basics Thread creation (pthread API) Race conditions and critical sections Locks (mutexes) Condition variables Lock performance and implementations Concurrent data structures (counters, lists, queues, hash tables) Explaining the Topics Threads are basically multiple execution paths inside the same program. Instead of one thing happening at a time, you’ve got multiple things running and sharing memory, which is where things start getting tricky. The pthread API is how we actually create and manage threads.  pthread_create() starts a thread, and pthread_join() waits for it to f...

cd week_four

 Journal Entry Week 4 Topics We Covered Free-space management (malloc/free, fragmentation) TLBs (Translation Lookaside Buffers) Multi-level paging (smaller page tables) Swapping / virtual memory beyond physical memory Page faults and present bit Page replacement policies (FIFO, LRU, Random, Optimal) Cache performance (hit rate, AMAT, locality) Explaining the Topics     Free-space management is basically how memory gets handed out and taken back. The tricky part is fragmentation, where memory gets split into little pieces, and even if you technically have enough space, you can’t use it efficiently.     TLBs are like a shortcut for address translation. Instead of checking the page table every time, which is slow, we cache recent translations so we can reuse them quickly. That makes a huge difference in performance.     Multi-level paging solves the problem of page tables being way too big. Instead of storing one giant table, we break it into smaller piec...

cd week_three

Journal Entry Week 3      This week definitely felt like a big jump in difficulty again. Last week was about processes and CPU scheduling, but now we’re getting into memory and how the OS actually manages it. We have moved from how programs run to where everything is stored and how we find it, and that got complicated pretty fast. Topics We Covered Address spaces and virtual memory Base and bounds Segmentation Paging Address translation Memory allocation (malloc/free in C) Fragmentation (internal vs external) Explaining the Topics      Virtual memory and address spaces: each process thinks it has its own memory, but it’s actually mapped to physical memory.      Base and bounds: simple offset + limit system (bounds).      Segmentation: splits memory into logical chunks like code, heap, stack.      Paging: divides memory into equal-sized pages and frames; uses VPN + offset.      C memory: malloc/free...

cd week_two

Journal Entry Week 2      This week felt like things got way more complexed compared to last week. Before, it was kind of big-picture stuff like “what an OS is,” but now we actually started digging into how it really works under the hood, especially with processes and CPU stuff. Topics We Covered Processes (what they are and how they work) Process states (running, ready, blocked) Process API (fork, exec, wait) CPU virtualization Context switching Scheduling basics (FIFO, SJF, STCF, Round Robin) Intro to more advanced scheduling like MLFQ Explaining the Topics      A process is basically a program that’s actually running, not just sitting there as code. The OS takes that program and turns it into something active, with memory, and registers.      The whole idea of CPU virtualization finally clicked a bit more this week. The OS is basically juggling a bunch of processes by switching between them really fast, so it looks like everything is runni...

cd week_one

Journal Entry Week 1      This week was my first real dive into operating systems. Before this class, I saw the OS as just the thing that boots up my laptop. Now I’m starting to see it as the manager of everything happening behind the scenes. Topics We Covered The main topics we covered were: What a program does and how the CPU executes instructions The role of the operating system Virtualization Memory basics Concurrency and multithreading Persistence and file systems OS goals (performance, security, reliability, etc.) Basic computer architecture (CPU, RAM, buses, storage hierarchy) Memory layout of a running program (stack, heap, text, data) Basic command line and compilation workflow Explaining the Topics:      A program is basically a list of instructions, and the CPU’s job is to fetch, decode, and execute those instructions one by one. That seems simple, but when you zoom out, thousands (or millions) of instructions are flying by every second.  ...