Exam 1 Review Flashcards

(33 cards)

1
Q

Roles of An Operating System

A

-Providing application programmers a clean abstract set of resources instead of the
messy hardware ones(“extended machine”)
-Managing hardware resources (“resource manager”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Operating System as an Extended Machine

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Operating System as a Resource Manage

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In time – time multiplexing

A

– 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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In space – space multiplexing

A

– 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

(1945–55) Vacuum Tubes

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

(1955–65) Transistors and Batch Systems

A
  • “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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

(1965–1980) ICs and Multiprogramming

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

(1980–Present) Personal Computers

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Application software

A

-Written in high-level language
– Go through layers of translation to instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

System software

A

Compiler: translates HLL code to machine code
– Operating System: service code
* Handling input/output
* Managing memory and storage
* Scheduling tasks & sharing resources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Processors

A

fetch, decode, and execute instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Instruction Set

A

– 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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Registers

A

– Most registers are a type of “memory”
– Hold instructions, key variables, and temporary results to bridge gap b.t. processors and main memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Program Counter (PC)

A

– Contains the memory address of the next instruction to be fetched
– “instruction address”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Stack Pointer (SP)

A

– Points to the top of the current stack in memory

17
Q

Program Status Word (PSW)

A

– Contains the condition code bits, e.g. CPU priority, mode (user/kernel)
-Needed in system calls and

18
Q

Special Registers

A

Managed by software (complier, OS), different from “cache” – managed by hardware

19
Q

Multithreaded Processor

A
  • 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
20
Q

Registers

A

– 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)

21
Q

Cache (memory)

A

– 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

22
Q

Cache p2

A
  • 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
23
Q

Memory Hierarchy

A

Closer to processor: faster, smaller, and more expensive

24
Q

Main Memory and Other Memory

A
  • 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)
25
I/O Devices
* I/O devices heavily interact with OS (in addt. to CPU & memory) * Generally consist of – A controller: a chip/a set of chips controlling the device (can be complex) – The device itself, e.g. disks, NIC (network interface card) * Device Driver – The software that talks to the controller – Part of OS, manage devices and hide dirty hardware details
26
Processes/Threads
* Processes: running programs * Associated with an address space * Associated with registers – Including PCs, SPs * Associated with other resources – List of open files, signals, related processes
27
Processes/Threads (cont.)
* Process control block (PCB)/process table – A data structure (array/linked list) managing associated resources * Threads: – Lightweight processes, without own address space A process is fundamentally a container that holds all the information needed to run a program (binary, executable file)
28
Process Tree and IPC
* A process can create other processes – Root/Child processes, process tree – In Unix, an “init” process is the root of all other processes with PID=1 usually * Interprocess Communication (IPC)
29
Files
* File: an abstraction of a collection of bytes * Directory: a special file containing “pointer” to other files/directories * Root directory: top of the directory hierarchy * Path (absolute/relative) – /Students/Leo/foo * Working directory * File descriptor (FD) * File system: a collection of files, directories, and metadata
30
Shell
* Shell: a command-line interface between the user and OS – Many shells exist, e.g., sh, csh, ksh, bash – GUI can be another interface, e.g., Gnome on Linux or Windows Explorer * “prompt”: a character telling user waiting to accept a command – E.g., “$” for bash, “%” for csh * Examples– $ date – $ date > file – $ sort < file1 > file2 ($ sort –k2 foo.txt) – $ cat file1 | sort > /dev/lp
31
shell script
-is a text file with Unix/Linux commands in it -Shell scripts usually begin with a #! (shebang/hashbang) and a shell name (complete pathname of shell). – Pathname of shell can be found using the which command. – The shell name is the shell that will execute this script. * E.g: #!/bin/bash
32
Threads In user space
* Entirely in user space, kernel knows nothing * Kernel manages ordinary single-threaded processes * Threads are implemented by a library * User-level threads can be implemented on an operating system that does not support threads (in kernel)
33
Implementing Threads in Kernel Space
* No run-time system and thread table needed in each process * Kernel manages a thread table keeping track of threads * Thread table holds the same info as with user-level threads