Exam 1 Review Flashcards
(33 cards)
Roles of An Operating System
-Providing application programmers a clean abstract set of resources instead of the
messy hardware ones(“extended machine”)
-Managing hardware resources (“resource manager”)
Operating System as an Extended Machine
- Computer architecture at the machine language level is primitive and awkward to
programmers– Instruction set, memory organization, I/O, bus structure - A disk I/O example– CHS (Cylinder-Head-Sector) addressing– Commands for reading, writing, moving arm, spinning, resetting, etc.
- A simple, high-level abstraction desired– E.g., a collection of named files for read/write/close
Operating System as a Resource Manage
- A top-down view: OS as providing abstractions
- A bottom-up view: OS manages all the pieces of resources– Processors, memories, timers, disks, networks, printers, etc.– Provide an orderly and controlled allocation for competing apps– E.g. a printer shared by multiple programs/users– E.g. memory and disks shared by multiple programs/us
In time – time multiplexing
– Multiple programs share the hardware resource in time by switching the shared resource among programs, and at
any time, a program uses the hardware in its entirety
– E.g., multiple programs share the keyboard – at any time, one program uses the entire keyboard, and OS will
switch sharing the keyboard among programs (a keyboard cannot be divided in space and shared)
In space – space multiplexing
– Multiple programs share the hardware resource, but each program only uses part of the resource at any time, not
the entire hardware (a resource is divided and shared in space)
– E.g., main memory and hard disks, shared by multiple programs at any time, but each program only uses part of
the entire main memory resource and part of the entire hard disk resource
(1945–55) Vacuum Tubes
- Digital computers were largely tried during WWII
- Operating system doesn’t really exist yet
- The usual mode of operation was:
– The programmer sign up for a block of time using the signup sheet
– Come down to the machine room, insert his or her plugboard
– Spend the next few hours hoping that none of the 20,000 or so vacuum tubes would burn out
during the run
– Seconds spent even for the simplest calculation
(1955–65) Transistors and Batch Systems
- “Mainframes”
- Mostly used for scientific/engineering calculations, e.g., solving partial differential
equations (Fortran/assembly) - Figure 1-3. An early batch system.
(a) Programmers bring cards to 1401. (b)1401 reads batch of jobs onto tape. (c) Operator carries input tape to
7094. (d) 7094 does computing. (e) Operator carries output tape to 1401. (f) 1401 prints output.
(1965–1980) ICs and Multiprogramming
- By early 1960s, two product lines of word
oriented scientific computers and
character-oriented commercial ones - IBM System/360, OS/360
– 1st major computer line using ICs– “one family” idea
– Multiprogramming (multi-tasking) idea - CTSS/MULTICS–
Compatible Time Sharing System
– Multiplexed Information & Computing Serv.
– Multiuser/computer utility - Minicomputers DEC PDP series
– Lead to Unix from PDP-7 Ken
Thompson/Dennis Ritchie, 1969
(1980–Present) Personal Computers
- Large-scale integration circuits lead to radical changes
– Personal computers/microcomputers - Intel 8080 first general-purpose 8-bit CPU in 1974
– A disk-based OS CP/M (control program for microcomputers) - IBM PC debuted early 1980s
– DOS (Disk Operating System) /MS-DOS - Apple Macintosh with GUI
– Originated from Xerox PARC machines and Stanford Research Inst. - Windows (based on MS-DOS), 95/98/NT/2000/XP/Vista/7/8/10
- Unix (System V/BSD/Solaris), Linux, X Window GUI (X11)
34 - Network Operating Systems/Distributed Operating Systems
Application software
-Written in high-level language
– Go through layers of translation to instructions
System software
Compiler: translates HLL code to machine code
– Operating System: service code
* Handling input/output
* Managing memory and storage
* Scheduling tasks & sharing resources
Processors
fetch, decode, and execute instructions
Instruction Set
– Each processor has a specific set of instructions that it can execute
– “Architecture”, e.g. X86 v.s. ARM, CISC v.s. RISC
– TRAP instruction: switch from user mode to kernel mode to invoke functions in the OS kernel (i.e. to
execute a system call)
Registers
– Most registers are a type of “memory”
– Hold instructions, key variables, and temporary results to bridge gap b.t. processors and main memory
Program Counter (PC)
– Contains the memory address of the next instruction to be fetched
– “instruction address”
Stack Pointer (SP)
– Points to the top of the current stack in memory
Program Status Word (PSW)
– Contains the condition code bits, e.g. CPU priority, mode (user/kernel)
-Needed in system calls and
Special Registers
Managed by software (complier, OS), different from “cache” – managed by hardware
Multithreaded Processor
- Replicate both functional units & control logic (PCs, SPs, etc.)
- Hardware “multithreading” or “hyperthreading” (Intel) processors/chips
– The processor holds state of multiple threads and switch back & forth - A multithreaded processor may appear as multiple CPUs to OS
– Each thread may appear as a separate CPU
– Can impact schedulin
Registers
– Part of CPU (internal)
– Typically 32x32-bits for a 32-bit CPU/64x64-bits for a 64-bit CPU
– Managed by?
(software, compiler or OS)
Cache (memory)
– Principle of ?
Principle of Locality!
– Store temporary data/instructions to explore programs’ spatial/temporal locality
– Main memory divided into cache lines (blocks) & temp stored in cache
– Cache hit, cache miss, average memory access time
– Placement (n-way set associative), replacement (random, pseudo-LRU)
– Managed by ?
(hardware, transparent to soft
Cache p2
- Multiple levels of cache memory usually
- First level cache (L1 cache)
– Inside CPU
– Separate for data and inst.; L1 data cache/L1 inst. cache - Second level cache (L2 cache)
– Usually shared for data and instructions
– Larger and longer latency than L1
– Can be on-chip/off-chip– Can be shared/separate for multicore processors - “LLC”: Last Level Cache
Memory Hierarchy
Closer to processor: faster, smaller, and more expensive
Main Memory and Other Memory
- DRAM (Dynamic Random Access Memory), volatile
- 3-D stacked memory, Hybrid Memory Cube (HMC), High Bandwidth Memory (HBM)
- Managed by software (with hardware support)
- Nonvolatile RAM:
- ROM (Read Only Memory) (programmed at factory, can’t be changed)
- EEPROM (Electrically Erasable Programmable ROM)
- Flash memory (for firmware)