Os Key - Ans
Os Key - Ans
(1B) What are system calls? Briefly explain types of system calls.
System calls provide an interface to the services made available by
an operating system. These calls are generally available as routines
written in C and C++.
System calls can be grouped roughly into six major categories:
process control, file manipulation, device manipulation, information
maintenance, communication.
1. Process control: *end, abort
load, execute
create process, terminate process
allocate and free memory
get process attributes, set process attributes
2. File management:
*create file, delete file
*open, close
*read, write, reposition
*get file attributes, set file attribute
3.Device management:
* request device, release device
*read, write, reposition
*get device attributes, set device attributes
*logically attach or detach devices
4.Information maintenance:
*get time or date, set time or date
*get system data, set system data
*get process, file, or device attributes
*set process, file, or device attributes
5. Communications:
*create, delete communication connection
Multiprogramming System:
sss*In a multiprogrammed system, the operating system simply
switches to, and executes, another job.
*Eventually, the first job finishes waiting and gets the CPU back.
Thus, the CPU is never idle.
*Multiprogrammed systems provide an environment in which the
various system resources (for example, CPU, memory, and peripheral
devices) are utilized effectively, but they do not provide for user
interaction with the computer system.
*Multiprogramming increases CPU utilization by organizing jobs, so
that the CPU always has one to execute.
Multitasking System:
*Time sharing requires an interactive (or hands-on) computer
system, which provides direct communication between the user and
the system.
*In Time sharing (or multitasking) systems, a single CPU executes
multiple jobs by switching among them, but the switches occur so
frequently that the users can interact with each program while it is
running.
*The response time should be short- typically less than one second.
*A time-shared operating system allows many users to share the
computersimultaneously. As the system switches rapidly from one
user to the next.
Clustered Systems:
1. Clustered systems are two or more individual systems connected
together via a network and sharing software resources.
2. Clustering provides high availability of resources and services.
3. The service will continue even if one or more systems in the
cluster fail.
4. High availability is generally obtained by storing a copy of files (s/w
resources) in the system.
PART – B
3)
a) Calculate the average waiting Time and Turn around time for the
following
Examples
VMware
VMware is a popular commercial application that abstracts
Intel 80X86 hardware into isolated virtual machines. The
virtualization tool runs in the user-layer on top of the host
OS. The virtual machines running in this tool believe they
are running on bare hardware, but the fact is that it is
running inside a user-level application.
VMware runs as an application on a host operating system
such as Windows or Linux and allows this host system to
concurrently run several different guest operating
systems as independent virtual machines.
In below scenario, Linux is running as the host operating system;
FreeBSD, Windows NT, and Windows XP are running as guest
operating systems. The virtualization layer is the heart of VMware, as
it abstracts the physical hardware into isolated virtual machines
running as guest operating systems. Each virtual machine has its own
virtual CPU, memory, disk drives, network interfaces, and so forth
Implementation
The virtual-machine concept is useful, it is difficult to
implement.
Work is required to provide an exact duplicate of the
underlying machine. Remember that the underlying machine
has two modes: user mode and kernel mode.
The virtual-machine software can run in kernel mode, since it is
the operating system. The virtual machine itself can execute in
only user mode.
Benefits
Able to share the same hardware and run several different
execution environments (OS).
Host system is protected from the virtual machines and the
virtual machines are protected from one another. A virus in
guest OS, will corrupt that OS but will not affect the other guest
systems and host systems.
Even though the virtual machines are separated from one
another, software resources can be shared among them. Two
ways of sharing s/w resource for communication are:
o To share a file system volume (part of memory).
o To develop a virtual communication network to
communicate between the virtual machines.
The operating system runs on and controls the entire machine.
Therefore, the current system must be stopped and taken out
of use while changes are made and tested. This period is
commonly called system development time. In virtual machines
such problem is eliminated. User programs are executed in one
virtual machine and system development is done in another
environment.
Multiple OS can be running on the developer’s system
concurrently. This helps in rapid porting and testing of
programmer’s code in different environments.
System consolidation – two or more systems are made to run
in a single system.
4)
a) Apply the Scheduling algorithms to determine the average
waiting time , turn-around time and response time : using 1]pre-
emptive and non-pre-emptive SJF 2]pre-emptive priority 3] Round
Robin
b) Define operating system and Explain dual mode of operating
systems with neat diagram.
>>An operating system is system software that acts as an
intermediary between a user of a computer and the computer
hardware. It is software that manages the computer hardware and
allows the user to execute programs in a convenient and efficient
manner.
Dual-Mode Operation
Since the operating system and the user programs share the
hardware and software resources of the computer system, it has to
be made sure that an error in a user program cannot cause problems
to other programs and the Operating System running in the system.
The approach taken is to use a hardware support that allows us to
differentiate among various modes of execution.
The system can be assumed to work in two separate modes of
operation:
1. User mode
2. Kernel mode (supervisor mode, system mode, or privileged
mode).
3. A hardware bit of the computer, called the mode bit, is used to
indicate the current mode: kernel (0) or user (1). With the
mode bit, we are able to distinguish between a task that is
executed by the operating system and one that is executed by
the user.
4. When the computer system is executing a user application, the
system is in user mode. When a user application requests a
service from the operating system (via a system call), the
transition from user to kernel mode takes place.