0% found this document useful (0 votes)
20 views

Unit-1 Os

It is partial pdf

Uploaded by

DrSavan Payasi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Unit-1 Os

It is partial pdf

Uploaded by

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

Unit-1

What is Operating System?


An Operating System (OS) is an interface between a computer user and computer
hardware. An operating system is a software which performs all the basic tasks like file
management, memory management, process management, handling input and output, and
controlling peripheral devices such as disk drives and printers.

Generally, a Computer System consists of the following components:

 Computer Users are the users who use the overall computer system.
 Application Softwares are the softwares which users use directly to perform
different activities. These softwares are simple and easy to use like Browsers,
Word, Excel, different Editors, and Games etc. These are usually written in high-
level languages, such as Python, Java and C++.
 System Softwares are the softwares which are more complex in nature and they
are more near to computer hardware. These software are usually written in low-
level languages like assembly language and includes Operating
Systems (Microsoft Windows, macOS, and Linux), Compiler, and Assembler etc.
 Computer Hardware includes Monitor, Keyboard, CPU, Disks, Memory, etc.

Operating System - Examples


There are plenty of Operating Systems available in the market which include paid and
unpaid (Open Source). Following are the examples of the few most popular Operating
Systems:

 Windows: This is one of the most popular and commercial operating systems
developed and marketed by Microsoft. It has different versions in the market like
Windows 8, Windows 10 etc and most of them are paid.
 Linux: This is a Unix based and the most loved operating system first released on
September 17, 1991 by Linus Torvalds. Today, it has 30+ variants available like
Fedora, OpenSUSE, CentOS, UBuntu etc. Most of them are available free of
charges though you can have their enterprise versions by paying a nominal license
fee.
 MacOS: This is again a kind of Unix operating system developed and marketed
by Apple Inc. since 2001.
 iOS:This is a mobile operating system created and developed by Apple Inc.
exclusively for its mobile devices like iPhone and iPad etc.
 Android: This is a mobile Operating System based on a modified version of the
Linux kernel and other open source software, designed primarily for touchscreen
mobile devices such as smartphones and tablets.

Some other old but popular Operating Systems include Solaris, VMS, OS/400, AIX,
z/OS, etc.

Operating System - Functions


To brief, Following are some of important functions of an operating System
which we will look in more detail in upcoming chapters:

 Process Management
 I/O Device Management
 File Management
 Network Management
 Main Memory Management
 Secondary Storage Management
 Security Management
 Command Interpreter System
 Control over system performance
 Job Accounting
 Error Detection and Correction
 Coordination between other software and users
 Many more other important tasks

Need for an Operation System


An Operating System is an essential part of any computer software. Without Operating
System, we cannot even operate a computer. The primary purpose of an Operating
System is to enable applications (softwares) to interact with a computer's hardware and to
manage a system's hardware and software resources. Following are some of the salient
features of an Operating System which can help us to understand the need of an operating
system.

Interface between User and Computer


An Operating System provides an interface between user and a computer. For example,
Windows Operating System provides a GUI, Graphical User Interface where a user can
visually interact with computers by clicking icons, typing words using keyboard, using
mouse to perform many actions on a computer. Similarly Unix provides a command line
interface, where a user can type command to perform a particular operation.
Booting Process
When a computer is switched on, there is no application in main memory. First Operating
System is loaded in main memory which then assist user to log on to the machine. This
initial startup of a computer or mobile device is known as booting process. Without
Operating System, booting cannot happen.

Managing Input/Output Devices


A computer has multiple peripheral devices like mouse, keyboard, speakers, scanner,
printers. Operating System manages all of these devices connected to the computer. It
assists in installing the device drivers. For example, windows operating system provides a
control panel to manage all hardware devices, to check their health. It also provides
options to troubleshoot if any device is not functioning properly.

Multitasking Support
An operating system, in a multitasking environment, ensures that each task or precisely a
process gets its CPU share when it needs to do some computation while other process can
be busy in I/O operation, like writing to primary or secondary memory or waiting for user
input or writing to printer and so on. This way, with the help of Operating System, a user
can perform multiple tasks simultaneously on a computer like listening music while
working on word document, browse web and keep multiple application open in system so
that any application can be opened in its current state.

Platform for Application Softwares


Operating System provides an environment to Application Softwares to execute.
Application softwares need not to know about underlying machine language. They are
intended for a particular Operating System. For example, a Word document software for
Windows will not work on Linux machine. Operating System provides many services
like I/O operations, file system manipulation, resource allocation and protection.

Memory Management
Operating system manages primary memory and disk. Operating System can increase
available physical memory via virtual memory management. It moves processes back and
forth between main memory and disk during a program execution. Via memory
management, operating system keeps track of each and every memory location, being
allocated to some process or being free and allocates memory accordingly.
System Files Management
Operating System provides control and interface to create/delete files, directories in
underlying file system on disk. It provides permission management like to give readonly
or read-write permission to files or directories or to show/hide them. An operating
sytstem also provides options to create backup of files and to restore them when needed.

Security Management
Operating System provides many security features to safeguard system and its resources.
It ensures that all access to system resources is controlled. External I/O devices are
protected from invalid access attempts and an Operating System provides authentication
features for each user by means of passwords or other ways of authenticating a user.

Error Management
Errors can occur anytime and anywhere. For example, an error may occur during a CPU
operation, performing I/O operations on devices or in the memory hardware. Operating
System takes care of such issues by constantly checking for possible errors and by taking
an appropriate action to ensure correct and consistent computing.

System calls
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.
 Creation and management of new processes.
 Network connections also require system calls. This includes sending and receiving packets.
 Access to a hardware devices such as a printer, scanner etc. requires a system call.

Types of System Calls


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

Process Control
These system calls deal with processes such as process creation, process termination etc.

File Management
These system calls are responsible for file manipulation such as creating a file, reading a
file, writing into a file etc.
Device Management
These system calls are responsible for device manipulation such as reading from device
buffers, writing into device buffers etc.

Information Maintenance
These system calls handle information and its transfer between the operating system and
the user program.

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 Calls Windows Linux


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

File Management CreateFile() open()


ReadFile() read()
WriteFile() write()
CloseHandle() close()
Device Management SetConsoleMode() ioctl()
ReadConsole() read()
WriteConsole() write()
Information Maintenance GetCurrentProcessID() getpid()
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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy