Midterm Flashcards
Draw Von Neumann’s architecture of a computer.
What are the five main categories of modern computer systems?
Personal Mobile Device (PMD)
Desktop Computing
Servers
Clusters / Warehouse Scale Computers
Embedded Computers
What is the primary task of an “operating system?”
Answer1: A program that
acts as an intermediary between a user of a computer and the computer
hardware. Or Answer2: OS is a resource allocator, which manages all resources,
decides between conflicting requests for efficient and fair resource use, and
controls programs within allocated space.
What are the two main characteristics of an OS?
Efficiency and
convenience. Efficiency means that the OS can manage multiple processes and
allocate memory to these processes fairly and efficiently. For example, if one
process is trying to hug a large number of frames, the other processes should not
be denied active frames. If a process is not using its frame or CPU assets, that
process should be deactivated. In servers, efficiency is of main importance.
Convenience is a factor that a system user expects from the OS. Allowing a user
to access programs and applications easily is an example. In mobile devices,
convenience is a major factor.
Explain the role of the OS as the 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. A program typically alternates between phases of input, computation, and
output. Consequently, the CPU is underutilized during the I/O phases, while the I/O
devices are idle during the compute phase. The overall performance of all applications
can be improved by using concurrency. The OS tries to keep the CPU, main memory,
and all storage and I/O devices busy at all times by overlapping independent
operations whenever possible.
What is “multiprogramming?
Multiprogramming is a technique that keeps several
programs active in the main memory and switches execution among the different programs
to maximize the use of the CPU and other resources. Whenever a program enters an I/Obound phase where little CPU time is needed, other programs can resume and utilize the CPU
in the meantime. Similarly, whenever a device completes an operation, the OS activates
computations that can utilize the now available device.
What is time-sharing?
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. Time-sharing employs the concept of
virtualization by creating the illusion of having a separate virtual CPU for each computation
Situation 1 is a sequential system. First, program A is executed, and then program B.
Situation 2 is a multiprogramming case. Finally, situation 3 is time-sharing, where the
switching between programs A and B is done very quickly, and we are showing them as
running in parallel.
Multiprogramming generally improves CPU utilization and throughput. (True or False?)
True: Multiprogramming overlaps phases of computation and I/O from different
computations to better utilize the CPU and other resources, which improves overall
performance
The main objective of time-sharing is to improve resource utilization. (True or False?)
False: Resource utilization is improved by multiprogramming, which overlaps CPUbound and I/O-bound computations. On the other hand, Time-sharing only switches the
CPU among different computations to create the illusion of simultaneous execution, which
generally does not improve resource utilization beyond simple multiprogramming
Multiprogramming and time-sharing are not used together. (True or False?)
To achieve the best CPU utilization, _____ computations should run
simultaneously.
a) 2 b) more than 2 c) all available processes
B
Using more than two computations increases CPU utilization
but, at the same time, uses more memory and other resources. A careful
balance must be found to minimize overhead while still increasing overall
performance.
The use of time-sharing will _____.
a) speed up all computations
b) guarantee a reasonable response to each computation.
c) improve resource utilization
B
No computation can monopolize the CPU indefinitely
What is the OS kernel?
The kernel of an OS is the minimal set of
functions necessary to manage the system resources safely and efficiently. The
kernel typically provides essential services for memory and device management,
creating and managing computations, and communication among the different
concurrent activities within the system.
What are privileged instructions?
The instruction set provided
by the CPU is divided into two sets of privileged and non-privileged to deal with
security issues. A 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.
What are the two modes that the CPU operates?
The CPU
operates in two different modes, indicated by a particular mode bit, to guarantee
that no programs outside the trusted kernel can use privileged instructions. Kernel
mode is the CPU state where both privileged and non-privileged instructions may
be used. User mode is 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.
What do interrupts and traps have in common? What are the differences between the two concepts?
Traps and interrupts both suspend the execution of the current
instruction sequence and temporarily divert control to a dedicated area within the OS kernel.
An external event causes an interrupt. Ex: The completion of an I/O operation or a timeout
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 particular case
of an interrupt caused by an event internal to the current execution. Ex: The execution of a
privileged instruction or an arithmetic overflow. Traps are synchronous to the current
execution in that the currently executing instruction causes the interruption. The interruption
can be unintentional, as in the case of an error, or intentional, as in the case of a supervisor call.
What is a process, and what is a process’s PCB?
A process is an instance of a program
being executed by an OS. For example, when a user opens a new application like a web browser
or text editor, the OS creates a new process. The OS itself is organized as a collection of
processes. The OS keeps track of each process using a process control block (PCB). PCB is 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
What is the content of the PCB of a process?
PCB contains a list of registers
of the process, program counter, memory management information, process id,
process state, and a list of files that are opened by the process.
A newly created process starts in the ready state. When the OS selects
the process for execution, it goes to the running state. When the OS interrupts
the process, for example, to let some other processes use the CPU, its state
changes to ready. When a process requests a currently unavailable resource,
such as a file already opened by another user or some input data, the process’s
state changes to “blocked.” When some other process releases the resource or
generates the data needed by the blocked process, the OS moves the blocked
process to ready.
The networks are categorized into four groups for networked distributed
computing in terms of the distance between members. What are these four types
of networks
LAN, WAN, MAN, PAN
In terms of the role of connected network members, computing environments are divided into two types. What are these two types of networks?
1) client-server, 2) peer-to-peer.
What is the difference between “emulation” and “virtualization?”
A. Emulation is used when the source CPU type (physically present) differs
from the target CPU type (the CPU for which a program is compiled for). For
example, Apple desktops switched from IBM CPU to Intel CPU, and old
software used Rosetta to run on emulated IBM CPU.
B. Virtualization allows a guest OS to run as an application on a host OS.
What is the difference between “full virtualization” and “paravirtualization?
In full virtualization, the guest is an original OS and wants to manage the memory,
perform protection, etc. In para-virtualization, guest OS is designed to run as a
guest in a virtual environment, is aware of other operating systems, and knows its
limitations. Para-virtualization requires the guest operating system to be modified
to use the hypervisor’s APIs, making it more efficient than full virtualization in
terms of CPU utilization and memory access. Para-virtualization is best suited for
situations where a high level of performance is required, such as in highperformance computing or data-intensive workloads.