Tutorial (Chapter 3)
Tutorial (Chapter 3)
1) The services and functions provided by an operating system can be divided into TWO main
categories. Briefly describe the TWO categories and discuss how they differ ?
a. Provide an environment for execution of programs and services to programs and users
i. User interface – to allow users to communicate with OS
ii. Program execution – to load, run and end programs
iii. IO operations – managing any IO device
iv. File system manipulations – read, write, create,……etc
v. Communications – handle process communication
vi. Error detection – to be aware of possible errors
b. Ensure the efficient operation of the system itself via resource sharing
i. Resource allocation- to provide resources to processes
ii. Accounting – to keep track of usage
iii. Protection & Security – to control access to resources & secure from outside
access
2) List 5 services provided by an operating system that are designed to make it more convenient
for users to use the computer system. In what case it would be impossible for user-level
programs to provide these services? Explain
a. Program Execution: The operating system loads the contents or sections of a file into
memory and begins its executions
i. User level programs cannot be trusted to properly allocate CPU time
ii. User level programs could also terminate other programs to eliminate
competition
1. For example if this is allowed, then MS Edge would always terminate
other browsers that user tries to execute
8) What is the main advantage of the layered approach in designing operating system?
a. The main advantage is the simplicity of construction and debugging
b. Each layer consists of data and functions
c. The functions in each layer can use the functions of only lower-level layers. For example,
they can not invoke the functions from the upper-level layers
d. This approach simplifies debugging and system verification
i. This first layer can be debugged without any concern for the rest of the system,
because it uses only the basic hardware to implement its functions
ii. Once the first layer is debugged, its correct functioning can be assumed while
the second layer is debugged and so on
iii. If an error is found during the debugging of a particular layer, the error must be
on that layer because the layer below it are already debugged
iv. Thus, the design and implementation of the system is simplified
10) What is the main advantage of the microkernel approach to the system design?
a. Adding a new service does not require modifying the kernel
b. It is more secure as more operations are done in user mode than in kernel mode
c. A simpler kernel design and functionality typically results in a more reliable OS
11) How do user programs and system services interact in microkernel architecture?
a. By using inter-process communication(IPC) mechanisms such as messaging
b. These messages are conveyed by the kernel
13) What is the main advantage for an operating system designer of using virtual machine
architecture? What is the main advantage for a user?
a. The system is easy to debug
i. Run in VM, no need to stop normal system operation
b. Security problems are easy to solve
i. Host system and VMs protected from one another
c. Virtual machines also provide a good platform for operating system research since many
different operating systems can run on one physical systems
14) What are the advantage and disadvantages of using the same system call interface for
manipulating both files and devices?
a. Advantage
i. Each device can be accessed as though it was a file in the file system
ii. It is relatively easier to add a new device driver by implementing the hardware
specific code to support this abstract file interface
iii. This benefits the development of
1. User program code, which can be written to access devices and files in
the same manner and
2. Device-driver code, which can be written to support a well defined API
b. Disadvantage
i. Might be difficult to capture the functionality of certain devices within the
context of the file access API, thereby resulting in either a loss of functionality or
a loss of performance
1. Could be overcome by the use of the actual operation that provides a
general purpose interface for processes to invoke operations on devices
15) - Protecting the operating system is crucial to ensuring that the computer system operates
correctly
- Provision of this protection is the reason behind dual-mode operation, memory protection,
and the timer
- To allow maximum flexibility, however, we would also like to place minimal constraints on the
user
- The following is a list of operations that are normally protected. What is the minimal set of
instructions that must be protected ?
a. Change to user mode
i. It is not a must to be protected
b. Change to monitor(kernel) mode
i. Cannot simply allow user to switch to monitor mode, could allow the user to do
anything
c. Read from monitor memory
i. Monitor memory may contain private data for a user which would be a security
concern
d. Write into monitor memory
i. Unsupervised writing to the monitor memory may cause the kernel to be in a
mess
e. Fetch an instruction from monitor memory
i. It is not a must to be protected
f. Turn on the timer interrupt
i. It is not a must to be protected
g. Turn off timer interrupt
i. A process could hog all the CPU cycles if it turns off the timer