0% found this document useful (0 votes)
12 views9 pages

Module 1,2

Uploaded by

prithiviphr777
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views9 pages

Module 1,2

Uploaded by

prithiviphr777
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CSBS03

Operating System

[Link] types of System calls with an example for each.(10)

There are commonly five types of system calls. These are as follows:

Process Control
Process control is the system call that is used to direct the processes. Some process
control examples include creating, load, abort, end, execute, process, terminate the process,
etc.
fork(): Processes generate clones of themselves using the fork() system call. It is one of
the most common ways to create processes in operating systems.
wait(): In some systems, a process may have to wait for another process to complete its
execution before proceeding.

File Management
File management is a system call that is used to handle the files. Some file management
examples include creating files, delete files, open, close, read, write, etc.
open(): The open() system call allows you to access a file on a file system.

Device Management
Device management is a system call that is used to deal with devices. Some examples of
device management include read, device, write, get device attributes, release device, etc.
read(): It is used to obtain data from a file on the file system.
write(): It is used to write data from a user buffer to a device like a file. This system call is
one way for a program to generate data.

Information Maintenance
Information maintenance is a system call that is used to maintain information. There are
some examples of information maintenance, including getting system data, set time or date,
get time or date, set system data, etc.

Communication
CSBS03

Communication is a system call that is used for communication. There are some examples
of communication, including create, delete communication connections, send, receive
messages, etc.

[Link] Handling.(10)

In several operating systems such as Linux. mac or windows Interrupt handling is divided
into two parts.
● First-level interrupt handlers (FLIH), also known as hard interrupt handlers or fast
interrupt handlers.
● Second-level interrupt handlers (SLIH), also known as slow interrupt handlers or soft
interrupt handlers.
The uses and properties of FLIH and SLIH are given below.
FLIH
● These include platform specific interrupt handling.
● It causes jitter in the execution of the process.
● It also masks interrupts.
● FLIH is known as the upper half in Linux.
SLIH
● It completes long interrupt processing tasks similar to the process or event.
● Have a dedicated thread for every single handler.
● It has a long-lived execution time
CSBS03

● SLIH is known as the Lower half or bottom half in Linux.


The instruction cycle consists of fetch, decode, execute and read/write functions.
After every instruction cycle, the processor will check for interrupts to be processed. If no
interrupt is present in the system it will go for the next instruction cycle which is given by the
instruction register.
If there is an interrupt present then it will trigger the interrupt handler, the handler will
stop the present instruction which is processing and save its configuration in a register and
load the program counter of the interrupt from a location which is given by the interrupt
table.
After processing the interrupt the processor interrupt handler will load the instruction
and its configuration from the saved register, the process will start its processing where it’s
left. This is also called context switching.

[Link] sharing System.(10)


Time-sharing is a technique which enables many people, located at various terminals, to
use a particular computer system at the same time. Time-sharing or multitasking is a logical
extension of multiprogramming. Processor's time which is shared among multiple users
simultaneously is termed as time-sharing.
Advantages of Timesharing operating systems are as follows.
● Provides the advantage of quick response.
● Avoids duplication of software.
● Reduces CPU idle time.
Disadvantages of Time-sharing operating systems are as follows.
● Problem of reliability.
● Question of security and integrity of user programs and data.
● Problem of data communication.
CSBS03

Distributed System
Distributed systems use multiple central processors to serve multiple real-time
applications and multiple users. Data processing jobs are distributed among the processors
accordingly.
The advantages of distributed systems are as follows.
● With resource sharing facility, a user at one site may be able to use the resources
available at another.
● Speedup the exchange of data with one another via electronic mail.
● If one site fails in a distributed system, the remaining sites can potentially continue
operating.
● Better service to the customers.
● Reduction of the load on the host computer.
● Reduction of delays in data processing.

Multiprocessor
Multitasking is when multiple jobs are executed by the CPU simultaneously by switching
between them. Switches occur so frequently that the users may interact with each program
while it is running. An OS does the following activities related to multitasking.
● The user gives instructions to the operating system or to a program directly, and
receives an immediate response.
● The OS handles multitasking in the way that it can handle multiple
operations/executes multiple programs at a time.

[Link] the following Views of operating systems.(i) User View (ii) System View (10)
The operating system may be observed from the viewpoint of the user or the system. It is
known as the user view and the system view. There are mainly two types of views of the
operating system. These are as follows:
● User View
● System View
User View
The user view depends on the system interface that is used by the users. Some systems
are designed for a single user to monopolize the resources to maximize the user's task.
The user viewpoint focuses on how the user interacts with the operating system through
the usage of various application programs.
1. Single User View Point
In some cases, the system is designed to maximize the output of a single user. As a result,
more attention is laid on accessibility, and resource allocation is less important. These
CSBS03

systems are much more designed for a single user experience and meet the needs of a single
user, where the performance is not given focus as the multiple user systems.
[Link] User View Point
When there is one mainframe computer and many users on their computers trying to
interact with their kernels over the mainframe to each other. In such circumstances, memory
allocation by the CPU must be done effectively to give a good user experience.
3. Handled User View Point
Moreover, the touchscreen era has given you the best handheld technology ever.
Smartphones interact via wireless devices to perform numerous operations, but they're not
as efficient as a computer interface, limiting their usefulness. However, their operating
system is a great example of creating a device focused on the user's point of view.
4. Embedded System User View Point
Some systems, like embedded systems that lack a user point of view. The remote control
used to turn on or off the tv is all part of an embedded system in which the electronic device
communicates with another program where the user viewpoint is limited and allows the
user to engage with the application.
System View
According to this point of view, the operating system's purpose is to maximize
performance. The operating system is responsible for managing hardware resources and
allocating them to programs and users to ensure maximum performance.
However, we are more concerned with how the hardware interacts with the operating
system than with the user from a system viewpoint. The hardware and the operating system
interact for a variety of reasons, including:
1. Resource Allocation
The hardware contains several resources like registers, caches, RAM, ROM, CPUs, I/O
interaction, etc. These are all resources that the operating system needs when an
application program demands them. Only the operating system can allocate resources, and
it has used several tactics and strategies to maximize its processing and memory space
2. Control Program
The control program controls how input and output devices (hardware) interact with
the operating system. The user may request an action that can only be done with I/O
devices; in this case, the operating system must also have proper communication, control,
detect, and handle such devices.

[Link] the concepts of Virtual Machine with a neat diagram. (10)


Virtual Machine Architecture
CSBS03

Virtual Machine architecture pretends some functionality, which is not native to the
hardware and/or software on which it is implemented. A virtual machine is built upon an
existing system and provides a virtual abstraction, a set of attributes, and operations.
In virtual machine architecture, the master uses the ‘same’ subservice’ from the slave
and performs functions such as split work, call slaves, and combine results. It allows
developers to simulate and test platforms, which have not yet been built, and simulate
"disaster'' modes that would be too complex, costly, or dangerous to test with the real
system.
In most cases, a virtual machine splits a programming language or application
environment from an execution platform. The main objective is to provide portability.
Interpretation of a particular module via a Virtual Machine may be perceived as − The
interpretation engine chooses an instruction from the module being interpreted.
Based on the instruction, the engine updates the virtual machine’s internal state and
the above process is repeated.
The following figure shows the architecture of a standard VM infrastructure on a single
physical machine.

Applications
Virtual machine architecture is suitable in the following domains −
● Suitable for solving a problem by simulation or translation if there is no direct
solution.
● Sample applications include interpreters of microprogramming, XML processing,
script command language execution, rule-based system execution, Smalltalk and Java
interpreter typed programming language.
● Common examples of virtual machines are interpreters, rule-based systems, syntactic
shells, and command language processors.
Advantages
● Portability and machine platform independency.
● Simplicity of software development.
● Provides flexibility through the ability to interrupt and query the program.
● Simulation for disaster working model.
CSBS03

● Introduce modifications at runtime.


Disadvantages
● Slow execution of the interpreter due to the interpreter nature.
● There is a performance cost because of the additional computation involved in
execution.
[Link] the various Operating System services in detail. (10)
An Operating System provides services to both the users and to the programs.
● It provides programs an environment to execute.
● It provides users the services to execute the programs in a convenient manner.
Following are a few common services provided by an operating system −
● Program execution
● I/O operations
● File System manipulation
● Communication
● Error Detection
● Resource Allocation
● Protection
Program execution
Operating systems handle many kinds of activities from user programs to system
programs like printer spooler, name servers, file server, etc. Each of these activities is
encapsulated as a process.
A process includes the complete execution context (code to execute, data to manipulate,
registers, OS resources in use). Following are the major activities of an operating system with
respect to program management −
● Loads a program into memory.
● Executes the program.
● Handles program's execution.
● Provides a mechanism for process synchronization.
● Provides a mechanism for process communication.
● Provides a mechanism for deadlock handling.
I/O Operation
An I/O subsystem comprises of I/O devices and their corresponding driver software.
Drivers hide the peculiarities of specific hardware devices from the users.
An Operating System manages the communication between user and device drivers.
● I/O operation means read or write operation with any file or any specific I/O device.
● Operating system provides the access to the required I/O device when required.
File system manipulation
CSBS03

A file represents a collection of related information. Computers can store files on the
disk (secondary storage), for long-term storage purpose. Examples of storage media include
magnetic tape, magnetic disk and optical disk drives like CD, DVD. Each of these media has
its own properties like speed, capacity, data transfer rate and data access methods.
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directions. Following are the major activities of an
operating system with respect to file management −
Program needs to read a file or write a file.
The operating system gives the permission to the program for operation on file.
● Permission varies from read-only, read-write, denied and so on.
● Operating System provides an interface to the user to create/delete files.
● Operating System provides an interface to the user to create/delete directories.
● Operating System provides an interface to create the backup of file system.
Communication
In case of distributed systems which are a collection of processors that do not share
memory, peripheral devices, or a clock, the operating system manages communications
between all the processes. Multiple processes communicate with one another through
communication lines in the network.
The OS handles routing and connection strategies, and the problems of contention and
security. Following are the major activities of an operating system with respect to
communication −
Two processes often require data to be transferred between them
● Both the processes can be on one computer or on different computers, but are
connected through a computer network.
● Communication may be implemented by two methods, either by Shared Memory or
by Message Passing.
Error handling
Errors can occur anytime and anywhere. An error may occur in CPU, in I/O devices or in
the memory hardware. Following are the major activities of an operating system with
respect to error handling −
● The OS constantly checks for possible errors.
● The OS takes an appropriate action to ensure correct and consistent computing.
Resource Management
In case of multi-user or multi-tasking environment, resources such as main memory,
CPU cycles and files storage are to be allocated to each user or job. Following are the major
activities of an operating system with respect to resource management −
● The OS manages all kinds of resources using schedulers.
● CPU scheduling algorithms are used for better utilization of CPU.
CSBS03

Protection
Considering a computer system having multiple users and concurrent execution of
multiple processes, the various processes must be protected from each other's activities.
Protection refers to a mechanism or a way to control the access of programs, processes,
or users to the resources defined by a computer system. Following are the major activities of
an operating system with respect to protection −
● The OS ensures that all access to system resources is controlled.
● The OS ensures that external I/O devices are protected from invalid access attempts.
● The OS provides authentication features for each user by means of passwords.

You might also like