MCA OS UNIT-1 Notes
MCA OS UNIT-1 Notes
UNIT-1-SYLLABUS
S-4 to SLO-1
Lab 1 : Understanding the booting process of Linux
S-5
S-9 to SLO-1
Lab 2:understand the behavior of the OS and get the CPU type and model
S-10
SLO-1 Types
S-11
SLO-2 Understanding of different types
to
S-15
INTRODUCTION :
Operating System -Objectives and functions- Gaining the role of Operating systems-The evolution
of operating system from early batch processing systems to modern complex systems- Architecture
of OS- Understanding the architecture- Operating system operations- Real time understanding of
operations- Operating system services- Learning of services- System calls- Examples- Types-
Understanding of different types- System programs- Learn with examples- System Design and
implementation- Implementation with design process.
************** **************
Introduction
File Allocation, Allocation of Memory, I/O Controlling, Maintaining the File system, Library
segments ,etc.,
❖ Control program – controls the execution of user programs and prvent errors, improper use
of computer operations of I/O devices.
Operating system Objectives:
❖ Efficiently execute user programs and make solving user problems easier.
❖ Make the computer system convenient to use.
❖ Use the computer hardware in an efficient manner.
1. Booting
Booting is a process of starting the computer operating system starts the computer to work. It checks the
computer and makes it ready to work.
2. Memory Management
It is also an important function of operating system. The memory cannot be managed without operating
system. Different programs and data execute in memory at one time.
4. Data Security
Data is an important part of computer system. The operating system protects the data stored on the
computer from illegal use, modification or deletion.
5. Disk Management
Operating system manages the disk space. It manages the stored files and folders in a proper way.
6. Process Management
CPU can perform one task at one time. If there are many tasks, operating system decides which task
should get the CPU.
7. Device Controlling
Operating system also controls all devices attached to computer. The hardware devices are controlled with
the help of small software called device drivers.
8. Printing Controlling
Operating system also controls printing function. It a user issues two print commands at a time, it does not
mix data of these files and prints them separately.
9. Providing Interface
It is used in order that user interface acts with a computer mutually. User interface controls how you input
data and instruction and how information is displayed on screen.
language for every task. During the computer generation, a programmer can merely execute and
solve basic mathematical calculations. an operating system is not needed for these computations.
2. The Second Generation (1955 – 1965)
GMOSIS, the first operating system (OS) was developed in the early 1950s. For the IBM Computer,
General Motors has created the operating system. Because it gathers all related jobs into groups or
batches and then submits them to the operating system using a punch card to finish all of them, the
second-generation operating system was built on a single-stream batch processing system.
3. The Third Generation (1965 – 1980)
Because it gathers all similar jobs into groups or batches and then submits them to the second
generation operating system using a punch card to finish all jobs in a machine, the second-generation
operating system was based on a single stream batch processing system. Control is transferred to the
operating system upon each job’s completion, whether it be routinely or unexpectedly. The operating
system cleans up after each work is finished before reading and starting the subsequent job on a
punch card. Large, professionally operated machines known as mainframes were introduced after
that. Operating system designers were able to create a new operating system in the late 1960s that
was capable of multiprogramming—the simultaneous execution of several tasks in a single computer
program.
In order to create operating systems that enable a CPU to be active at all times by carrying out
multiple jobs on a computer at once, multiprogramming has to be introduced. With the release of the
DEC PDP-1 in 1961, the third generation of minicomputers saw a new phase of growth and
development.
4. The Fourth Generation (1980 – Present Day)
The fourth generation of personal computers is the result of these PDPs. The Generation IV (1980–
Present)The evolution of the personal computer is linked to the fourth generation of operating
systems. Nonetheless, the third-generation minicomputers and the personal computer have many
similarities. At that time, minicomputers were only slightly more expensive than personal computers,
which were highly expensive.
The development of Microsoft and the Windows operating system was a significant influence in the
creation of personal computers. In 1975, Microsoft developed the first Windows operating system.
Bill Gates and Paul Allen had the idea to advance personal computers after releasing the Microsoft
Windows OS. As a result, the MS-DOS was released in 1981, but users found it extremely
challenging to decipher its complex commands. Windows is now the most widely used and well-
liked operating system available. Following then, Windows released a number of operating systems,
including Windows 95, Windows 98, Windows XP, and Windows 7, the most recent operating
system. The majority of Windows users are currently running Windows 10. Apple is another well-
known operating system in addition to Windows.
Let us consider how the OS have developed over the last 40 years. The developing of OS may depend
upon the hardware design and its implementation.
3. Multiprocessor System
4. Desktop System
5. Distributed Operating System
6. Clustered System
7. Real time Operating System
8. Handheld System
• In this type of system, there is no direct interaction between user and the computer.
• The user has to submit a job (written on cards or tape) to a computer operator.
• Then computer operator places a batch of several jobs on an input device.
• Jobs are batched together by type of languages and requirement.
• Then a special program, the monitor, manages the execution of each program in the batch.
• The monitor is always in the main memory and available for execution.
• In this the operating system picks up and begins to execute one of the jobs from memory.
• Once this job needs an I/O operation operating system switches to another job (CPU and OS
always busy).
• Jobs in the memory are always less than the number of jobs on disk(Job Pool).
• If several jobs are ready to run at the same time, then the system chooses which one to run
through the process of CPU Scheduling.
• In Non-multi programmed system, there are moments when CPU sits idle and does not do any
work.
• In Multiprogramming system, CPU will never be idle and keeps on processing.
Time Sharing Systems are very similar to Multiprogramming batch systems. In fact time sharing
systems are an extension of multiprogramming systems.
In Time sharing systems the prime focus is on minimizing the response time, while in
multiprogramming the prime focus is to maximize the CPU usage.
Multiprocessor Systems
A Multiprocessor system consists of several processors that share a common physical memory.
Multiprocessor system provides higher computing power and speed. In multiprocessor system all
processors operate under single operating system. Multiplicity of the processors and how they do act
together are transparent to the others.
1. Enhanced performance
2. Execution of several tasks by different processors concurrently, increases the system's throughput
without speeding up the execution of a single task.
3. If possible, system divides task into many subtasks and then these subtasks can be executed in
parallel in different processors. Thereby speeding up the execution of single tasks.
Desktop Systems
Earlier, CPUs and PCs lacked the features needed to protect an operating system from user programs.
PC operating systems therefore were neither multiuser nor multitasking. However, the goals of
these operating systems have changed with time; instead of maximizing CPU and peripheral
utilization, the systems opt for maximizing user convenience and responsiveness. These systems are
called Desktop Systems and include PCs running Microsoft Windows and the Apple Macintosh.
Operating systems for these computers have benefited in several ways from the development of
operating systems for mainframes.
Microcomputers were immediately able to adopt some of the technology developed for larger
operating systems. On the other hand, the hardware costs for microcomputers are
sufficiently low that individuals have sole use of the computer, and CPU utilization is no longer a
prime concern. Thus, some of the design decisions made in operating systems for mainframes may
not be appropriate for smaller systems.
1. As there are multiple systems involved, user at one site can utilize the resources of systems at
other sites for resource-intensive tasks.
2. Fast processing.
3. Less load on the Host Machine.
1. Client-Server Systems
2. Peer-to-Peer Systems
Client-Server Systems
Centralized systems today act as server systems to satisfy requests generated by client systems.
The general structure of a client-server system is depicted in the figure below:
Server Systems can be broadly categorized as: Compute Servers and File Servers.
• Compute Server systems, provide an interface to which clients can send requests to perform an
action, in response to which they execute the action and send back results to the client.
• File Server systems, provide a file-system interface where clients can create, update, read, and
delete files.
Peer-to-Peer Systems
The growth of computer networks - especially the Internet and World Wide Web (WWW) – has had
a profound influence on the recent development of operating systems. When PCs were introduced in
the 1970s, they were designed for personal use and were generally considered standalone computers.
With the beginning of widespread public use of the Internet in the 1990s for electronic mail and FTP,
many PCs became connected to computer networks.
In contrast to the Tightly Coupled systems, the computer networks used in these applications consist
of a collection of processors that do not share memory or a clock. Instead, each processor has its own
local memory. The processors communicate with one another through various communication lines,
such as high-speed buses or telephone lines. These systems are usually referred to as loosely coupled
systems ( or distributed systems). The general structure of a client-server system is depicted in the
figure below:
Clustered Systems
• Like parallel systems, clustered systems gather together multiple CPUs to accomplish
computational work.
• Clustered systems differ from parallel systems, however, in that they are composed of two or
more individual systems coupled together.
• The definition of the term clustered is not concrete; the general accepted definition is that
clustered computers share storage and are closely linked via LAN networking.
• Clustering is usually performed to provide high availability.
• A layer of cluster software runs on the cluster nodes. Each node can monitor one or more of the
others. If the monitored machine fails, the monitoring machine can take ownership of its storage,
and restart the application(s) that were running on the failed machine. The failed machine can
remain down, but the users and clients of the application would only see a brief interruption of
service.
• Asymmetric Clustering - In this, one machine is in hot standby mode while the other is running
the applications. The hot standby host (machine) does nothing but monitor the active server. If
that server fails, the hot standby host becomes the active server.
• Symmetric Clustering - In this, two or more hosts are running applications, and they are
monitoring each other. This mode is obviously more efficient, as it uses all of the available
hardware.
• Parallel Clustering - Parallel clusters allow multiple hosts to access the same data on the shared
storage. Because most operating systems lack support for this simultaneous data access by
multiple hosts, parallel clusters are usually accomplished by special versions of software and
special releases of applications.
Clustered technology is rapidly changing. Clustered system's usage and it's features should expand
greatly as Storage Area Networks(SANs). SANs allow easy attachment of multiple hosts to
multiple storage units. Current clusters are usually limited to two or four hosts due to the complexity
of connecting the hosts to shared storage.
Handheld Systems
Handheld systems include Personal Digital Assistants(PDAs), such as Palm-Pilots or Cellular
Telephones with connectivity to a network such as the Internet. They are usually of limited size due
to which most handheld devices have a small amount of memory, include slow processors, and
feature small display screens.
• Many handheld devices have between 512 KB and 8 MB of memory. As a result, the operating
system and applications must manage memory efficiently. This includes returning all allocated
memory back to the memory manager once the memory is no longer being used.
• Currently, many handheld devices do not use virtual memory techniques, thus forcing program
developers to work within the confines of limited physical memory.
• Processors for most handheld devices often run at a fraction of the speed of a processor in a PC.
Faster processors require more power. To include a faster processor in a handheld device would
require a larger battery that would have to be replaced more frequently.
• The last issue confronting program designers for handheld devices is the small display screens
typically available. One approach for displaying the content in web pages is web clipping, where
only a small subset of a web page is delivered and displayed on the handheld device.
Some handheld devices may use wireless technology such as Blue Tooth, allowing remote access to
e-mail and web browsing. Cellular telephones with connectivity to the Internet fall into this
category. Their use continues to expand as network connections become more available and other
options such as cameras and MP3 players, expand their utility.
Architecture of OS
The core software components of an operating system are collectively known as the kernel. The
kernel has unrestricted access to all of the resources on the system. In early monolithic systems, each
component of the operating system was contained within the kernel, could communicate directly
with any other component.
A monolithic OS architecture
In this kind of architecture, each layer communicates only with the layers immediately above and
below it, and lower-level layers provide services to higher-level ones using an interface that hides
their implementation.
The modularity of layered operating systems allows the implementation of each layer to be modified
without requiring any modification to adjacent layers. Many of today’s operating systems, including
Microsoft Windows and Linux, implement some level of layering.
A layered OS architecture
A microkernel architecture includes only a very small number of services within the kernel in an
attempt to keep it small and scalable. It include low-level memory management, inter-process
communication and basic process synchronisation to enable processes to cooperate.
A Microkernel architecture
PCA20C102J OPERATING SYSTEM UNIT-1 Page 14 of 56
OPERATING SYSTEM[Type the document title]
An operating system is a construct that allows the user application programs to interact with the system
hardware. Operating system by itself does not provide any function but it provides an atmosphere in
which different applications and programs can do useful work.
The major operations of the operating system are process management, memory management, device
management and file management. These are given in detail as follows:
Process Management
The operating system is responsible for managing the processes i.e assigning the processor to a process
at a time. This is known as process scheduling. The different algorithms used for process scheduling
are FCFS (first come first served), SJF (shortest job first), priority scheduling, round robin scheduling
etc.
There are many scheduling queues that are used to handle processes in process management. When
the processes enter the system, they are put into the job queue. The processes that are ready to execute
in the main memory are kept in the ready queue. The processes that are waiting for the I/O device are
kept in the device queue.
Memory Management
Memory management plays an important part in operating system. It deals with memory and the
moving of processes from disk to primary memory for execution and back again.
The activities performed by the operating system for memory management are:
• The operating system assigns memory to the processes as required. This can be done using
best fit, first fit and worst fit algorithms.
• All the memory is tracked by the operating system i.e. it nodes what memory parts are in use
by the processes and which are empty.
• The operating system deallocated memory from processes as required. This may happen
when a process has been terminated or if it no longer needs the memory.
• Device Management
• There are many I/O devices handled by the operating system such as mouse, keyboard, disk
drive etc. There are different device drivers that can be connected to the operating system to
handle a specific device. The device controller is an interface between the device and the device
driver. The user applications can access all the I/O devices using the device drivers, which are
device specific codes.
File Management
Files are used to provide a uniform view of data storage by the operating system. All the files are
mapped onto physical devices that are usually non volatile so data is safe in the case of system failure.
The files can be accessed by the system in two ways i.e. sequential access and direct access:
• Sequential Access
The information in a file is processed in order using sequential access. The files records are
accessed on after another. Most of the file systems such as editors, compilers etc. use sequential
access.
• Direct Access
In direct access or relative access, the files can be accessed in random for read and write
operations. The direct access model is based on the disk model of a file, since it allows random
accesses.
Operating System - Services
An Operating System provides services to both the users and to the programs.
• 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 −
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
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 −
• 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 −
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 −
System Calls
PCA20C102J OPERATING SYSTEM UNIT-1 Page 18 of 56
OPERATING SYSTEM[Type the document title]
• System calls provide an interface to the services made available by an operating system. These
calls are generally available as routines written in C and C++, although certain low-level tasks
(for example, tasks where hardware must be accessed directly), may need to be written using
assembly-language instructions.
The API then makes the appropriate system calls through the system call interface, using a table
lookup to access specific numbered system calls, as shown in Figure :
Figure - The handling of a user application invoking the open( ) system call
• Parameters are generally passed to system calls via registers, or less commonly, by values
pushed onto the stack. Large blocks of data are generally accessed indirectly, through a
memory address passed in a register or on the stack, as shown in Figure 2.7:
Six major categories, as outlined in Figure 2.8 and the following six subsections:
• Standard library calls may also generate system calls, as shown here:
Process Control
•
Process control system calls include end, abort, load, execute, create process,
terminate process, get/set process attributes, wait for time or event, signal event, and
allocate and free memory.
PCA20C102J OPERATING SYSTEM UNIT-1 Page 23 of 56
OPERATING SYSTEM[Type the document title]
File Management
• File management system calls include create file, delete file, open, close, read, write,
reposition, get file attributes, and set file attributes.
• These operations may also be supported for directories as well as ordinary files.
• ( The actual directory structure may be implemented using ordinary files on the file
system, or through other means. Further details will be covered in chapters 11 and 12.
)
Device Management
• Device management system calls include request device, release device, read, write,
reposition, get/set device attributes, and logically attach or detach devices.
• Devices may be physical ( e.g. disk drives ), or virtual / abstract ( e.g. files, partitions,
and RAM disks ).
• Some systems represent devices as special files in the file system, so that accessing
the "file" calls upon the appropriate device drivers in the OS. See for example the /dev
directory on any UNIX system.
Information Maintenance
•Information maintenance system calls include calls to get/set the time, date, system
data, and process, file, or device attributes.
• Systems may also provide the ability to dump memory at any time, single step
programs pausing execution after each instruction, and tracing the operation of
programs, all of which can help to debug programs.
PCA20C102J OPERATING SYSTEM UNIT-1 Page 25 of 56
OPERATING SYSTEM[Type the document title]
Communication
Protection
• Protection provides mechanisms for controlling which users / processes have access to
which system resources.
• System calls allow the access mechanisms to be adjusted as needed, and for non-
priveleged users to be granted elevated access permissions under carefully controlled
temporary circumstances.
• Once only of concern on multi-user systems, protection is now important on all
systems, in the age of ubiquitous network connectivity.
System Programs
• System programs provide OS functionality through separate applications, which are not part
of the kernel or command interpreters. They are also known as system utilities or system
applications.
• Most systems also ship with useful applications such as calculators and simple editors, ( e.g.
Notepad ). Some debate arises as to the border between system and non-system applications.
• System programs may be divided into these categories:
o File management - programs to create, delete, copy, rename, print, list, and generally
manipulate files and directories.
o Status information - Utilities to check on the date, time, number of users, processes
running, data logging, etc. System registries are used to store and recall configuration
information for particular applications.
o File modification - e.g. text editors and other tools which can change file contents.
o Programming-language support - E.g. Compilers, linkers, debuggers, profilers,
assemblers, library archive management, interpreters for common languages, and
support for make.
o Program loading and execution - loaders, dynamic loaders, overlay loaders, etc., as
well as interactive debuggers.
o Communications - Programs for providing connectivity between processes and users,
including mail, web browsers, remote logins, file transfers, and remote command
execution.
o Background services - System daemons are commonly started when the system is
booted, and run for as long as the system is running, handling necessary services.
Examples include network daemons, print servers, process schedulers, and system
error monitoring services.
• Most operating systems today also come complete with a set of application programs to
provide additional services, such as copying files or checking the time and date.
• Most users' views of the system is determined by their command interpreter and the
application programs. Most never make system calls, even through the API, ( with the
exception of simple ( file ) I/O in user-written programs. )
Design Goals
• Requirements define properties which the finished system must have, and are a
necessary first step in designing any large complex system.
o User requirements are features that users care about and understand, and are
written in commonly understood vernacular. They generally do not include
any implementation details, and are written similar to the product description
one might find on a sales brochure or the outside of a shrink-wrapped box.
o System requirements are written for the developers, and include more details
about implementation specifics, performance requirements, compatibility
constraints, standards compliance, etc. These requirements serve as a
"contract" between the customer and the developers, ( and between developers
and subcontractors ), and can get quite detailed.
• Requirements for operating systems can vary greatly depending on the planned scope
and usage of the system. ( Single user / multi-user, specialized system / general
purpose, high/low security, performance needs, operating environment, etc. )
Implementation
• Traditionally OS were written in assembly language. This provided direct control over
hardware-related issues, but inextricably tied a particular OS to a particular HW
platform.
• Recent advances in compiler efficiencies mean that most modern OS are written in C,
or more recently, C++. Critical sections of code are still written in assembly language,
( or written in C, compiled to assembly, and then fine-tuned and optimized by hand
from there. )
• Operating systems may be developed using emulators of the target hardware,
particularly if the real hardware is unavailable ( e.g. not built yet ), or not a suitable
platform for development, ( e.g. smart phones, game consoles, or other similar
devices. )
Operating-System Structure
For efficient performance and implementation an OS should be partitioned into separate subsystems,
each with carefully defined tasks, inputs, outputs, and performance characteristics. These subsystems
can then be arranged in various architectural configurations:
Simple Structure
When DOS was originally written its developers had no idea how big and important it would
eventually become. It was written by a few programmers in a relatively short amount of time,
without the benefit of modern software engineering techniques, and then gradually grew over time to
exceed its original expectations. It does not break the system into subsystems, and has no distinction
between user and kernel modes, allowing all programs direct access to the underlying hardware. (
Note that user versus kernel mode was not supported by the 8088 chip set anyway, so that really
wasn't an option back then. )
The original UNIX OS used a simple layered approach, but almost all the OS was in one big layer,
not really breaking the OS down into layered subsystems:
Layered Approach
• Another approach is to break the OS into a number of smaller layers, each of which
rests on the layer below it, and relies solely on the services provided by the next lower
layer.
• This approach allows each layer to be developed and debugged independently, with
the assumption that all lower layers have already been debugged and are trusted to
deliver proper services.
• The problem is deciding what order in which to place the layers, as no layer can call
upon the services of any higher layer, and so many chicken-and-egg situations may
arise.
• Layered approaches can also be less efficient, as a request for service from a higher
layer has to filter through all lower layers before it reaches the HW, possibly with
significant processing at each step.
Microkernels
• The basic idea behind micro kernels is to remove all non-essential services from the
kernel, and implement them as system applications instead, thereby making the kernel
as small and efficient as possible.
• Most micro kernels provide basic process and memory management, and message
passing between other services, and not much more.
• Security and protection can be enhanced, as most services are performed in user
mode, not kernel mode.
• System expansion can also be easier, because it only involves adding more system
applications, not rebuilding a new kernel.
• Mach was the first and most widely known microkernel, and now forms a major
component of Mac OSX.
• Windows NT was originally microkernel, but suffered from performance problems
relative to Windows 95. NT 4.0 improved performance by moving more services into
the kernel, and now XP is back to being more monolithic.
• Another microkernel example is QNX, a real-time OS for embedded systems.
Modules
Hybrid Systems
PCA20C102J OPERATING SYSTEM UNIT-1 Page 31 of 56
OPERATING SYSTEM[Type the document title]
• Most OS today do not strictly adhere to one architecture, but are hybrids of several.
Mac OS X
• The Max OSX architecture relies on the Mach microkernel for basic system
management services, and the BSD kernel for additional services. Application
services and dynamically loadable modules ( kernel extensions ) provide the
rest of the OS functionality:
iOS
• The iOS operating system was developed by Apple for iPhones and iPads. It
runs with less memory and computing power needs than Max OS X, and
supports touch creen interface and graphics for small screens:
Android
PCA20C102J OPERATING SYSTEM UNIT-1 Page 32 of 56
OPERATING SYSTEM[Type the document title]
• The Android OS was developed for Android smartphones and tablets by the
Open Handset Alliance, primarily Google.
• Android is an open-source OS, as opposed to iOS, which has lead to its
popularity.
• Android includes versions of Linux and a Java virtual machine both optimized
for small platforms.
• Android apps are developed using a special Java-for-Android development
environment.
• Debugging here includes both error discovery and elimination and performance tuning.
Failure Analysis
•
Debuggers allow processes to be executed stepwise, and provide for the examination
of variables and expressions as the execution progresses.
• Profilers can document program execution, to produce statistics on how much time
was spent on different sections or even lines of code.
• If an ordinary process crashes, a memory dump of the state of that process's memory
at the time of the crash can be saved to a disk file for later analysis.
o The program must be specially compiled to include debugging information,
which may slow down its performance.
• These approaches don't really work well for OS code, for several reasons:
o The performance hit caused by adding the debugging ( tracing ) code would be
unacceptable. ( Particularly if one tried to "single-step" the OS while people
were trying to use it to get work done! )
PCA20C102J OPERATING SYSTEM UNIT-1 Page 33 of 56
OPERATING SYSTEM[Type the document title]
o Many parts of the OS run in kernel mode, and make direct access to the
hardware.
o If an error occurred during one of the kernel's file-access or direct disk-access
routines, for example, then it would not be practical to try to write a crash
dump into an ordinary file on the file system.
▪ Instead the kernel crash dump might be saved to a special unallocated
portion of the disk reserved for that purpose.
Performance Tuning
***********************************************************
1. Booting
Booting is a process of starting the computer operating system starts the computer to work. It checks the
computer and makes it ready to work.
2. Memory Management
It is also an important function of operating system. The memory cannot be managed without operating
system. Different programs and data execute in memory at one time.
4. Data Security
Data is an important part of computer system. The operating system protects the data stored on the
computer from illegal use, modification or deletion.
5. Disk Management
Operating system manages the disk space. It manages the stored files and folders in a proper way.
6. Process Management
CPU can perform one task at one time. If there are many tasks, operating system decides which task
should get the CPU.
7. Device Controlling
Operating system also controls all devices attached to computer. The hardware devices are controlled with
the help of small software called device drivers.
PCA20C102J OPERATING SYSTEM UNIT-1 Page 35 of 56
OPERATING SYSTEM[Type the document title]
8. Printing Controlling
Operating system also controls printing function. It a user issues two print commands at a time, it does not
mix data of these files and prints them separately.
9. Providing Interface
It is used in order that user interface acts with a computer mutually. User interface controls how you input
data and instruction and how information is displayed on screen.
• 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.
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.
Error handling
Errors can occur anytime and anywhere. An error may occur in CPU, in I/O devices or in the
memory hardware.
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.
Protection
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.
Layered Approach
• OS into a number of smaller layers, each of which rests on the layer below it, and
relies solely on the services provided by the next lower layer.
• This approach allows each layer to be developed and debugged independently, with
the assumption that all lower layers have already been debugged and are trusted to
deliver proper services.
• The problem is deciding what order in which to place the layers, as no layer can call
upon the services of any higher layer, and so many chicken-and-egg situations may
arise.
• Layered approaches can also be less efficient, as a request for service from a higher
layer has to filter through all lower layers before it reaches the HW, possibly with
significant processing at each step.
7. What are the two types of distributed operating systems ?explain them
A)Client-Server Systems
B)Peer-to-Peer Systems
Client-Server Systems
Centralized systems today act as server systems to satisfy requests generated by client systems.
The general structure of a client-server system is depicted in the figure below:
Server Systems can be broadly categorized as: Compute Servers and File Servers.
• Compute Server systems, provide an interface to which clients can send requests to perform an
action, in response to which they execute the action and send back results to the client.
• File Server systems, provide a file-system interface where clients can create, update, read, and
delete files.
Peer-to-Peer Systems
Tightly Coupled systems, the computer networks used in these applications consist of a collection of
processors that do not share memory or a clock. Instead, each processor has its own local memory.
The processors communicate with one another through various communication lines, such as high-
speed buses or telephone lines. These systems are usually referred to as loosely coupled systems ( or
distributed systems). The general structure of a client-server system is depicted in the figure below:
Multiprocessor Systems
A Multiprocessor system consists of several processors that share a common physical memory.
Multiprocessor system provides higher computing power and speed. In multiprocessor system all
processors operate under single operating system. Multiplicity of the processors and how they do act
together are transparent to the others.
1. Enhanced performance
2. Execution of several tasks by different processors concurrently, increases the system's throughput
without speeding up the execution of a single task.
3. If possible, system divides task into many subtasks and then these subtasks can be executed in
parallel in different processors. Thereby speeding up the execution of single tasks.
Multiprogramming: operating system picks up and begins to execute one of the jobs from
memory.
• Once this job needs an I/O operation operating system switches to another job (CPU and OS
always busy).
• Jobs in the memory are always less than the number of jobs on disk(Job Pool).
If several jobs are ready to run at the same time, then the system chooses which one to run
through the process of CPU Scheduling.
Multiprocessing:
A Multiprocessor system consists of several processors that share a common physical memory.
Multiprocessor system provides higher computing power and speed. In multiprocessor system all
processors operate under single operating system. Multiplicity of the processors and how they do act
together are transparent to the others.
File Allocation, Allocation of Memory, I/O Controlling, Maintaining the File system, Library
segments ,etc.,
Control program – controls the execution of user programs and prvent errors, improper use of
computer operations of I/O devices.
The development of Microsoft and the Windows operating system was a significant influence
in the creation of personal computers. In 1975, Microsoft developed the first Windows
operating system. Bill Gates and Paul Allen had the idea to advance personal computers after
releasing the Microsoft Windows OS. As a result, the MS-DOS was released in 1981, but users
found it extremely challenging to decipher its complex commands. Windows is now the most
widely used and well-liked operating system available. Following then, Windows released a
number of operating systems, including Windows 95, Windows 98, Windows XP, and
Windows 7, the most recent operating system. The majority of Windows users are currently
running Windows 10. Apple is another well-known operating system in addition to Windows
The developing of OS may depend upon the hardware design and its implementation.
• In this type of system, there is no direct interaction between user and the computer.
• The user has to submit a job (written on cards or tape) to a computer operator.
• Then computer operator places a batch of several jobs on an input device.
• Jobs are batched together by type of languages and requirement.
• Then a special program, the monitor, manages the execution of each program in the batch.
• The monitor is always in the main memory and available for execution.
• In this the operating system picks up and begins to execute one of the jobs from memory.
• Once this job needs an I/O operation operating system switches to another job (CPU and OS
always busy).
• Jobs in the memory are always less than the number of jobs on disk(Job Pool).
• If several jobs are ready to run at the same time, then the system chooses which one to run
through the process of CPU Scheduling.
• In Non-multi programmed system, there are moments when CPU sits idle and does not do any
work.
• Time Sharing Systems are very similar to Multiprogramming batch systems. In fact time
sharing systems are an extension of multiprogramming systems.
• In Time sharing systems the prime focus is on minimizing the response time, while in
multiprogramming the prime focus is to maximize the CPU usage.
Multiprocessor Systems
A Multiprocessor system consists of several processors that share a common physical memory.
Multiprocessor system provides higher computing power and speed. In multiprocessor system all
processors operate under single operating system. Multiplicity of the processors and how they do
act together are transparent to the others.
Desktop Systems
Earlier, CPUs and PCs lacked the features needed to protect an operating system from user
programs. PC operating systems therefore were neither multiuser nor multitasking. However,
the goals of these operating systems have changed with time; instead of maximizing CPU and
peripheral utilization, the systems opt for maximizing user convenience and responsiveness.
These systems are called Desktop Systems .
1. Client-Server Systems
2. Peer-to-Peer Systems
Client-Server Systems
Centralized systems today act as server systems to satisfy requests generated by client systems.
Peer-to-Peer Systems
The growth of computer networks - especially the Internet and World Wide Web (WWW) – has
had a profound influence on the recent development of operating systems
Clustered Systems
Parallel Clustering - Parallel clusters allow multiple hosts to access the same data on the shared
storage. Because most operating systems lack support for this simultaneous data access by
multiple hosts, parallel clusters are usually accomplished by special versions of software and
special releases of applications.
It is defined as an operating system known to give maximum time for each of the critical operations
that it performs, like OS calls and interrupt handling.
The Real-Time Operating system which guarantees the maximum time for critical operations and
complete them on time are referred to as Hard Real-Time Operating Systems.
While the real-time operating systems that can only guarantee a maximum of the time, i.e. the critical
task will get priority over other tasks, but no assurity of completeing it in a defined time. These
systems are referred to as Soft Real-Time Operating Systems.
Handheld Systems
Handheld systems include Personal Digital Assistants(PDAs), such as Palm-Pilots or Cellular
Telephones with connectivity to a network such as the Internet. They are usually of limited size due
to which most handheld devices have a small amount of memory, include slow processors, and
feature small display screens.
2. Explain the Architecture of OS.
Architecture of OS
The core software components of an operating system are collectively known as the kernel. The
kernel has unrestricted access to all of the resources on the system. In early monolithic systems, each
component of the operating system was contained within the kernel, could communicate directly
with any other component.
A monolithic OS architecture
In this kind of architecture, each layer communicates only with the layers immediately above and
below it, and lower-level layers provide services to higher-level ones using an interface that hides
their implementation.
Many of today’s operating systems, including Microsoft Windows and Linux, implement some level
of layering.
A layered OS architecture
A microkernel architecture includes only a very small number of services within the kernel in an
attempt to keep it small and scalable. It include low-level memory management, inter-process
communication and basic process synchronisation to enable processes to cooperate.
A Microkernel architecture
An operating system is a construct that allows the user application programs to interact with the system
hardware. Operating system by itself does not provide any function but it provides an atmosphere in
which different applications and programs can do useful work.
The major operations of the operating system are process management, memory management, device
management and file management. These are given in detail as follows:
Process Management
The operating system is responsible for managing the processes i.e assigning the processor to a process
at a time. This is known as process scheduling. The different algorithms used for process scheduling
are FCFS (first come first served), SJF (shortest job first), priority scheduling, round robin scheduling
etc.
There are many scheduling queues that are used to handle processes in process management. When
the processes enter the system, they are put into the job queue. The processes that are ready to execute
in the main memory are kept in the ready queue. The processes that are waiting for the I/O device are
kept in the device queue.
Memory Management
Memory management plays an important part in operating system. It deals with memory and the
moving of processes from disk to primary memory for execution and back again.
The activities performed by the operating system for memory management are:
• The operating system assigns memory to the processes as required. This can be done using
best fit, first fit and worst fit algorithms.
• All the memory is tracked by the operating system i.e. it nodes what memory parts are in use
by the processes and which are empty.
• The operating system deallocated memory from processes as required. This may happen
when a process has been terminated or if it no longer needs the memory.
• Device Management
• There are many I/O devices handled by the operating system such as mouse, keyboard, disk
drive etc. There are different device drivers that can be connected to the operating system to
handle a specific device. The device controller is an interface between the device and the device
driver. The user applications can access all the I/O devices using the device drivers, which are
device specific codes.
File Management
Files are used to provide a uniform view of data storage by the operating system. All the files are
mapped onto physical devices that are usually non volatile so data is safe in the case of system failure.
The files can be accessed by the system in two ways i.e. sequential access and direct access:
• Sequential Access
The information in a file is processed in order using sequential access. The files records are
accessed on after another. Most of the file systems such as editors, compilers etc. use sequential
access.
• Direct Access
In direct access or relative access, the files can be accessed in random for read and write
operations. The direct access model is based on the disk model of a file, since it allows random
accesses.
• 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 −
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
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 −
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 −
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 −
System Calls
• System calls provide an interface to the services made available by an operating system. These
calls are generally available as routines written in C and C++, although certain low-level tasks
(for example, tasks where hardware must be accessed directly), may need to be written using
assembly-language instructions.
The API then makes the appropriate system calls through the system call interface, using a table
lookup to access specific numbered system calls, as shown in Figure 2.6:
Figure - The handling of a user application invoking the open( ) system call
• Parameters are generally passed to system calls via registers, or less commonly, by values
pushed onto the stack.
Large blocks of data are generally accessed indirectly, through a memory address passed in a
register or on the stack, as shown in Figure :