CS 134

Key Points

Class Format

  • Each week you'll have lesson material to go through at your own pace.
  • In class, you'll work on homework and check in with Prof. Melissa.
  • During each class meeting, you'll fill out a check-in form to get credit for the day.
  • We may revisit the format as the semester progresses.

Key Take-Aways: OS Basics and CS 105 Review

Operating System Structure and Services

  • Modern operating systems have a layered structure:
    • User Applications
    • System Libraries
    • Kernel Interface (System Calls)
    • Kernel
    • Hardware Abstraction Layer
    • Hardware
  • The OS provides key services to user programs:
    • Process Management
    • Memory Management
    • File System Management
    • I/O Management

Processes and Threads

  • A process is an instance of a running program with its own resources and execution context.
  • Key components of a process:
    • Program Code
    • Data
    • Resources (memory, CPU time, file handles)
    • Processor State
  • The OS manages processes through
    • Process Scheduling
    • Context Switching
    • Inter-Process Communication (IPC)
    • Memory Management
  • Threads are separate flows of control within a process:
    • Share the same memory space and resources
    • Allow for concurrent execution within a single process
    • Managed using libraries like POSIX threads (pthreads)

Memory Management

  • Processes request memory through system calls (e.g., malloc and free in C).
  • The C library often manages smaller memory allocations, using larger chunks obtained from the OS.
  • Key system calls for memory management:
    • brk() / sbrk(): Adjust the program break (end of data segment)
    • mmap(): More flexible memory mapping (modern systems)
  • Virtual Memory and Paging:
    • Provides an abstraction of a large, contiguous memory space
    • Allows for efficient use of physical memory through paging

File Systems and I/O

  • File operations can be performed using:
    • C library functions (e.g., fopen, fprintf, fclose)
    • Direct system calls (e.g., open, write, close)
  • File descriptors are integers representing open files in the kernel.
  • The OS manages file access, permissions, and storage on disk.

Key Concepts from CS 105

  • C Programming: Essential for understanding OS internals and system programming
  • Machine-level Programming: Understanding assembly and how programs interact with hardware
  • Concurrency and Threads: Fundamental for modern multi-core systems
  • Memory Hierarchy: Caches, virtual memory, and their impact on performance
  • I/O and Networking: How programs interact with external devices and other computers

Transition to OS Internals

  • This course builds on CS 105 by focusing on
    • How the OS implements its services
    • Why certain design decisions are made in OS development
    • Practical experience with OS/161, written in C and MIPS assembly

Remember: The goal is to understand not just what an OS does, but how and why it does it that way.

(When logged in, completion status appears here.)