Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

CSCI3040-Operating Systems

HW 1
Fall 2021
Due 9/28/2021

Q1. What is the difference, if any, between the following terms? Briefly answer.

a. Reliability vs. availability?

The term "reliability" refers to the length of time a machine performs its intended function, whereas
"availability" refers to the percentage of time a machine is operational.

b. Throughput vs. response time?

The quantity of messages a system can handle in a given length of time is referred to as throughput. The
overall length of time it takes to reply to a service request is known as response time.

c. Batch vs. interactive operating system?

A batch operating system manages a list of jobs in a queue. It repeats the loading, running, and
unloading of the next job in the queue. The operating system on multiuser systems employs a method
known as direct memory access to allow multiple users to queue jobs so that the CPU may execute one
work while another is loaded and unloaded. In contrast to batch systems, interactive operating systems
allow for continuous user interaction.

d. Host vs. guest operating system?

A single computer running a host operating system can virtualize numerous guest operating systems in
virtual environments. The guest operating system is software installed on and running on the virtual
machine, as opposed to the host operating system, which is software loaded on a computer to interact
with the hardware.

Q2. How should an operating system support communication between applications? Explain your
reasoning.

a. Through the file system?


b. Through messages passed between applications?
c. Through regions of memory shared between the applications?
d. All of the above?

The operating system should allow programs to communicate with one another via the file system,
messages exchanged between apps, and shared memory areas. Files are widely interoperable with a
wide range of programs. Take the text file for example. There are at least ten apps on my PC that can
open and modify a text file! Users have grown to expect to be able to utilize their preferred program,
therefore the operating system must accommodate them! Furthermore, the operating system should
have a message bus that allows programs to interact without relying on files stored on disk. Disk I/O is
one of the slowest operations on a computer, thus requiring an app to write data to disk for another
program is wasteful. Using the message bus also allows apps to subscribe to the things that matter to
them while ignoring the ones that don't. Finally, for things like the paste buffer, the operating system
should provide a shared memory space. Text transferred to it in one program can be pasted into another
n times until a fresh copy is made. The message bus fails because data is lost after it is replicated for the
first time.
CSCI3040-Operating Systems
HW 1
Fall 2021
Due 9/28/2021

Q3. What are the steps of the Boot Up process? Why we should not have the entire Operating System
on Read Only Memory (Like ROM BIOS)?

The CPU starts up and loads instructions from the BIOS, which is stored in the ROM, into RAM. The BIOS
turns on the display and keyboard, as well as performs some basic tests to ensure that the computer is
up and running. It will, for example, check for RAM. The BIOS then initiates the boot process. Read-Only
Memory (ROM) is a storage technique used in computers and other electronic devices to permanently
store data on a chip. The most fundamental code required to start a computer is stored in ROM, which is
also known as the Basic Input/Output System.

Q4. Why is a system call more expensive than a procedure call?

The cost of a system call is projected to be substantially higher than the cost of a procedure call
(provided that both perform very little actual computation). A system call comprises the following
activities that are not performed with a basic procedure call, resulting in a significant overhead.

Q5. Suppose you have to implement an operating system on hardware that supports exceptions and
traps but does not have interrupts. Can you devise a satisfactory substitute for interrupts? If so, explain
how. If not, explain why.

Using exceptions or traps to replace interruptions would be impossible in this case. Exceptions and traps
are synchronous, but interruptions are fundamentally asynchronous; exceptions and traps occur as a
result of the process doing something, whereas interrupts are unpredictably occurring external events. In
the case of the timer interrupt, we wouldn't be able to use exceptions or traps to interrupt a process that
had total control over the CPU.

Q6. When a user process is interrupted or causes a processor exception, the x86 hardware switches the
stack pointer to a kernel stack, before saving the current process state. Explain why. [Hints. Section 2.5 –
Figure 2.10 & 2.11 from the Textbook]

This is because, for two reasons, we should save the current task state on a (separate)kernel-level stack
rather than a user-level stack:

Reliability. Although the user-level stack pointer for the process may not be a valid memory location (for
example, if the program has a bug or the current stack is allocated on the user program's heap), the
kernel handler must continue to function properly and maintain the integrity of the user's data.

Security. Other operating threads on a multiprocessor may alter user memory during the system call. If
the kernel handler saves the user task state on the user-level stack, the user application may change the
kernel's return address, leading the kernel to execute arbitrary code.

You might also like