Quiz 1 Flashcards

1
Q

Four components of computer system

A

Hardware, Application programs, OS, Users

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

OS is a ____ allocator and a ____ program

A

resource allocator and control program

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

One program running at all times on the computer

A

Kernel

  • central component of most OS
  • bridge between apps and data processing
  • manages systems resources

+ Everything else is a system program or app program

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

Loaded at power-up or reboot

A

Firmware

  • initializes all aspects of system
  • loads OS kernel & starts execution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Manages I/O for a Device Controller.

Provides uniform interface between controller and kernel

A

Device Driver

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

In charge of a particular device type.
Each has a local buffer.
Informs CPU that it has finished its operation and causes an interrupt

A

Device Controller

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

Event occurrence is signaled with an ____

A

Interrupt

  • OS is interrupt driven
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Hardware vs Software Interrupts

A

Hardware and software

H) interrupt to the CPU through the bus

S) Executes system call

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

Interrupt Vector

A

contains the addresses of all the service routines

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

Trap or Exception

A

software-generated interrupt caused by an error or user request for operating system service (privileged, see kernel mode)

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

Two types of interrupts

A

Polling and Vectored

P) interrupt controller must poll each device

V) interrupt signal includes the device identity

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

Register that specifies the next instruction to execute

A

Program Counter

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

Request to the OS to allow user to wait for I/O completion

A

System Call

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

Device Controller transfers blocks of data from buffer directly to main memory w/out CPU intervention.
Only one interrupt per block opposed to one per byte

A

Direct Memory Access

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

Storage-Device Hierarchy

A
  1. Registers
  2. Cache
  3. Main Memory
  4. Solid-State Disk (secondary storage)
  5. Hard Disk (secondary storage)
  6. Optical Disk (tertiary storage)
  7. Magnetic Tapes (tertiary storage)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Storage Performance

A
  1. Register: managed by compiler, backed by cache, 0.25-0.5 ns.
  2. Cache: managed by hardware, backed by main memory, 0.5-25 ns.
  3. Main memory: managed by OS, backed by disk, 80-250 ns
  4. Solid-state disk: managed by OS, backed by disk, 25,000-50,000 ns
  5. Magnetic disk: managed by OS, backed by disk or tape, 5,000,000 ns
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Contains entry for each I/O device indicating its type, address, and state

A

Device-status table

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

Multiprocessor Systems (parallel systems, tightly-coupled systems) advantages

A

Increased throughput
Economy of scale
Increased reliability

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

Increases the CPU utilization by organizing jobs so CPU always has one job to execute.
Job selected & run by Job Scheduling

A

Multiprogramming (Batch System)

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

CPU switches jobs so frequently that users can interact with each job while it is running (interactive computing)

A

Timesharing (multitasking)

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

Two types of multiprocessors

A

Asymmetric: master-slave, slave wait for master run its tasks
Symmetric: all processors execute all tasks

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

Dual-mode (User mode & Kernel mode)

A

System call changes mode to kernel (mode bit = 0), return from call resets it to user (mode bit = 1)

-User trying to execute privileged instruction raises “trap”

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

Passive entity vs Active entity

A

Program is passive, process is active.

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

To execute a program all (or part) of the instructions must be in memory.

All (or part) of the data that is needed by the program must be in memory.

A

Memory Management

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

All CPUs have the most recent value in their cache

A

Cache Coherency

26
Q

Any mechanism for controlling access of processes or users to resources defined by the OS

A

Protection

27
Q
User Interface (CLI, GUI, Batch)
Program Execution
I/O Operations
File-system Manipulation
Communications
Error Detection
A

OS System Services Functions

Related to the User

28
Q

Resource Allocation
Accounting
Protection & Security

A

OS System Service Functions

Related to the System

29
Q

Programming interface to the services provided by the OS

Typically written in a high-level language

A

System Calls

30
Q

Main Advantages of using APIs rather than System Calls

A

Program Portability

Some System Calls can be complex

31
Q

System-call Interface

A

Maintains a table indexed according to each system call number

Invoked system call in OS kernel & returns status of the system call & any return values

32
Q

3 methods to pass System Call parameters to the OS

A
  1. Pass parameters in registers
  2. Parameters stored in block or table in memory, address of block passed as parameter in a register.
  3. Parameters pushed onto stack by a program & popped by the OS
    (Block & Stack methods do not limit # or length of parameters passed)
33
Q

6 Types of System Calls

A
  1. Process Control
  2. File Manipulation/Management
  3. Device Manipulation/Management
  4. Information Maintenance
  5. Communications
  6. Protection
34
Q

7 Types of System Programs

A
  1. File manipulation/management
  2. Status information
  3. Programming language support
  4. Program loading & execution
  5. Communications
  6. Background services
  7. Application programs
35
Q

User Goals vs System Goals

A

User: convenient to use, easy to learn, reliable, safe, fast
System: easy to design-implement-maintain, flexible, reliable, error-free, efficient

36
Q

Policy vs Mechanism

A

Policy: WHAT will be done?
Mechanism: HOW will it be done?

+Policy can be easily changed w/out having to change the mechanism

37
Q

4 OS System Structures

A
  1. Simple: MS-DOS (no modules)
  2. More Complex: UNIX (system programs & kernel)
  3. Layered: abstract (easy to modify a layer)
  4. Microkernel: Mach (communication between user modules using Message Passing)
38
Q

Microkernel Benefits & Detriments

A

Benefits
1. Easier to extend a microkernel
2. Easier to port the OS
3. More reliable (less code running in kernel mode)
4. More secure
Detriments
1. Performance overhead of user space to kernel space communication

39
Q

Core Dump vs Crash Dump

OS Debugging

A

Failure of an application can generate a Core Dump file capturing memory of the process.
OS failure can generate a Crash Dump file containing kernel memory

40
Q

Profiling

OS Debugging

A

Periodic sampling of instruction pointer to look for statistical trends

41
Q

Batch system vs Time-shared system

A

Batch: jobs

Time-shared: user programs or tasks

42
Q

Process Parts

A
  1. Text Section (Program Code): current activity including program counter, processor registers
  2. Data Section: contains global variables
  3. Heap: contains memory dynamically allocated during run time
  4. Stack: contains temporary memory (function parameters, return addresses, local variables)
43
Q

5 Process States

A
  1. New: process is being created
  2. Running: instructions are being executed
  3. Waiting: waiting for an event to occur
  4. Ready: waiting to be assigned to a processor
  5. Terminated: has finished execution
44
Q

Process Control Block (PCB)

“Task Control Block”

A
  1. Process state
  2. Program counter
  3. CPU registers
  4. CPU scheduling information
  5. Memory-management information
  6. Accounting information
  7. I/O status information
45
Q

Process Scheduler

A

Selects among available processes for next execution of CPU
+Maintains scheduling queues (stored in kernel as linked list) of processes
+Job queue: set of all processes in the system
+Ready queue: set of all processes residing in main memory, ready & waiting to execute
+Device queues: set of processes waiting for an I/O device

46
Q

Short-term scheduler (CPU scheduler) vs Long-term scheduler (job scheduler)

A

Short: selects which jobs should be executed next. Invoked frequently (milliseconds)
Long: selects which processes should be brought into the ready queue. Invoked infrequently (seconds, minutes). Controls the degree of multiprogramming. Strives for good process mix

47
Q

Processes can be described as either (2)

A

I/O-bound process: spends more time doing I/O than computations, many short CPU bursts
CPU-bound process: spends more time doing computations; few very long CPU bursts

48
Q

Medium-term scheduler

A

Can be added if degree of multiple programming needs to decrease.
May want to remove processes from memory & thus short-term scheduler. Later brought back (swapping).
Can be used to free up memory!!

49
Q

Context Switch

A

When CPU switches to another process, system must “save the state” of old process & load the “saved state” for the new process.
Context of process represented in PCB

Context-switch time is overhead; system does no useful work while switching!

50
Q

Multitasking (IOS vs Android)

A

IOS: single foreground process (via user interface). Multiple background processes (in memory, not displayed, with limits)

Android: runs foreground & background, with fewer limits. Background process uses a service to perform tasks. Service has no user interface, small memory use

51
Q

Process Creation

A

Parent creates children, which create other processes, forming a tree.
Resources: parent & child can share all, some, or no resources.
Execution: parent & child execute concurrently, or parent waits until children terminate.
Address space: child duplicate of parent; child has program loaded into it.

52
Q

Process Termination

A

Process executes last statement, asks OS to delete it using exit() system call. Child status data is returned via wait(). Process resources are deallocated by OS.
Parent may terminate child via abort().
+child has exceeded allocated resources.
+task assigned to child is no longer required.
+Parent is exiting & OS doesn’t allow child to continue is parent terminates.

53
Q

Cascading termination

A

All children, grandchildren, etc. are terminated (termination is initiated by OS)
Zombie: child process that has completed execution but still has an entry in the process table (did not invoke wait())
Orphan: child process that remains running after parent has executed or terminated w/out waiting for the child

54
Q

Google Chrome 3 different types of processes

A

Browser: manages UI, disk & network I/O
Renderer: renders web pages, deals with HTML & Javascript. New renderer for each website opened
Plug-in: One for each type of plug-in

55
Q
Interprocess Communication (IPC)
(4 reasons for, 2 models)
A

Reasons for:

  1. Information sharing
  2. Computation speedup
  3. Modularity
  4. Convenience

2 models:

  1. Shared memory
  2. Message passing
56
Q

Message passing vs Shared memory

A

MP: good for smaller data, easy to implement, requires many syscalls for implementation (thus heavier).
SM: faster b/c syscalls are required only to establish shared region. Then all memory access require no kernel assistance.

(Shared areas reside in the address space of the creating process, is then attached to other processes who wish to access it)

57
Q

Producer-Consumer Problem

unbound-buffer vs bounded-buffer

A

Producer process produces information that is consumed by a consumer process.

UB: places no practical limit on the size of the buffer. Producer doesn’t need to wait; consumer must wait if buffer is empty.
BB: assumes that there is a fixed buffer size. Producer must wait if buffer is full; consumer must wait if buffer is empty.

58
Q

Shared Memory

Area of memory shared among processes that wish to communicate

A
  1. Communication under control of the users, not the OS

2. Major issue is to provide mechanism that allows processes to synchronize their action when accessing shared memory

59
Q
Message Passing
(Mechanism for processes to communicate & synchronize their actions)
A

Message system: processes communicate w/ each other without resorting to shared variables.
2 operations: send & receive.
Message size is either fixed or variable.
(Useful if processes reside in different machines connected through network. “Chat app”)

60
Q

Message Passing

Implementation issues

A
  1. How are links established?
  2. Can a link be associated with more than two processes?
  3. How many links can there be between every pair of communicating processes?
  4. What is the capacity of a link?
  5. Is the size of a message that the link can accommodate fixed or variable?
  6. Is a link unidirectional or bi-directional?