02-arch-support

Short History of Operating Systems


CS 4410 Operating Systems[R. Agarwal, L. Alvisi, A. Bracy, M. George, F. B. Schneider, E. G. Sirer, R. Van Renesse]

PHASE 1 (1945 - 1975)

  • Computers Expensive, Humans Cheap

Early Era (1945 – 1955)

  • First Computer: ENIAC

    • Developed at UPenn; weighed 30 tons

    • Utilized vacuum tubes and included card reader/puncher

    • Operated at 100 KHz, performing 5000 additions/second

    • 100-word memory added in 1953

  • Single User Systems

    • Operated one application at a time, requiring reboot after each

    • Early OS consisted of loader and libraries

    • Problem: Low utilization of resources

Batch Processing (1955 – 1960)

  • First Operating System: GM-NAA-I/O

    • Developed for the IBM 704 computer

    • Weighed 10 tons, with a capacity of 40KIPS (40,000 instructions/second)

    • 4K word memory (~18 Kbytes)

  • OS Components

    • Included loader, libraries, and sequencer

    • Problem: CPU idle time during Input/Output

Time-Sharing Era (1960 –)

  • Multiplexing CPU

  • CTSS: First time-sharing OS, developed at MIT Computation Center

    • IBM 7090 computer, marked by the use of transistors

    • Operated at 500 KHz, with an instruction rate of 200 KIPS (68 KFLOPS)

    • 32K word memory

Time-Sharing + Security (1965 –)

  • Multics: Developed at MIT, introduced security rings

  • Used GE-645 computer; operated at 435 KIPS with hardware-protected virtual memory

  • Influenced Development of:

    • Unix (1970), Minix (1987), Linux (1990), Android (2008)

PHASE 2 (1975-2020)

  • Computers Cheap, Humans Expensive

  • Personal Computers (1975 –):

    • 1975: IBM 5100, first portable computer (55 lbs, 5" display)

    • 1977: RadioShack TRS-80, first home desktop

    • 1981: Osborne 1, first laptop (24.5 lbs, 5" display)

Ubiquitous Computing / Internet-of-Things

  • Introduced by Mark Weiser around 1988

  • Personal Computing:

    • PDA (“PalmPilot”) launched in 1992 (512 KB, 16 MHz)

  • Cloud Computing: Introduced Amazon EC2 in 2006

Popular Operating Systems by Market Share (Today)

  • Google Android (2006): Based on Linux, used in phones and tablets

  • Microsoft Windows NT (1993): Widely used on PCs

  • Apple iOS (2007): Used in iPhones and iPads

  • Apple Mac OS X (2001): For Mac desktops and laptops

  • Linux (1990): Primarily serves servers and laptops

PHASE 3 (2020-)

  • Computers → Humans ???

Anatomy of a Computer (Simplified)


CS 4410 Operating Systems[R. Agarwal, L. Alvisi, A. Bracy, M. George, E. Sirer, R. Van Renesse]

Architecture Diagram

  • Components:

    • DEVICE

    • CPU

    • MEMORY

    • REGISTERS

    • ADDRESS BUS

    • DATA BUS

    • CONTROL BUS

"Bus" Concept

  • Collection of lines (wires)

    • Control Bus: Load/Store/Interrupt etc.

    • Data Bus: Number of lines determines word size (e.g., 32 lines = 32 bits/4 bytes)

    • Address Bus: Number of lines determines addressable memory (2^y)

Logical View of CPU and Memory

  • CPU Registers: (pc, sp, r0, r1, …)

  • ALU Operations: STORE, LOAD

  • Memory is an array, using addresses as indexes (00000000 - FFFFFFFF)

Memory Segments

  • Structure of Memory:

    • STACK

    • TEXT (code)

    • DATA

    • HEAP

  • Purpose of Stack: Store intermediate results and maintain control flow

  • Pointers:

    • Stack Pointer (SP)

    • Program Counter (PC)

    • Instruction Pointer (IP)

Stack Operations

  • Before and After Push/Pop

    • Illustrations showing state of memory, SP changes

Control Flow and the Stack

  • Call Function:

    • Saves return address and sets program counter to function's address

  • Return from Function: Restores return address

Arguments and Return Values

  • Passing Arguments:

    • Typically in registers for efficiency; excess pushed onto stack

  • Return Value: Stored in a dedicated register

Control Flow Example

  • Example of nested function calls and stack frames for main, function f, and g

  • Displaying details like PC/IP and SP at various stages

Architectural Support for Operating Systems

  • Outline:

    1. Support for Processes

    2. Support for Devices

    3. Booting an OS

Architecture Support for Processes

  • Supervisor Mode:

    • Kernel operates with unrestricted access to hardware

    • User code runs in restricted mode

  • Process Management:

    • PCB maintains information on each process, including page table and kernel stack

How the Kernel Gains Control

  • Controlled through booting, signals

Types of Signals

  • Exceptions (Synchronous, Non-maskable): Process errors, privileged instructions

  • Interrupts (Asynchronous, Maskable): HW devices requiring OS service

  • System Calls: User requests to OS

Interrupts Management

  • Managed by an Interrupt Controller; processes priority levels

Interrupt Processing Objectives


    1. Handle the interrupt


    1. Remove its cause


    1. Restore prior execution state

Two Stacks in Use

  • User Stack vs Kernel Stack:

    • Must remain separate for security and efficiency reasons

Summary and Mode Switching

  • Modes: Supervisor (Kernel mode) vs User mode

  • Switching Mechanisms: Utilizing signals and interrupts

Interrupt Handling in Software

  • Handler invoked by hardware; pushes current registers onto kernel stack

  • Importance of saving registers during context switch explained

Typical Interrupt Handler Code Example

  • Explains how to manage clock interrupts in C

Signal Handling from Process Point of View

  • Interrupts: Typically transparent to process state

  • Exceptions: Usually terminate the process

Starting a New Process

  • Steps for Initialization:

    1. Allocate and initialize a PCB

    2. Set up page table

    3. Push arguments onto user stack

    4. Simulate interrupt to initialize context

RISC-V Interrupts

  • Control and status registers facilitate interrupt management

Device Management

  • OS manages and multiplexes I/O devices

  • Examples of Devices: Keyboard, mouse, printers, network, etc.

Architecture for Device Management

  • Devices represented as (pseudo)memory accessible through operations

Device Drivers

  • Module handling specific hardware, part of OS architecture

Booting an Operating System

  • Boot Sequence: Initial steps for loading and starting the OS from BIOS to kernel initialization

Summary of Booting Steps

  • Detailing the necessary steps from booting to initializing all system components

Diagram of O.S. Code Architecture

  • Outlining the layers and interactions in an operating system, highlighting user and kernel spaces.