Assignment 1

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

Assignment: 1

Operating System

Write your answers in this document after each questions and don’t forget to
turn in after completing. Answers copied from fellow students will not be
graded. Deadline matters.

1. Explain why all modern systems have a cache memory in addition to main
memory.

Ans: All modern system have cache memory in addition to main memory because
as it is cheap chip-based computer component that makes retrieving data from
the computer's memory more efficient. It acts as a temporary storage area that
the computer's processor can retrieve data from easily.
This temporary storage area, known as a cache, is more readily available to the
processor than the computer's main memory source, typically some form of
Cache memory is sometimes called CPU (central processing unit) memory
because it is typically integrated directly into the CPU chip or placed on a
separate chip that has a separate bus interconnect with the CPU. Therefore, it is
more accessible to the processor, and able to increase efficiency, because it's
physically close to the processor. In order to be close to the processor, cache
memory needs to be much smaller than main memory. Consequently, it has less
storage space.
It is also more expensive than main memory,as it is a more complex chip that
yields higher performance.

2. What are two main functions of OS? Explain.


Ans: The two main functions of operating system are
* OS as an Extended Machine
* OS as a Resource Manager

* OS as an Extended Machine
generally, computer users sit in front of computer consisting of monitor,
keyboard, mouse and system unit & use parts of computer system. E.g, I/O
device, system unit, memory etc. The computer system is design so that use of
resource to maximize the user is performing. In this case the operating system is
designed mostly for easy with same attention paid for performance, the
performance is important to the user but it does not matter it most of the system
is sitting idle, waiting for the slow i/o speed of the user. The operating system is
design to maximize resource utilization. The program that hides the truth about
the hardware from the programmer and present and a nice simple view a named
file that can be read & written as “operating system”. Operating system shields
the programmer from the interface, the abstraction offers by the operating
system is slower & easier to use than the underlying hardware. The main function
of operating system is to present the user with the equivalent of an extended
machine or virtual machine that is easier to program than underlying hardware.

* OS as a Resource Manager

Operating system is collection of software which is close to hardware. We can


view operating system as a resource – hardware and software collector. A system
has many hardware and software that may be required to solve the problem,
CPU time, memory space, file storage space, i/o device etc. the operating system
acts as manager of these resources.
Modern computer consists of process, memories, times, disks, network, printer
and wide varieties of other devices. The tab of the operating system is to provide
for an orderly and controlled allocation of the process, memories and I/O devices
among the various programs completing for them.
An operating system is a control program, a control program manages the
execution of user program to prevent errors and improve use of computer. It is
especially concerned with the operation and control of I/O devices. When a
computer has multiple users the operating system manages and protects the
memory I/O devices. The operating system keeps in trace that who is using which
resource to grant resource required amount for usage and to mediate conflicting
required different programs and users.

3. What are the three main purposes of an operating system? Explain.


Ans:An operating system has three main purposes:
1) To provide an environment for a computer user to execute programs on
computer hardware in convenient and efficient manner.
2) To allocate the separate resources of the computer as needed to solve the
problem given. The allocation process should be as fair and efficient as possible.
3) As a control program it serves two major functions:
* Supervision of the execution of user programs to prevent errors and improper
use of the computer.
* Management of the operation and control of I/O devices.
4. Explain the term “Multiprogramming ”. What is the main advantage of
multiprogramming ? Explain why a system which is not multiprogrammed does
not need secure multiplexing of resources. Suggest what functions an operating
system might still be used for on such a system.
Ans:Sharing the processor, when two or more programs reside in memory at the
same time,Is referred as multiprogramming. Multiprogramming assumes a single
shared processor. Multiprogramming increases CPUalways has one to execute.
The main advantages of multiprogramming is:
* High and efficient CPU utilization.
* User feels that many programs are alloted CPU almost simultaneously.

5. In a multiprogramming and time-sharing environment, several users share the


system simultaneously. This situation can result in various security problems.
a. What are two such problems?
Ans:Any two problems are:
1) One User can red the private data of another user.
2) One user Can copy the private data of another user
3) One user can prevent another user from getting anything done.

b. Can we ensure the same degree of security in a time-shared machine as


we have in a dedicated machine? Explain your answer.
Ans: It can be taken in two ways:
As yes:- if we can ensure that the operating system prevents any sharing of
data between users, either for reading or writing, and fairly shares the
computer, them we can achieve the same level of security.
As No:- We can never be sure that our software do not have bugs, so we
can never be sure that we prevent all sharing of data and fairly allocate
computer resources.
6. What is spooling? Do you think that advance personal computers will have
spooling as a standard feature in the future?
7. Which of the following instructions should be allowed only in kernel mode?
Explain.
a. Disable all interrupts
b. Read the time-of-day clock
c. Set the time-of-day clock
d. Change the memory map
8. List some differences between personal computer operating system and
mainframe operating system.
9. What is the key difference between a trap and an interrupt?
10. Define:
a. Interrupt Vector
b. Context Switch

You might also like