Os Chapter 1
Os Chapter 1
1
➢ INTRODUCTION TO OPERATING SYSTEMS
An operating system is a program that controls the execution of application programs and
acts as an interface between the user of a computer and the computer hardware. The purpose
of an operating system is to provide an environment in which a user can execute programs
conveniently and efficiently.
• Efficiency: The operating system increases the production efficiency. This is because
the system configuration takes less time. By default, the operating system handles
system tasks such as allocating resources to processes and resolving conflicts between
different programs and users. This saves the user time and results in a more efficient
result.
• Hardware abstraction: The operating system performs a good job of concealing the
computer's intricate details. The user can fully utilise the computer hardware without
having to cope with the accompanying difficulties. The operating system coordinates
communication between user programs and computer hardware.
2
• Convenience: In the absence of an operating system, users would have to deal with the
hardware directly without access to the pre-configured utility packages that come with
an operating system. This would make using a computer extremely inconvenient.
Operating systems allow users to go right to work on the tasks they want to do without
dealing with the burden of setting up the system beforehand.
• System resource management: The operating system serves as a neutral arbitrator. It
serves a management role in the computer system by ensuring equitable resource
distribution among various operations and consumers.
Computer Development of an
Generation Period
Architecture OS
First 1940s – 1950s Vacuum tubes- No operating system
based technology,
plug boards and
punched cards,
magnetic core
memories
Second 1950s – 1960s Mainframe Automated job
computers, line sequencing
printers, magnetic Resident monitor
tapes, assemblers, Batch systems
linkers, loaders, Offline operation
compilers, with magnetic tapes
FORTRAN,
COBOL
Third 1960s – 1980s IC-based Multi-programming
technology, Multi-programmed
Minicomputer batch systems
Magnetic disk Time-sharing multi-
user systems
UNIX
Fourth 1980s – Present LSI- and VLSI- MS-DOS
based technology, Apple Macintosh
Microcomputer Windows Multi-
tasking Multi-
threading X
Windows
Network operating
systems Distributed
operating systems
3
• Types of an Operating System
1. Batch Operating System: This type of operating system does not interact with the
computer directly. There is an operator which takes similar jobs having the same
requirement and group them into batches. It is the responsibility of the operator to sort
jobs with similar needs.
Examples: Payroll System, Bank Statements, etc.
4. Time-Sharing Operating Systems: Each task is given some time to execute so that
all the tasks work smoothly. Each user gets the time of CPU as they use a single
system. These systems are also known as Multitasking Systems. The task can be from
a single user or different users also. The time that each task gets to execute is called
quantum. After this time interval is over OS switches over to the next task.
Examples: Multics, Unix, etc.
6. Network Operating System: These systems run on a server and provide the
capability to manage data, users, groups, security, applications, and other networking
functions. These types of operating systems allow shared access of files, printers,
security, applications, and other networking functions over a small private network.
these computers are popularly known as tightly coupled systems.
Example: Microsoft Windows Server 2003, Microsoft Windows Server 2008, UNIX,
Linux, Mac OS X, Novell NetWare, and BSD, etc.
7. Real-Time Operating System: These types of OSs serve real-time systems. The
time interval required to process and respond to inputs is very small. This time interval
4
is called response time. Real-time systems are used when there are time requirements
that are very strict like missile systems, air traffic control systems, robots, etc.
Examples: Scientific experiments, medical imaging systems, industrial control
systems, weapon systems, robots, air traffic control systems, etc.
1. Simple Structure
There are many operating systems that have a rather simple structure. These started as
small systems and rapidly expanded much further than their scope. A common example
of this is MS-DOS. It was designed simply for a niche amount for people.
2. Monolithic OS
The monolithic operating system is a very basic operating system in which file
management, memory management, device management, and process management are
directly controlled within the kernel. The kernel can access all the resources present in
the system. Operating systems that use monolithic architecture were first time used in
the 1970s.The monolithic operating system is also known as the monolithic kernel The
monolithic kernel acts as a virtual machine that controls all hardware parts.
5
3. Layered Structure
A system can be made modular in many ways and one of the methods is the layered
approach in which the operating system is broken into several layers. Generally, the
structure of an operating system depends on how the various common components are
interconnected with each other and how it is combined with the kernel. The layered
structure of an operating system is the improvised approach of the early monolithic
systems.
4. Micro Kernel OS
Micro kernel is the type of the operating system architecture which is useful in the same
way as the other architectures are and is used for file management, memory
management and the scheduling of the processes. The basic idea of microkernel design
is to achieve high reliability by splitting the operating system up into small, well-
defined modules. The microkernel OS runs in kernel mode.
The main function of microkernel is to provide a communication facility between the
client program and various services that are running in user space.
5. Client Server OS
Client/Server communication involves two components, namely a client and a server.
They are usually multiple clients in communication with a single server. The clients
send requests to the server and the server responds to the client requests.
6
Fig. Client Server OS Structure
3. Timer
We must ensure that the operating system maintains control over the CPU. We cannot
allow a user program to get stuck in an infinite loop or to fail to call system services
and never return control to the operating system. To accomplish this goal, we can use a
timer. A timer can be set to interrupt the computer after a specified period. The period
may be fixed or variable. A variable timer is generally implemented by a fixed-rate
clock and a counter. The operating system sets the counter.
7
➢ FUNCTIONS OF AN OPERATING SYSTEMS
3. Device Management: An operating system regulates device connection using drivers. The
processes may require devices for their use. This management is done by the OS. The OS:
4. File Management: The operating system manages resource allocation and de-allocation. It
specifies which process receives the file and for how long. It also keeps track of information,
location, uses, status, and so on. These groupings of resources are referred to as file systems.
The files on a system are stored in different directories. The OS:
8
5. Storage Management: Storage management is a procedure that allows users to maximize the
utilization of storage devices while also protecting data integrity on whatever media on which
it lives. Network virtualization, replication, mirroring, security, compression, deduplication,
traffic analysis, process automation, storage provisioning, and memory management are some
of the features that may be included. The operating system is in charge of storing and accessing
files. The creation of files, the creation of directories, the reading and writing of data from files
and directories, as well as the copying of the contents of files and directories from one location
to another are all included in storage management.
1. User interface: Almost all operating systems have a user interface (UI). This interface can
take several forms. Most commonly, a graphical user interface (GUI) is used. Mobile
systems such as phones and tablets provide a touch-screen interface, enabling users to slide
their fingers across the screen or press buttons on the screen to select choices. Another
option is a command-line interface (CLI), which uses text commands and a method for
entering them. Some systems provide two or all three of these variations.
2. Program execution: The system must be able to load a program into memory and to run
that program. The program must be able to end its execution, either normally or abnormally
(indicating error).
3. I/O operations: A running program may require I/O, which may involve a file or an I/O
device. For specific devices, special functions may be desired (such as reading from a
network interface or writing to a file system). For efficiency and protection, users usually
cannot control I/O devices directly. Therefore, the operating system must provide a means
to do I/O.
9
4. File-system manipulation: Programs need to read and write files and directories. They also
need to create and delete them by name, search for a given file, and list file information.
Some operating systems include permissions management to allow or deny access to files
or directories based on file ownership. Many operating systems provide a variety of file
systems, sometimes to allow personal choice and sometimes to provide specific features or
performance characteristics.
5. Communications: There are many circumstances in which one process needs to exchange
information with another process. Such communication may occur between processes that
are executing on the same computer or between processes that are executing on different
computer systems tied together by a network. Communications may be implemented via
shared memory, in which two or more processes read and write to a shared section of
memory, or message passing, in which packets of information in predefined formats are
moved between processes by the operating system.
6. Error detection: The operating system needs to be detecting and correcting errors
constantly. Errors may occur in the CPU, memory, in I/O devices and in the user program.
For each type of error, the operating system should take the appropriate action to ensure
correct and consistent computing. Sometimes, it has no choice but to halt the system. At
other times, it might terminate an error-causing process or return an error code to a process
for the process to detect and possibly correct.
➢ INTERFACE OF AN OS
1. Command Line Interpreter:
Most operating systems, including Linux, UNIX, and Windows, treat the command
interpreter as a special program that is running when a process is initiated or when a
user first logs on systems. On systems with multiple command interpreters to choose
from, the interpreters are known as shells.
The main function of the command interpreter is to get and execute the next user-
specified command. Many of the commands given at this level manipulate files: create,
delete, list, print, copy, execute, and so on. The various shells available on UNIX
systems operate in this way.
10
3. Screen Touch Interface:
Because a either a command-line interface or a mouse-and-keyboard system is
impractical for most mobile systems, smartphones and handheld tablet computers
typically use a touch-screen interface. Here, users interact by making gestures on the
touch screen— for example, pressing and swiping fingers across the screen. Although
earlier smartphones included a physical keyboard, most smartphones and tablets now
simulate a keyboard on the touch screen.
11
➢ Types of System Call
1. Process control
• create process, terminate process
• load, execute
• get process attributes, set process attributes
• wait event, signal event
• allocate and free memory
2. File management
• create file, delete file
• open, close
• read, write, reposition
• get file attributes, set file attributes
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
• send, receive messages
• transfer status information
• attach or detach remote devices
6. Protection
• get file permissions
• set file permissions
➢ SYSTEM PROGRAMS
1. File Management: A file is a collection of specific information stored in the
memory of a computer system. File management is defined as the process of
manipulating files in the computer system, its management includes the process of
creating, modifying and deleting files.
12
and displayed on output devices or printed. Terminal or other output devices or files
or a window of GUI is used for showing the output of programs.
➢ File Modification: For modifying the contents of files we use this. For Files stored
on disks or other storage devices, we used different types of editors. For searching
contents of files or perform transformations of files we use special commands.
➢ Program Loading and Execution: When the program is ready after Assembling
and compilation, it must be loaded into memory for execution. A loader is part of an
operating system that is responsible for loading programs and libraries. It is one of
the essential stages for starting a program. Loaders, relocatable loaders, linkage
editors, and Overlay loaders are provided by the system.
➢ SYSTEM BOOT
Booting is the process of starting a computer. It can be initiated by hardware such as a button
press or by a software command. After it is switched on, a CPU has no software in its main
memory, so some processes must load software into memory before execution. This may be
done by hardware or firmware in the CPU or by a separate processor in the computer system.
Restarting a computer also is called rebooting, which can be "hard", e.g., after electrical power
to the CPU is switched from off to on, or "soft", where the power is not cut. On some systems,
a soft boot may optionally clear RAM to zero. Hard and soft booting can be initiated by
hardware such as a button press or a software command. Booting is complete when the
operative runtime system, typically the operating system and some applications, is attained.
Types of Booting
1. Cold Booting: When the computer starts for the first time or is in a shut-down state and
switch on the power button to start the system, this type of process to start the computer is
called cold booting. During cold booting, the system will read all the instructions from the
13
ROM (BIOS) and the Operating System will be automatically get loaded into the system.
This booting takes more time than Hot or Warm Booting.
2. Warm Booting: Warm or Hot Booting process is when computer systems come to no
response or hang state, and then the system is allowed to restart during on condition. It is
also referred to as rebooting. There are many reasons for this state, and the only solution is
to reboot the computer. Rebooting may be required when we install new software or
hardware. The system requires a reboot to set software or hardware configuration changes,
or sometimes systems may behave abnormally or may not respond properly. In such a case,
the system has to be a force restart.
14