CSE 2431 Midterm Review

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/181

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

182 Terms

1
New cards
What Operating Systems Do
Controls and coordinates use of hardware among various applications and users.
2
New cards
User view
In this view the OS is made for ease of use
3
New cards
System view
 In this view the OS is a resource allocator
4
New cards
Operating Systems views
user and system
5
New cards
OS definition
no real adequate definition, no universally accepted definition 

\n  Loosely – “everything a vendor ships when you order the ‘operating system’” 
6
New cards
kernel
OS is the one programming running all the time
7
New cards
Computers are
organized into one or more CPUs and device controllers connected through a common bus that provides access between components and shared memory.
8
New cards
Interrupt
hardware mechanism that enables a device to notify the CPU that it needs attention 
9
New cards
Interrupt timeline
I/O changes after I/O request and at transfer done

\
CPU changes at interrupt signaled and interrupt handled
10
New cards
Storage
RAM (Random Access Memory \[volatile typically\]), HDD (Hard Disk Drive), NVM (Non-volatile Memory \[faster than HDD\]), tertiary storage (optical storage, magnetic tape)
11
New cards
Von Neumann architecture
structure of computer where process instructions and data are stored in the same main memory 
12
New cards
 I/O Structure
CPU/memory/device (including DMA) 
13
New cards
System call
request to the OS to allow user to wait for I/O completion
14
New cards
Device-status table
contains entry for each I/O device indicating its type, address, and state
15
New cards
Single processor
There is one main CPU capable of executing a general purpose instruction set.
16
New cards
Multiprogramming and multitasking
o Multiprogram - increases CPU utilization by organizing jobs so that the CPU always has one to execute.

\
o  Multitasking - CPU executes multiple jobs by switching between them but the users can interact with each program while it is running. 
17
New cards
Dual mode and multi-mode 
o Dual - Allows OS to protect itself and other system components

\
o Multi - A system that can support systems/service that operate within the physical data center and virtual/cloud/software-defined environment. 
18
New cards
 Process vs program (active vs passive)
o Process - Active entity (A program in execution)

o Program - Passive entity (does nothing unless instructions are executed by CPU)
19
New cards
 Protection
any mechanism for controlling the access of processes or users to the resources defined by a computer system. 
20
New cards
 Security
 defend a system from external and internal attacks.
21
New cards
Virtualization, emulation, guest operating systems
Makes it possible to run many OS on top of one core system.
22
New cards
Peer-to-peer and cloud computing
o Peer to Peer - Client and server is not distinguished from one another (all nodes are considered peers and can act as client or server)

\
o Cloud - Delivers computing, storage, even apps as a service across a network. 
23
New cards
Operating System Services
o Layered approach - A modular approach in which an operating system is broken into a number of layers (levels). The bottom layer (layer 0) is the hardware; the highest (layer N) is the user interface.
24
New cards
 System calls and APIs
System call provide an interface to the services made available by an operating system.
25
New cards
System calls and API examples
Process control, device management, file management, info maintenance, communication, protection
26
New cards
Process Control
The operating systems mechanism for directing the control flow of different processes. 
27
New cards
Device management
The operating systems mechanism for managing user’s access to different devices within a computer, whether they’re hardware or abstract (files).
28
New cards
File management
The operating systems mechanism for creating, deleting, opening, closing, reading from, and writing to files
29
New cards
Information maintenance
The operating systems mechanism for transferring information (i.e. date, debug info) between the user program and the operating system.
30
New cards
Communication
The way in which different processes communicate
31
New cards
Two ways to communicate
Message passing model and shared memory model
32
New cards
Message-Passing Model
* communicating processes exchange messages with one another to transfer information
33
New cards
Shared-Memory Model
processes use shared memory create and shared memory attach system calls to create and gain access to regions of memory owned by other processes
34
New cards
Protection
Provides a mechanism for controlling access to the resources provided by a computer system
35
New cards
System Services/System Utilities
Provide a convenient environment for program development and execution.
36
New cards
System services/system utility examples
file management, status info, file modification, program-language support, program load and execution, and communications
37
New cards
File management
Programs that manage files (create, destroy, etc.)
38
New cards
Status information
 Programs that ask the system for different kinds of info
39
New cards
File modification
Programs, such as text editors, that allow you to edit file contents
40
New cards
Programming-language support
Compilers, assemblers, debuggers, interpreters
41
New cards
Communications
Programs that provide interprocess and system communications
42
New cards
Relocatable object file
*  source code compiled into object files designed to be loaded into any physical memory location
43
New cards
Linker
Combines relocatable object files into a single binary executable file.
44
New cards
Loader
* Brings executable files into memory to be executed.
45
New cards
Relocation
* Assigns final addresses to program parts and adjusts code and data in program to match those addresses.
46
New cards
OS design goals
User vs System Goals AND Policy vs mechanisms
47
New cards
User goals
Operating system should be convenient to use, easy to learn, reliable, safe, and fast
48
New cards
Systems goals
Operating system should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient
49
New cards
Policy
*what* will be done
50
New cards
mechanisms
determines *how* to do it.
51
New cards
OS structures
Monolithic, Layered, Microkernels, modules, hybrid, mobile
52
New cards
Monolithic
The kernel takes a massive amount of functionality as its responsibility
53
New cards
Layered
Operating system is divided into layers, each built on top of the lower layers. Lower layers service the upper layers.
54
New cards
Microkernels
Removed all non-essential components from the kernel and implements them as system and user-level programs.
55
New cards
Modules
The best modern implementation for operating systems. The kernel has a set of core components and links in additional services via loadable modules.
56
New cards
Hybrid
Most modern operating systems are not usually 1 pure model. Combines multiple of the aforementioned approaches to address performance, security, and usability.
57
New cards
Mobile
Android and iOS
58
New cards
Android
*  Structured on modified Linux kernel.
59
New cards
iOS
* structured on Mac OS X with added functionality.
60
New cards
Booting an OS
* When power initialized on system, execution starts at fixed memory location
* OS must be made available to hardware so hardware can start it
* Bootstrap loader, BIOS, stored in ROM locates kernel, loads it into memory, and starts it
* Modern systems replace BIOS with Unified Extensible Firmware Interface (UEFI)
* Common bootstrap loader, GRUB, allows selection of kernel from multiple disks and versions.
* When kernel loads, system is running
61
New cards
Debugging
Finding and fixing errors or bugs
62
New cards
Failures and performance issues 
* OS generates log files containing error info
* Application failure can generate core dump file capturing memory of failed process
* OS failure can generate crash dump file containing kernel memory
* Performance tuning optimizes system performance
* Tracing - Collects data for a specific event, such as steps involved in a system call invocation
63
New cards
 Concept of what a Process is
Programs being executed
64
New cards
 Components within a process
* Text section, program counter, stack, data section, and heap
65
New cards
Process states 
* New - Process being created
* Running - Instructions are being executed
* Waiting - The process is waiting for an event to occur
* Ready - Process is waiting to be assigned to processor
* Terminated - Process has finished execution
66
New cards
Process control block 
Components are Process State, Program Counter, CPU register, CPU scheduling info, memory management info, accounting info, and I/O status info.
67
New cards
Threads
Multiple threads of control → threads
68
New cards
Process Scheduling
selects among available processes for next execution on CPU core

\n
69
New cards
Queues
Ready, Wait, Job
70
New cards
Ready Queue
* set of all processes residing in main memory, ready and waiting to execute
71
New cards
Wait Queue
 set of processes waiting for an event
72
New cards
Job Queue
consists of all processes in a system
73
New cards
Context switching
When the CPU switches from one process to another, the system must save the state of the old process and load the saved state for the new process via a context switch.
74
New cards
Context switch
 when CPU switches from one process to another
75
New cards
Operations on processes
create (fork, exec) and termination
76
New cards
Create (fork, exec) 
* fork() creates new process
* exec() used after fork() to replace the process’ memory space with a new program. 
* Parent process calls wait() for the child to terminate
77
New cards
termination
* Process executes the last statement and then asks the operating system to delete it using exit(). 
* Parents may terminate the execution of children processes using abort().
78
New cards
 Independent processes 
* It can’t affect or be affected by other processes executing in the system.
79
New cards
cooperating processes
* It can affect or be affected by other processes executing in the system. 
80
New cards
Shared memory
* region of memory that is shared by cooperating processes.
81
New cards
Non-Shared memory
communication takes place by means of messages exchanged between the cooperating processes.
82
New cards
IPC synchronization
Communication between processes takes place through calls to send() and receive() primitives.
83
New cards
Shared memory (i.e., POSIX shm_open, mmap, ftruncate)
an area of memory shared among the processes that wish to communicate. Communication controlled by user processes.
84
New cards
Message passing
mechanism for processes to communicate and synchronize their actions. Can be blocking or non-blocking. 

\n
85
New cards
Blocking
considered synchronous
86
New cards
Non Blocking
considered asynchronous
87
New cards
Blocking send
*  sender is blocked until message is received
88
New cards
Blocking receive
receiver is blocked until message is available
89
New cards
Nonblocking send
* sender sends message and continue
90
New cards
Non Blocking receive
* receiver receives null or valid message
91
New cards
Pipes
Acts a conduit allowing two processes to communicate
92
New cards
Named Pipes
 can be accessed without a parent-child relationship
93
New cards
Ordinary Pipes
* can’t be accessed from outside the process that created it. 
94
New cards
Sockets
An endpoint for communication (concatenation of IP address \[host\] and port)

\n Ex: 161.25.19.8:1625
95
New cards
 Remote Procedure Calls (RPC)
abstracts procedure calls between processes on networked systems. 

\n
96
New cards
What is a thread and why we have it
A thread is a basic unit of CPU utilization. Allows for a process to create multiple threads to handle different tasks, rather than making more processes and incurring overhead.

\n
97
New cards
Benefits of Thread
Responsiveness, resource sharing, economy, scalability
98
New cards
Responsiveness
* May allow continued execution if part of process is blocked, especially important for user interfaces
99
New cards
resource sharing
Threads share resources of processes they belong to, easier than shared memory or message passing between processes.
100
New cards
economy
Cheaper than process creation, thread switching lower overhead than context switching