100% found this document useful (1 vote)
2K views

ASSIGNMENT Operating System

This document contains the answers to various questions about operating systems. It discusses the objectives of an operating system which include making the computer system convenient to use efficiently, hiding hardware details from users, and managing computer resources. It also explains the evolution of operating systems from early systems in the 1940s-1950s to modern systems, and describes different types of operating systems like batch, time-sharing, distributed, network, and real-time operating systems. Finally, it outlines the key functions and services provided by operating systems such as memory management, processor management, file management, and program execution.

Uploaded by

karan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views

ASSIGNMENT Operating System

This document contains the answers to various questions about operating systems. It discusses the objectives of an operating system which include making the computer system convenient to use efficiently, hiding hardware details from users, and managing computer resources. It also explains the evolution of operating systems from early systems in the 1940s-1950s to modern systems, and describes different types of operating systems like batch, time-sharing, distributed, network, and real-time operating systems. Finally, it outlines the key functions and services provided by operating systems such as memory management, processor management, file management, and program execution.

Uploaded by

karan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

NAME-Aman singh

SUBJECT- UNIX Operating System &


Shell Programming

ASSIGNMENT-1
(Q1) WHAT ARE THE OBJECTIVE OF AN OPERATIVE SYSTEM.
ANS. – The operating system is a program with following features-
(1) An operating system is a program that acts as an interface between
the software and computer hardware.
(2) It is an integrated set of specialized program used to manage overall
resources and operations of computer.
(3) It is a specialized software that controls and monitors the execution of
all programs reside in the computer, including application programs
and other system software.
The objective of the operating systems are –
(a) To make the computer system convenient to use in an efficient
manner.
(b) To hide the details of the hardware resources from the users.
(c) To provide users a convenient interface to use the computer
system.
(d) To act as an intermediary between the hardware and its users,
making it easier for the users to access and use other resources.
(e) To manage the resources of a computer system.
(f) To keep track of who is using which resource, granting resource
requests, and mediating conflicting requests from different
programs and users.
(g) To provide efficient and fair sharing of resources among users
and programs
(Q2)- EXPLAIN THE FOLLOWING.

(A) EVOLUTION & TYPE OF OPERATING SYSTEM -


(a) Early Evolution -
 1945: ENIAC, Moore School of Engineering, University of Pennsylvania.

 1949: EDSAC and EDVAC

 1949: BINAC - a successor to the ENIAC


 1951: UNIVAC by Remington

 1952: IBM 701

 1956: The interrupt

 1954-1957: FORTRAN was developed


(b) Operating Systems - In 1960s -
 1961: The dawn of minicomputers
 1962: Compatible Time-Sharing System (CTSS) from MIT

 1963: Burroughs Master Control Program (MCP) for the B5000 system
 1964: IBM System/360

 1960s: Disks became mainstream


 1966: Minicomputers got cheaper, more powerful, and really useful.

 1967-1968: Mouse was invented.

 1964 and onward: Multics


 1969: The UNIX Time-Sharing System from Bell Telephone Laboratories.
(c) Accomplishments after 1970 -

 1971: Intel announces the microprocessor

 1972: IBM comes out with VM: the Virtual Machine Operating System

 1973: UNIX 4th Edition is published

 1973: Ethernet
 1974 The Personal Computer Age begins
 1974: Gates and Allen wrote BASIC for the Altair

 1976: Apple II

 August 12, 1981: IBM introduces the IBM PC


 1983 Microsoft begins work on MS-Windows

 1984 Apple Macintosh comes out

 1990 Microsoft Windows 3.0 comes out

 1991 GNU/Linux
 1992 The first Windows virus comes out
 1993 Windows NT
 2007: iOS

 2008: Android OS
(d) Batch operating system-

The users of a batch operating system do not interact with the computer
directly. Each user prepares his job on an off-line device like punch cards and
submits it to the computer operator. To speed up processing, jobs with similar
needs are batched together and run as a group. The programmers leave their
programs with the operator and the operator then sorts the programs with
similar requirements into batches.
(e)Time-sharing operating systems-

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.The main difference between Multiprogrammed Batch Systems and
Time-Sharing Systems is that in case of Multiprogrammed batch systems, the
objective is to maximize processor use, whereas in Time-Sharing Systems, the
objective is to minimize response time.

(f)Distributed operating 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.
(g) Network operating System-

A Network Operating System runs on a server and provides the server the
capability to manage data, users, groups, security, applications, and other
networking functions. The primary purpose of the network operating system is
to allow shared file and printer access among multiple computers in a network,
typically a local area network (LAN), a private network or to other networks.
Examples of network operating systems include Microsoft Windows Server
2003, Microsoft Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare,
and BSD.

(h)Real Time operating System-


A real-time system is defined as a data processing system in which the time
interval required to process and respond to inputs is so small that it controls the
environment. The time taken by the system to respond to an input and display
of required updated information is termed as the response time. So in this
method, the response time is very less as compared to online processing.

(B)FUNCTION OF OPERATING SYSTEM-


Following are some of important functions of an operating System.

Memory Management
Processor Management

Device Management
File Management
Security

Control over system performance

Job accounting
Error detecting aids

Coordination between other software and users

(1)Memory Management-

Memory management refers to management of Primary Memory or Main


Memory. Main memory is a large array of words or bytes where each word or
byte has its own address. Main memory provides a fast storage that can be
accessed directly by the CPU. For a program to be executed, it must in the main
memory.
(2)Processor Management-

In multiprogramming environment, the OS decides which process gets the


processor when and for how much time. This function is called process
scheduling.

(3)Device Management-
An Operating System manages device communication via their respective
drivers. It does the following activities for device management −

Keeps tracks of all devices. Program responsible for this task is known as the I/O
controller. Decides which process gets the device when and for how much time.
Allocates the device in the efficient way. De-allocates devices.

(4)File Management-

A file system is normally organized into directories for easy navigation and
usage. These directories may contain files and other directions. An Operating
System does the following activities for file management −
Keeps track of information, location, uses, status etc. The collective facilities are
often known as file system. Decides who gets the resources. Allocates the
resources. De-allocates the resources.

Other Important Activities

Following are some of the important activities that an Operating System


performs –
(a)Security − By means of password and similar other techniques, it prevents
unauthorized access to programs and data.
(b)Control over system performance − Recording delays between request for a
service and response from the system.

(c)Job accounting − Keeping track of time and resources used by various jobs
and users.

(d)Error detecting aids − Production of dumps, traces, error messages, and


other debugging and error detecting aids.

(e)Coordination between other softwares and users − Coordination and


assignment of compilers, interpreters, assemblers and other software to the
various users of the computer systems.

(C) SERVICES PROVIDED BY OPERATING SYSTEM -


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
(a)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.
(b)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.

(c)File system manipulation- 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.

(d)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.

(e)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.

(f)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.

(g)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

(D) COMMPONENTS OF OPERATING SYSTEM - An operating


system provides the environment within which programs are executed. To
construct such an environment, the system is partitioned into small modules
with a well-defined interface. The design of a new operating system is a major
task. It is very important that the goals of the system be will defined before the
design begins. The type of system desired is the foundation for choices
between various algorithms and strategies that will be necessary. A system as
large and complex as an operating system can only be created by partitioning it
into smaller pieces. Each of these pieces should be a well defined portion of the
system with carefully defined inputs, outputs, and function. Obviously, not all
systems have the same structure. However, many modern operating systems
share the system components outlined below.

(a)Process management-The process management component is tasked with


managing the many processes that are running on the operating system.
Software programs each have one or more processes associated with them
when they are running. For example, when you use an Internet browser, there is
a process running for that browser program. The operating system also has
many processes associated with it, each performing a different function. All
these processes are managed by process management, which keeps processes
in order, running efficiently, using memory allocated to them, and shutting
them down when necessary.
(b)Memory management-The memory management component, also
sometimes called main memory management or primary memory
management, handles primary memory, or RAM. When programs are running,
including the operating system, those programs store data in RAM for quick
access at any time. Memory management monitors and manages the memory
and knows which blocks of memory are in use, which programs are using
memory, and which memory blocks are available to be used.

(c)File management-The file management component manages anything to do


with computer files. When a file is created, file management is involved in the
creation of the file, including where it is stored on a storage device. When a file
is modified, file management helps with the modification of the file. File
management helps with deleting files and freeing up the space for another file
to be stored there at a later time. File management also handles tasks related to
the creation, modification, and deletion of folders, or directories, on a storage
device.

(d)Secondary storage management- The secondary storage management


component works with storage devices, like a hard drive, USB flash drive, DVD
drive, or floppy disk drive. While the file management component takes care of
the actual files on the storage device, the secondary storage management
component manages the storage device itself. It manages the available space,
or free space, on the storage device and allocating space for new files to be
stored there. Requests for data on a storage device are handled by secondary
storage management as well. For example, when a user double-clicks on a file
to open it, secondary storage management receives that request and helps
retrieve it from a storage device.

(e)Access management- The access management component is tasked with


managing user access to data on a computer. User accounts provide each user
with specific access to software, files, and functionality in an operating system.
The ability to install a software program is controlled by access management.
Access to view, edit, and delete a file is managed by access management.
Changing set tings in the operating system is managed by access management.
How a user interacts with the operating system and uses software is handled by
access management.

(f)System resource management- The system resource management


component is responsible for managing the allocation of system resources, like
memory and CPU time. When programs are running, they require the use of
memory and CPU time to function properly. System resource management
determines how much memory and CPU time that program is allowed to use at
any given time. Managing system resource usage is a big responsibility, as it can
directly impact the performance of the computer. If too many resources are
allocated to one process, other programs and processes may become slow or
unresponsive. If the operating system does not have enough resources
allocated to it, the entire computer can run slow or stop working altogether.
System resource management ensures system resources are allocated properly.

(E) WHAT ARE SYSTEM CALLS IN OPERATING SYSTEM?


The interface between a process and an operating system is provided by system
calls. In general, system calls are available as assembly language instructions.
They are also included in the manuals used by the assembly level programmers.
System calls are usually made when a process in user mode requires access to a
resource. Then it requests the kernel to provide the resource via a system call. A
figure representing the execution of the system call is given as follows:
As can be seen from this diagram, the processes execute normally in the user
mode until a system call interrupts this. Then the system call is executed on a
priority basis in the kernel mode. After the execution of the system call, the
control returns to the user mode and execution of user processes can be
resumed. In general, system calls are required in the following situations: If a file
system requires the creation or deletion of files. Reading and writing from files
also require a system call.

(a)Types of System Calls-

There are mainly five types of system calls. These are explained in detail as
follows:

(1)Process Control-These system calls deal with processes such as process


creation, process termination etc.
(2)File Management-These system calls are responsible for file manipulation
such as creating a file, reading a file, writing into a file etc.

(3)Device Management-These system calls are responsible for device


manipulation such as reading from device buffers, writing into device buffers
etc.

(4)Information Maintenance-These system calls handle information and its


transfer between the operating system and the user program.
(5)Communication- These system calls are useful for interprocess
communication. They also deal with creating and deleting a communication
connection.

Some of the examples of all the above types of system calls in Windows and
Unix are given as follows

Types of System Windows Linux


Calls
Process Control CreateProcess() fork()
exit()
ExitProcess() wait()

WaitForSingleObject()
File management CreateFile() open()
ReadFile() read()
WriteFile() write()
CloseHandle() close()

Device SetConsoleMode() ioctl()


management
ReadConsole() read()
WriteConsole() write()

Information GetCurrentProcessID() getpid()


management SetTimer() alarm()
Sleep() sleep()

communication CreatePipe() pipe()


CreateFileMapping() shmget()
MapViewOfFile() mmap()

There are many different system calls as shown above. Details of some of those
system calls are as follows:

open()-The open() system call is used to provide access to a file in a file system.
This system call allocates resources to the file and provides a handle that the
process uses to refer to the file. A file can be opened by multiple processes at
the same time or be restricted to one process. It all depends on the file
organisation and file system.

read()-The read() system call is used to access data from a file that is stored in
the file system. The file to read can be identified by its file descriptor and it
should be opened using open() before it can be read. In general, the read()
system calls takes three arguments i.e. the file descriptor, buffer which stores
read data and number of bytes to be read from the file.

write()-The write() system calls writes the data from a user buffer into a device
such as a file. This system call is one of the ways to output data from a program.
In general, the write system calls takes three arguments i.e. file descriptor,
pointer to the buffer where data is stored and number of bytes to write from
the buffer.

close()-The close() system call is used to terminate access to a file system. Using
this system call means that the file is no longer required by the program and so
the buffers are flushed, the file metadata is updated and the file resources are
de-allocated.

You might also like