Unit-1 Os
Unit-1 Os
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.
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.
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
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.
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.
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.
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 −
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.