# Lecture 1 - Introduction

Source: https://wisconsin.twango.dev/sp26-cs537/lectures/lecture-01

# Lecture 1 - Introduction

**Instructor:** Michael Swift & Tej Chajed
**Topics:** What is an OS, OS abstractions, virtualization, concurrency, persistence, OS history

> [!abstract]- Learning Objectives
> - Understand the purpose of the operating system
> - Understand the position of the operating system in a computer running applications
> - Understand the evolution of operating systems

---

## What is an Operating System?

> **Operating System (OS):** A software layer to abstract away and manage details of hardware resources; a set of utilities to simplify application development.

- "All the code you didn't write" in order to implement your application

```mermaid
graph TD
    A[Applications] --> B[OS]
    B --> C[Hardware]
```

---

## The OS and Hardware

- An OS **mediates** programs' access to hardware resources
  - Computation (CPU)
  - Volatile storage (memory) and persistent storage (disk, etc.)
  - Network communications (TCP/IP stacks, ethernet cards, etc.)
  - Input/output devices (keyboard, display, sound card, etc.)
- The OS **abstracts** hardware into **logical resources** and well-defined **interfaces** to those resources
  - Processes (CPU, memory)
  - Files (disk)
    - Programs (sequences of instructions)
  - Sockets (network)

---

## Why Use an OS?

### Application Benefits

- Programming **simplicity**
  - See high-level abstractions (files) instead of low-level hardware details (device registers)
  - Abstractions are **reusable** across many programs
- **Portability** (across machine configurations or architectures)
  - Device independence: 3Com card or Intel card?

### User Benefits

- **Safety**
  - Program "sees" its own virtual machine, thinks it owns the computer
  - OS **protects** programs from each other
  - OS **fairly multiplexes** resources across programs
- **Efficiency** (cost and speed)
  - **Share** one computer across many users
  - **Concurrent** execution of multiple programs

---

## What Functionality Belongs in an OS?

- No single right answer
  - Desired functionality depends on outside factors
  - OS must adapt to both user expectations and technology changes
    - Change abstractions provided to users
    - Change algorithms to implement those abstractions
    - Change low-level implementation to deal with hardware
- Current operating systems are driven by evolution

---

## Major Themes in OS

### Virtualization

- Taking physical hardware and making a software version that is sharable, easier to use, more powerful
- Examples:
  - **CPU:** We can run two programs at the same time
  - **Memory:** Programs see a linear range of addresses but underlying DRAM is shared in 4KB chunks
  - **Disk:** We use files/folders, disk internally has blocks

### Concurrency

- Maintaining correctness when many things happen at once
- Examples:
  - Code on 2 CPUs try to increment the same variable

### Persistence

- Keep data safe across system crashes/reboots

---

## History of Operating Systems

| Year | Milestone |
|------|-----------|
| 2700 BC | Abacus |
| 1871 | Babbage Analytical Engine |
| 1946 | ENIAC |
| 1948 | ZAM-41 Drum Memory |
| 1950 | Core Memory |
| 1951 | Univac |
| 1952 | IBM 701 |
| 1954 | IBM 704 |
| 1956 | IBM RAMAC (first hard disk) |
| 1960 | Digital PDP-1 |
| 1961 | IBM 7094, Ferranti Atlas |
| 1965 | PDP-8, Electrologica X8, IBM S/360 |
| 1967 | IBM 360/67 + CP/40 |
| 1969 | ARPANET |
| 1970 | GE 645 / Multics, Digital PDP-11/20 + Unix |
| 1973 | Xerox Alto |
| 1975 | Ethernet, MITS Altair |
| 1977 | Apple ][, Digital VAX |
| 1981 | IBM PC |
| 1984 | Apple Macintosh |
| 1985 | Sun Network File System (NFS) |
| 1991 | Windows 3.1 |
| 1993 | Linux |
| 1994 | Mosaic Browser |
| 1995 | Windows 95, Internet |
| 1996 | Google |
| 1999 | VMware, WiFi |
| 2001 | Mac OS X |
| 2004 | Mica Sensor Mote |
| 2005 | Sun UltraSPARC Niagara T1 |
| 2007 | Apple iPhone |
| 2009 | Container Data Center |

---

## Related

- **Navigation:** [[lecture-02|Lecture 2 →]]
- **Exam:** [[exams/midterm-1/index|Midterm 1]]
- **Course:** [[README|CS 537 Map of Content]]
