Operating Systems test 1 (ch1-2.6)

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

1/113

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

114 Terms

1
New cards
\
operating system (OS)
the software that runs on the bare hardware of a computer and provides essential support for users to develop and use applications in the most efficient and safe manner
2
New cards
CPU
Machine instructions perform \n operations on contents of \n registers and memory locations
3
New cards
Main \n memory
Physical memory is a linear \n sequence of addressable bytes \n or words that hold programs \n and data
4
New cards
Secondary storage
Disk and other secondary \n storage devices are multi- \n dimensional structures,
5
New cards
The hardware/user gap is bridged by the OS or by other system software. Does this require OS support: Input a character from the keyboard?
Definitely
6
New cards
The hardware/user gap is bridged by the OS or by other system software. Does this require OS support: Invoking a high level matrix manipulation
Not Necessarily
7
New cards
The hardware/user gap is bridged by the OS or by other system software. Does this require OS support: Allocate n bytes of memory for a new data structure
Most likely
8
New cards
The hardware/user gap is bridged by the OS or by other system software. Does this require OS support: Load a program into memory
Definitely
9
New cards
The hardware/user gap is bridged by the OS or by other system software. Does this require OS support: Change the layout of a document
Not Necessarily
10
New cards
The hardware/user gap is bridged by the OS or by other system software. Does this require OS support: Call a shared library function
Most likely
11
New cards
The hardware/user gap is bridged by the OS or by other system software. Does this require OS support: Call a function defined in the current pogram
Not Necessarily
12
New cards
The hardware/user gap is bridged by the OS or by other system software. Does this require OS support: Exit current program
Definitely
13
New cards
Abstraction
the act of removing unimportant details or attributes of objects in order to construct more general and less complex objects
14
New cards
Virtualization
is the act of creating the illusion of having one or more objects with more desirable characteristics than the real object.
15
New cards
### The OS as a resource manager
One of the main tasks of an OS is to optimize the use of all computational resources to ensure good overall performance, while satisfying the requirements of specific applications, including guaranteeing acceptable response times for interactive processes, meeting deadlines of time-critical tasks, and allowing safe communication among different tasks.
16
New cards
***Multiprogramming*** 
 a technique that keeps several programs active in memory and switches execution among the different programs to maximize the use of the CPU and other resources
17
New cards
***Time-sharing*** (***multitasking)***
is an extension of multiprogramming where the CPU is switched periodically among all active computations to guarantee acceptable response times to each user.
18
New cards
Multiprogramming generally improves CPU utilization and throughput.
True
19
New cards
The main objective of time-sharing is to improve resource utilization.
False
20
New cards
Multiprogramming and time-sharing are not used together.
False
21
New cards
To achieve best CPU utilization, _____ computations should run simultaneously.
More than 2
22
New cards
The use of time-sharing will 
Guarantee reasonable response to each computation
23
New cards
Processes p1 and p2 share a single CPU and 2 independent I/O devices. Each process executes a compute-bound phase of 10 time units followed by an I/O-bound phase of 10 units. W/O multiprg
40
24
New cards
Processes p1 and p2 share a single CPU and 2 independent I/O devices. Each process executes a compute-bound phase of 10 time units followed by an I/O-bound phase of 10 units. WITH multiprg
30
25
New cards
Abstraction can be used without virtualization.
Yes, abstraction can be used without virtualization. Abstraction creates objects that are more general and less complex. Those objects do not necessarily need to be virtual objects.
26
New cards
Virtualization can be used without abstraction.
Virtualization can be used without abstraction. Yes, virtualization can be used without abstraction. Virtualization creates the illusion of a new object.
27
New cards
Abstraction and virtualization can be used together.
Yes, abstraction and virtualization can be used together. Virtualization can be used to create the illusion of a new object. Abstraction can then be used to further improve the new object by making it more general and easier to use.
28
New cards
What do multiprogramming and time-sharing have in common? What are differences between the two concepts?
Multiprogramming allows multiple programs to be active in memory simultaneously. While \n one is waiting for I/O completion or some other event, another can run on the CPU. The main objective is to increase CPU and device utilization

\
Time sharing goes beyond multiprogramming by guaranteeing that each computation gets a

\n turn at the CPU in a timely manner, not only when other computations block to wait for a \n resource
29
New cards
kernel
 the minimal set of functions necessary to manage the system resources safely and efficiently. 
30
New cards
privileged instruction
performs critical operations that access I/O devices and the CPU's status and control registers. Thus only the OS kernel is allowed to execute privileged instructions.
31
New cards
Kernel Mode
  the CPU state where both privileged and non-privileged instructions may be used.
32
New cards
User mode
the CPU state where only non-privileged instructions may be used. Any attempt to execute a privileged instruction in user mode automatically transfers control to the kernel.
33
New cards
The OS kernel is the lowest level of software and provides the basic functionalities necessary for efficiently and safely executing programs
True
34
New cards
The kernel is extended by library functions, which invoke kernel functions to offer more convenient service functions to higher-level software.

\
\
True
35
New cards
Applications and system software may invoke kernel functions directly or use the more convenient higher-level abstractions provided by library functions.

\
True
36
New cards

Kernel functions may be invoked by

any program

37
New cards
Privileged instructions may be executed by
only the kernel
38
New cards
An application that needs to access an I/O device could not be written without
Kernel functions
39
New cards
The kernel can execute _____ instructions
Both non privileged and privileged
40
New cards
***graphical user interface*** (***GUI)***
 presets various icons on the screen, which the user can click on in different ways to invoke services associated with the icons, or to reveal pull-down menus for additional tasks.
41
New cards
OS shell 
 a command interpreter that accepts and interprets textual commands issued by the user via a keyboard.
42
New cards
shell script
a program that implements a new operation by combining multiple commands and control statement into one named unit interpreted by the shell.
43
New cards
A script can use an iteration variable, i. The value $i of i can be used to create a different name in each iteration. The script below creates 10 directories named D0, D1, ..., D9, where MKDIR is the command to make a directory.

To create the same directories using a GUI, the user must perform some number of right and left-clicks, type some number of characters, and press Enter several times.
10
44
New cards
A script can use an iteration variable, i. The value $i of i can be used to create a different name in each iteration. The script below creates 10 directories named D0, D1, ..., D9, where MKDIR is the command to make a directory.

\
The required number of right-clicks is
10
45
New cards
A script can use an iteration variable, i. The value $i of i can be used to create a different name in each iteration. The script below creates 10 directories named D0, D1, ..., D9, where MKDIR is the command to make a directory.

\
The number of characters typed is
20
46
New cards
A script can use an iteration variable, i. The value $i of i can be used to create a different name in each iteration. The script below creates 10 directories named D0, D1, ..., D9, where MKDIR is the command to make a directory.

\
The number of times Enter is pressed is
10
47
New cards
 ***system call*** 
a request from an application for an OS service. A system call is implemented as a library function, which sets up the necessary parameters for the requested operation and issues a corresponding supervisor call.
48
New cards
 ***supervisor call*** (***kernel call***)
 a privileged instruction that automatically transfers execution control to a well-defined location within the OS kernel. Thus supervisor calls provide the interface between the OS kernel and the higher-level software.
49
New cards
A supervisor call is similar to a function call with two special features:


1. The call switches execution from user mode to kernel mode by setting the mode bit in the CPU.
2. To prevent a call from branching to arbitrary locations within the kernel, the function to be invoked is not specified by an address but indirectly using an index into a branch vector. Thus kernel-mode execution is limited to only well-defined entry points within the kernel.
True
50
New cards
A system call is a
Library function
51
New cards
A supervisor call is a
Privileged instruction
52
New cards
A supervisor call can be executed 
by any program
53
New cards
Changing the mode bit of the CPU _____ can only be done by a privileged instruction.
from user mode to kernel mode
54
New cards
interrupt
an event that diverts the current execution of a program to a predefined location in the kernel in order to respond to an event. An interrupt is triggered by a hardware signal sent to the CPU from an external device.
55
New cards
trap
an interrupt triggered by the currently executing instruction. Dividing by zero, executing an invalid opcode, or causing an arithmetic overflow are all errors, which result in a trap and cause the OS to abort the current program execution.
56
New cards
***interrupt handler*** 
a kernel function, invoked whenever an interrupt occurs, that determines the cause of the interrupt and invokes the appropriate kernel function to provide the response
57
New cards
An application is requesting a service from the OS, which consists of several steps. The current step is: Setup parameters for the service in user mode. What is the next step?
Execute supervisor_call in user mode.
58
New cards
An application is requesting an I/O operation from the OS, which consists of several steps. The current step is: Setup parameters for the service in user mode. What are the next two steps?
Execute supervisor_call in user mode.

Execute kernel function in kernel mode.
59
New cards
What do interrupts and traps have in common?
Traps and interrupts both suspend the execution of the current instruction sequence and temporarily divert control to a dedicated area within the OS kernel
60
New cards
What are the differences between the two concepts?
An interrupt is caused by an event external to the current execution. Ex: The completion of an I/O operation or a time-out signal from a clock. Interrupts are asynchronous to the current execution in that the interruption may occur unpredictably between any two instructions.

\
A trap is a special case of an interrupt caused by an event internal to the current execution. \n Ex: The execution of a privileged instruction or an arithmetic overow. \n Traps are synchronous to the current execution, in that the interruption is caused by the \n currently executing instruction. The interruption can be unintentional, as in the case of an \n error, or intentional, as in the case of a supervisor call.
61
New cards
Is multiprogramming possible without interrupts
Multiprogramming does not require interrupts. A context switch happens whenever a computation terminates or blocks to wait for I/O.
62
New cards
Is time-sharing possible without interrupts?
\n Time sharing requires a periodic interrupt to prevent long-running computations from monopolizing the CPU and thus delaying other computations for unpredictable amounts of \n time
63
New cards
Enabling hardware technology: vacuum tubes
OS type: none
64
New cards
Enabling hardware technology: Transistors replaced \n vacuum tubes as smaller and faster switches
OS type: Batch os
65
New cards
Enabling hardware technology: Integrated circuits allowed the development of microchips to replace \n individual transistors
OS type: Interactive multi user OS
66
New cards
Enabling hardware technology: Very large-scale integration (VLSI) allowed the placement of a \n complete microprocessor on a single chip, leading to \n the development ofpersonal computers(PCs)
OS Type: Desktop and Laptop OS
67
New cards
Enabling hardware technology: Networking hardware \n enabled the harnessing of the power of multiple computers
OS Type: for supercomputers, distributed systems, and \n mobile devices
68
New cards
The invention of transistors marks the transition to the _____ generation of computer systems.
2nd
69
New cards
The invention of integrated circuits marks the transition to the _____ generation of computer systems.
3rd
70
New cards
The invention of microprocessors marks the transition to the _____ generation of computer systems.
4th
71
New cards
Mainframes are considered 
General purpose computers
72
New cards
An advanced aircraft is likely to have a _____ on board to help control the aircraft
real time computer
73
New cards
What multiprocessors and multi-computers (distributed systems) have in common is
The ability to carry out operations in parallel
74
New cards
***process*** 
an instance of a program being executed by an OS. Ex: When a user opens a new application like a web browser or text editor, the OS creates a new process.
75
New cards
***process control block*** (***PCB***)
A data structure that holds information for a process, including the current instruction address, the execution stack, the set of resources used by the process, and the program being executed. 
76
New cards
An OS uses a PCB to represent a process
True
77
New cards
The PCB is created by the process when execution starts
False
78
New cards
The PCB becomes part of the program being executed by a process.
False
79
New cards
Two processes can be executing the same program.
True
80
New cards
The transition (ready -> running) of a process p is caused by
The transition (ready -> running) of a process p is caused by
the OS
81
New cards
The transition (running -> blocked) of a process p is caused by
The transition (running -> blocked) of a process p is caused by
The process P itself
82
New cards
The transition (running -> ready) of a process p is caused by 
The OS
83
New cards
The transition (blocked -> ready) of a process p is caused by
The transition (blocked -> ready) of a process p is caused by
some other process
84
New cards
A newly created process is placed into
new state
85
New cards
A process is placed into the ***terminated state***
when execution can no longer continue but before the PCB is deleted. Ex: The OS may want to examine the final state of a process that committed a fatal error.
86
New cards
A process may be placed into the ***suspended state***
even though the CPU and all resources are available. Ex: The OS may want to stop a process to allow debugging or to regulate performance.
87
New cards
When a newly created process p is ready to compete for the CPU, p moves itself from the new to the ready state.
When a newly created process p is ready to compete for the CPU, p moves itself from the new to the ready state.
False
88
New cards
When a ready process p wishes to temporarily stop competing for the CPU, p moves itself to the suspended state.
When a ready process p wishes to temporarily stop competing for the CPU, p moves itself to the suspended state.
When a ready process p wishes to temporarily stop competing for the CPU, p moves itself to the suspended state.
89
New cards
The transition of a process p from running to terminated can be caused by p itself.
The transition of a process p from running to terminated can be caused by p itself.
True
90
New cards
\
When a blocked process p is suspended and the resource needed by p becomes available, p is moved to the ready state.
False
91
New cards
When a process p is moved from the current state (running, ready, or blocked) to the suspended state, then upon reactivation
When a process p is moved from the current state (running, ready, or blocked) to the suspended state, then upon reactivation
p is either moved to the read or the blocked state
92
New cards
***context switch*** 
 the transfer of control from one process to another and may be triggered by the OS for scheduling reasons or caused by the inability of the current process to continue.
93
New cards
CPU state
consists of all intermediate values held in any CPU registers and hardware flags at the time of the interruption.
94
New cards
A context switch for a currently running process p may be caused by process p itself
True
95
New cards
A context switch for a currently running process p may be caused by the OS
True
96
New cards
A context switch for a currently running process p may be caused by some other process q
False
97
New cards
The PCB contains an up-to-date copy of the CPU state of a process p _____ .

\
when p's state is ready or blocked
98
New cards
Is this valid or invalid? : new ➛ ready ➛ suspended ➛ blocked ➛ suspended.
Invalid
99
New cards
Is this valid? : suspended ➛ blocked ➛ suspended ➛ blocked ➛ ready ➛ running.
Valid
100
New cards
Is this valid? : running ➛ blocked ➛ ready ➛ blocked ➛ suspended.
invalid