You are on page 1of 103

OPERATING SYSTEMS

Subject Code:20A05402T

• UNIT - I Operating Systems Overview, System


Structures
• Operating Systems Overview: Introduction, Operating
system functions, Operating systems operations, Computing
environments, Open-Source Operating Systems
• System Structures: Operating System Services, User and
Operating-System Interface, systems calls, Types of System
Calls, system programs, Operating system Design and
Implementation, Operating system structure, Operating system
debugging, System Boot.
• 1.What is Operating System.
• 2.Layers of Operating(Computer) System.
• 3.Operating systems-Available in Market
• 4.User's View of the computer
• 5.System's view of the computer
• 6.Kernal, System Program, Application program
and Middleware
• https://www.cs.odu.edu/~price/cs471/
public_html/spring17/lectures/introduction.htm
1.What is Operating System.
• Operating system acts as an interface between
the user and computer hardware.
• OS provides an environment for executing
user application programs and makes it easier
for the user.
• The purpose of the operating system is to
control computer hardware and set up
programs for the user.
2.Layers of Operating(Computer) System.
Layer
• The four layers of computer system are
• 1.Hardware: provides basic computing resources of the
system(CPU,memory,I/O devices)
• 2.Operating System: -controls and coordinates the use of
hardware among the various application programs for the
various users.
• 3.Application program:define the ways in which the
system resources are used to solve the computing problems
of the users(compilers, database system, video games,
business programs).
• 4.Users:--(people, machines, other computers).
Operating Systems- Available in Market:

• OS is classified by Technology, ownership,


licensing, working state, usage and many
other categories.
Operating System

• User View
• System View
User's view of the computer
• Many users having laptop or a PC consisting of a monitor,
keyboard and mouse.
• Such a systems are designed for
single user
• The goal is to maximize the work that the user is
performing
• In this case, the OS is designed mostly for ease of use(user
friendly), with some attention paid to performance and
security and note paid to resource utilization-How various
hardware and software resources are shared.
Mobile Devices

• many users interact with mobile devices such as smartphones and


tablets.
• These devices are typically connected
to networks through cellular or other wireless
technologies.
• The mobile computers generally features a
touch screen, where the user interacts with the
system by pressing and swiping fingers across the
screen rather than the using a physical keyboard
and mouse.
• Many mobile devices allow users to interact through a voice
recognition interface.
From the Computer's Point of View

• From computer's point of view the OS will act as


• Resource allocator
Resource controller
Resource manager
• A computer system has many resources that may be required
to solve a problem: CPU, memory, storage, I/O devices, and so
on.
• The OS must decide how to allocate resources to specific
programs and users, os that is can operate the computer
system efficiently and fairly.
• The OS is the program(Software), acts as Resource allocator.
• OS also need to control the various I/O devices
and user programs, to avoid conflicts in
resource request.
• Hence OS acts as a Resource controller.
• A control program manages the operation and
control of I/O devices and execution of user
programs to prevent errors and improper use
of the computer.
• The OS acts as a Resource manager.
Kernel, System Program, Application Program
and Middleware
• Kernel is central and core component of an
operating system that manages operations of
computer and hardware(CPU,Memory).
• Kernel acts as a bridge between applications
and hardware
System software
• System software is designed to run a
computer hardware and application programs.
• These programs are associated with the
operating system but are not part of the
kernel.
Middleware software
• Middleware is a type of computer software
that sits between the application layer and
operating system layer.
• Middleware provides services to software
applications beyond those available from the
operating system.
Operating systems operations
• Computer System Organization,
• Common Functions of Interrupts
• Interrupt Handling,
• Interrupt Timeline
• I/O Structure
• DMA Structure
• Storage Structure
• Storage Hierarchy
• Storage Device Hierarchy
Computer system organization
One or more CPU's
device controllers
connect through Hardw
common bus
providing access to
Devic
shared memory.
Concurrent execution
of CPUs and devices
competing for
memory cycles.
Common System Operations
• I/O devices and the CPU can execute concurrently.
• Each device controller is in charge of a particular device type.
• Each device controller has a local buffer
• Each device controller type has an operating system device driver to
manage it
• CPU moves data from/to main memory to/from local buffers
• I/O is from the device to local buffer of controller
• Device controller inform CPU that it has finished its operation by causing
an interrupt.
Common Functions of Interrupts

• Interrupt transfers control to the interrupt service


routine generally, through the interrupt vector.
• Interrupt vector contains the addresses of all the
service routines
• Interrupt architecture must save the address of the
interrupted instruction
• A trap or exception is a software-generated
interrupt caused either by an error or a user request
• An operating system is interrupt driven system.
Interrupts Handling
• The operating system preserves the state of the
CPU by storing registers and the program counter
• OS Determines which type of interrupt has
occurred:
• Polling, Priority handling
• Vectored interrupt system
• Separate segments of code, determine what
action should be taken for each type of interrupt.
Interrupt Timeline
I/O Structure

• After I/O starts, control returns to user program only upon I/O completion
• Wait instruction, idles the CPU, until the next interrupt
Wait loop (contention for memory access).
• At most one I/O request is outstanding at a time, no simultaneous I/O processing
• After I/O starts, control returns to user program without waiting for I/O completion.
• System call-request to the OS to allow user to wait for I/O completion.
• Device-status table contains entry for each I/O device indicating its type, address and state.
• OS indexes into I/O device table, to determine device status and to modify table entry to
include interrupt.
Direct Memory Access Structure
· Used for high-speed I/O devices to transmit
information at close to memory speeds
· Device controller transfers blocks from
buffers directly to main memory without CPU
intervention
· Only one interrupt is generated per block,
rather than one interrupt per byte
DMA Structure continue
Storage Structure
• Main memory – only large storage media that the CPU
can access directly.
• Secondary storage – extension of main memory that
provides large nonvolatile storage capacity.
• Magnetic disks – rigid metal or glass platters covered
with magnetic recording material
• ✦ Disk surface is logically divided into tracks, which
are subdivided into sectors.
• ✦ The disk controller determines the logical
interaction between the device and the computer
Storage Hierarchy
• Storage systems organized in hierarchy.
• ✦ Speed
• ✦ Cost
• ✦ Volatility
• Caching – copying information into faster storage system; main
memory can be viewed as a last cache for
• secondary storage.
• • Use of high-speed memory to hold recently-accessed data.
• • Requires a cache management policy.
• • Caching introduces another level in storage hierarchy.
• • This requires data that is simultaneously stored in more than one
level to be consistent
Storage-Device Hierarchy
Computing Environments:
• Client-Server Computing
– Many systems now servers, responding to
requests generated by clients
– • Compute server provides an interface to client
to request services(i.e., database)
– • File-server provides interface for clients to store
and retrieve files(Files)
Free and Open Source Operating System

• Open Source and Closed Source OS


• Benefits of Open source Operating System.
• Linux
• Unix
• Solaris
Open Source Operating Systems
• Open Source Operating Systems are those available in
source-code format rather than as compile binary code.
– Linux is the most famous open source operating system,
– while Microsoft windows is a well-know example of the
opposite closed-source approach.
– Apple's Mac OS X and iOS operating system comprise a
hybrid approach.
• With the source code of OS, a student can modify the OS
and then compile and run the code to try out those
changes.
• which is an excellent learning tool.
Benefits of Open source Operating System.

• A community of interested programmers who contribute to the


code, by helping to debug it, analyze it, provide support, and
suggest changes.
• Open source code is more secure than closed-source because
many more eyes are viewing the code
• open-source code has bugs, but that can be found and fixed
faster
• Companies that earn revenue from selling their programs often
hesitate to open source their code,
• Red Hat and a myriad
• Revenue can be generated through support, contracts and the
sale of hardware on which the software runs.
Linux
• An open source operating system, consider
GNU/Linux.
• produced many UNIX-compatible tools, including
compilers, editors, and utilities, but never released
a kernel.
• Anyone interested could download the source
code, modify it, and submit the changes.
• Releasing updates once a week, hence Linux
operating system to grow rapidly, and enhanced by
several thousand programmers.
Run Linux on a Windows System
• You can run Linux on a windows system using the following
simple, free approach:
• 1. Download the free "VMwarePlayer" tool from
• http://www.vmware.com/downlaod/player/
• and install it on your system.
• 2. Choose a Linux version from among the hundreds of
"appliances", or virtual machine images, available from VMware
at
• http://www.vmware.com/appliances/
• These images are preinstalled with operating systems and
applications and include many flavors of Linux.
• 3.Boot the virtual machine within VM ware Player
BDS UNIX
• Unix is a stable, multitasking, multi user computer OS for
Servers, desktops and laptops, developed in AT&T laboratory in
the year 1971.
• Unix systems also have a graphical user interface similar to
Microsoft Windows which provides an easy to use environment.
• The most popular variants of UNIX are Sun Solaris, GNU/Linux
and MaxOS X.
• The UNIX operating system is made up of three parts:
• the kernel,
• the shell and
• the programs
Solaris
• Solaris is a Unix based operating system that
was developed by Sun Microsystems and then
purchased by Oracle, it is known as Oracle
Solaris.
• It is known for its scalability and its innovative
features such as DTrace, ZFS, Time Slider etc.
• Solaris is a microkernel design.
• The source code is available at
• http://src.opensolaris.org/source.
• Part-II
• System Structures: Operating System Services,
User and Operating-System Interface, systems
calls, Types of System Calls, system programs,
Operating system Design and Implementation,
Operating system structure, Operating system
debugging, System Boot.
Operating System Services
• Following are the five services provided by operating systems to the convenience of the users.
• 1. Program Execution: The purpose of computer systems is to allow the user to execute
programs. So the operating system provides an environment where the user can conveniently
run programs. Running a program involves the allocating and deallocating memory, CPU
scheduling in case of multiprocessing.
• 2. I/O Operations Each program requires an input and produces output. This involves the use
of I/O. So the operating systems are providing I/O makes it convenient for the users to run
programs.
• 3. File System Manipulation The output of a program may need to be written into new files or
input taken from some files. The operating system provides this service.
• 4. Communications The processes need to communicate with each other to exchange
information during execution. It may be between processes running on the same computer or
running on the different computers. Communications can be occur in two ways: (i) shared
memory or (ii) message passing
• 5. Error Detection An error is one part of the system may cause malfunctioning of the
complete system. To avoid such a situation operating system constantly monitors the system
for detecting the errors. This relieves the user of the worry of errors propagating to various
part of the system and causing malfunctioning.
• Following are the three services provided by operating systems for ensuring the
efficient operation of the system itself.
• 1. Resource allocation When multiple users are logged on the system or multiple
jobs are running at the same time, resources must be allocated to each of them.
Many different types of resources are managed by the operating system.
• 2. Accounting The operating systems keep track of which users use how many and
which kinds of computer resources. This record keeping may be used for
accounting (so that users can be billed) or simply for accumulating usage statistics.
• 3. Protection When several disjointed processes execute concurrently, it should
not be possible for one process to interfere with the others, or with the operating
system itself. Protection involves ensuring that all access to system resources is
controlled. Security of the system from outsiders is also important. Such security
starts with each user having to authenticate him to the system, usually by means
of a password, to be allowed access to the resources.
Operating System overview, System Structures:

• User and Operating-System Interface


• 1. Command-line interface(CUI)
• 2. Graphical user interface(GUI)
• 3. Touchscreen Interface
User and Operating-System Interface

• There are several ways for users to interface with


the operating system.
• The most fundamental approaches are
• Command-line interface(CLI) or command
interpreter
Communicates the user with console based operating system
• Graphical user interface(GUI)
Communicates the user with graphical based operating system
• Very simple and easy to access system components
Command-line interface(CLI)/Command Interpreter

• It allows the users to directly enter commands to be


performed by the operating system.
• Some operating systems include the command interpreter
in the kernel.
• Windows and UNIX, treat the command interpreter as a
special program.
• Interpreters are knowns as shells.
• Types of shells
– Operating system's inbuilt shells(Bourne shell, C Shell, Bourne-Again
shell, Korn shell)
– User defined shells
– Third party shells(external shells, from other organizations).
• 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.
• These commands can be implemented in two general ways.
Interpreter itself contains the code to execute the command.
Commands through system programs
Interpreter itself contains the code to execute the
command
• E.g. a command to delete a file
• the command interpreter to go to a section of its code
• sets up the parameters and
• makes the appropriate system call.
• since each command requires its own implementing
code.
• Traditionally, UNIX systems have been dominated by
command-line interface.
Commands through system programs
• The command interpreter does not understand the command in any way;
• It uses the command to identify a file to be loaded into memory and executed.
• Thus, the UNIX command to delete a file
• rm file.txt
would search for a file called rm.
load the file into memory and
execute it with the parameter file.txt
• The function associated with the rm command would be defined completely by the
code in the file rm.

• programmers can add new commands to the system easily by creating new files with
the proper names.

• The command-interpreter program, which can be small, does not have to be changed
for new commands to be added.
Unix Command Interpreter
Windows Command Interpreter
Graphical User Interfaces
• A user friendly graphical user interface, or GUI.
• users employ a mouse-based window and menu system
characterized by a desktop.
• The user moves the mouse to position its pointer on images, or
icons, on the screen(the desktop)
• The icons represent programs, files, directories, and system
functions.
• Depending on the mouse pointer's location, clicking a button on the
mouse can invoke a program, select a file or directory-known as a
folder- or pull down a menu that contains commands.
Windows-Graphical User Interface
Touchscreen Interface
• GUI has several enhancements in its functionality.
• Because a mouse is impractical for most mobile systems,
smartphones and handheld tablet computers typically
use a touchscreen interface.
• Here, users interact by making gestures on the
touchscreen for example, pressing and swiping fingers
across the screen.
• The Common Desktop Environment(CDE) implemented
by
• X-Windows systems, commercial versions of UNIX, such
as Solaries and IBM's AIX system.
System Call

• 1.What is System Call?


• 2.System calls-User mode and kernel mode
• 3.Example of how system calls used
• 4.System Call Interface
• 5.Methods used to pass parameters to the
operating system
System Call

• system calls provide an interface to the


services made available to an operating
system.
• These calls are generally available as routines
written in C and C++, to access system
resources.
• For a simple command, the operating systems
execute thousands of system calls per second
System Call

• Kernel mode
• When CPU is in kernel mode, the code being executed can access any
memory address and any hardware resources.
• Hence kernel mode is a very privileged and powerful mode
• if a program crashes in kernel mode, the entire system
will be halted.
• User mode:
• When CPU is in user mode, the programs don't have
direct access to memory and hardware resources.
• In user mode, if any program crashes, only that particular program is
halted.
• The system will be in a safe state.
• Hence, most programs in an OS run in user mode
• System Call…
• When a program in user mode requires access to RAM or a
hardware resource, it must ask the kernel to provide access
to that resource, through system call.
• When a program makes a system call, the mode is switched
from user mode to kernel mode. This is called a context
switch.
• Then the kernel provides the resource which the program
requested.
• After that, another context switch happens to change from
kernel mode to user mode.
System calls Examples-read data from one file
and copy them to another file

• Copy file1.txt file2.txt


• System calls used for this
• Open-input file
• Create-output file
• Error condition,
• Print a message
• Abort system call
• Read-input file
• Write-output file
• Close-i/p, o/p files
• Terminate
System Call Interface
• The system call interface used to link system calls, which are
available in operating system.
• The programming languages provides the run-time support
system
• Run-time support system is a set of built in library functions,
included with a compiler, provides a system call interface,
• Each system call having its unique number(ID)
• The system-call interface maintains a table indexed according to
these numbers.
• The system call interface then invokes the intended system call in
the operating system kernel, and returns the status of the system
call and any return values
pass parameters to the operating system
• Three general methods are used to pass parameters to the
operating system.
• 1.The simplest approach is to pass the parameters in registers.
• 2. In some cases, there may be more parameters than
registers, then the parameters are stored in a block, or table,
in memory, and the address of the block is passed as a
parameter in a register.
• 3. Some operating systems prefer the stack method
• Parameters can be placed, or pushed onto the stack by the
program and popped off the stack by the operating system.
• because those approaches do not limit the numbers or length
of parameters being passed.
Types of System Calls

• 1.Process Control
• 2.File Manipulation
• 3.Device Management
• 4.Information Maintenance
• 5.Communications
• 6 Protection
1.Process Control System calls
• create process, terminate process
• load, execute
• end, abort
• get process attributes, set process attributes
• wait for time
• wait event, signal event
• allocate and free memory
2.File management System Calls
• create file, delete file
• open, close
• read, write, reposition
• get file attributes, set file attributes
3.Device management System Calls
• request device, release device
• read, write, reposition
• get device attributes, set device attributes
• logically attach or detach devices
4.Information maintenance System Calls

• 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 System Calls
• create, delete communication connection
• send, receive messages
• transfer status information
• attach or detach remote devices
5. Protection System Calls
• Protection provides a mechanism for
controlling access to the resources provided
by a computer system.
• Protection was a concern only on Multi-
programmed computer systems with several
users.
• get permission(), set permission()
• allow user(), deny user().
System Programs
• 1. What is System Program
• 2. Categories of Complex System Programs
– File management
– Status information
– File modification
– Programming-language support
– Program loading and execution
– Background services
System Programs-Logical Computer
Hierarchy
• The lowest level is hardware.
• Next is the operating system, then the system programs.
• Finally the application programs.

• System programs, also known as


system utilities, provide a
convenient environment for program
development and execution
File Management

• These programs used to


• create, delete, copy rename, print, dump, list,
• and generally manipulate files and directories
Status information

• Some programs simply ask the system for the date,


time, amount of available memory or disk space,
number of users, or similar status information.
• Others are more complex, providing detailed
performance, logging, and debugging information.
• These programs format and print the output to the
terminal or other output devices or files or display it in
a window of the GUI.
• Some systems also support a registry, which is used to
store and retrieve configuration information.
File modification

• Several text editors may be available to create and


• modify the content of files stored on disk or other storage devices.
• There may also be special commands to search contents of files or
perform transformations of the text.
Programming-language support

• Compilers, assemblers, debuggers, and


interpreters for common programming
languages (such as C, C++, Java and PERL)
• These supporting programs are often provided
with the operating system or available as a
separate download.
Program loading and execution

• Once a program is assembled or compiled, it


must be loaded into memory to be executed.
• The system may provide absolute loaders,
relocatable loaders, linkage editors, and
overlay loaders.
• Debugging systems for either higher-level
languages or machine language are needed as
well.
Communications
• These programs provide the mechanism for
creating
• virtual connections among processes, users,
and computer systems.
• They allow users to send messages to one
another’s screens, to browse Web pages, to
send e-mail messages, to log in remotely, or to
transfer files from
• one machine to another.
Background services
• All general-purpose systems have methods for
launching certain system-program processes at
boot time.
• Some of these processes terminate after
completing their tasks,
• while others continue to run until the system is
halted. Constantly running system-program
• processes are known as services, subsystems,
or daemons.
Common System Programs
• Along with system programs, most operating
systems are supplied with programs that are
useful in solving common problems or
performing common operations.
• Such application programs include Web
browsers, word processors and text
formatters, spreadsheets, database systems,
compilers, plotting and statistical-analysis
packages, and games.
Operating-System Design and Implementation

• 1. Design Goals
• 2. Mechanisms and Policies
• 3. Implementation.
Operating System Design and Implementation

• An operating system allows the user application


programs to interact 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.
• Internal structure of different Operating Systems can
vary widely.
Design and Goals-Requirements
• The first define goals and specifications.
• The design of the system will be affected by the choice of hardware
and the type of system
• Batch processing systems
• time sharing systems
• single user systems
• Multiuser systems
• Distributed systems
• real time systems
• General purpose systems
• The requirements can, however, be divided into two basic groups:
user goals and system goals
User & System Goals

• User Goals
• convenient to use
• easy to learn and to use
• reliable,
• safe and fast
• System goals
• easy to design
• create
• implement and
• maintain
• as well as flexible, reliable, error free and efficient
• Specifying and designing as OS, is highly creative task of software
engineering
Requirements of Operating System

• There is no unique solution to the problem of defining the requirements


for an operating system.
• The wide range of systems-different requirements-large variety of
solutions-different environments
• Batch processing system
• time sharing systems
• single user systems
• Multiuser systems
• Distributed systems
• real time systems
• General purpose systems
• Collect the requirements based on the users demand, type of system
and environment
2. Mechanisms and Policies

• Policy: What needs to be done?


• Example: Interrupt after every 100 seconds
• Mechanism: How to do something?
• Example: timer
• One important principle is the separation of policy from
mechanism
• Polices may change over time and this would lead to
changes in mechanism.
• So, it is better to have a general mechanism that would
require few changes even when a policy change occurs.
3. Implementation.

• Once an operating system is designed, it must


be implemented.
• Because operating systems are collections of
many programs,
• written by many people over a long period of
time,
• it is difficult to make general statements above
how the are implemented.
Languages used to implement OS

• Early operating systems were written in assembly language.


• Now, in a higher-level language such as C,C++.
• The lowest levels of the kernel might be assembly language.
• An operating system can be written in more than one language
• Higher-level routines might be in C, and
• System programs might be in C or C++, and scripting languages
like PERL or Python, or in shell scripts.
• Emulators are programs that duplicate the functionality of one
system on another system, hence it allow OS to run on non-
native hardware
• Linux OS programs written in al of those languages
The advantages of using higher-level language

• the code can written faster

• in more compact and

• is easier to understand and debug.

• An operating system is far easier to port- to move to some


other hardware-if it is written in a higher-level language
The advantages of using higher-level language…

• better data structures and algorithms that of


excellent assembly-language code.
• although operating systems are large, only a small
amount of the code is critical to higher performance;
• the interrupt handler, I/O manager, memory
manager, and CPU scheduler are probably the most
critical routines
The only possible disadvantages of
• implementing an operating system in a higher
level language are
• reduced speed and
• increased storage requirements
Operating System Structure

• 1.Simple Structure
• 2.Layered Approach
• 3.Microkernels
• 4.Modules
Operating System Structure

• A large and complex modern operating system must be


engineered carefully, to function properly and be modified easily.
• Partition the large task into small components or modules
• Each of these modules should be a well-defined portion of the
system, with carefully defined inputs, outputs, and functions.
• There are four different structures based on how components are
interconnected into a kernel
• 1.Simple Structure
• 2.Layered Approach
• 3.Microkernels
• 4.Modules
Simple Structure-MS-DOS Layer Structure

• Many operating system do not have well-defined structures.


• This type OS is small, simple and limited system.
• MS-DOS is an example of such system.
• The interfaces and levels of functionality
are not well separated.
• Application programs are able to access
the basic I/O routines to write directly
to the display and disk drives.
• Hence, MS-DOS vulnerable to malicious
programs, causing entire system crashes
when user programs fail.
• MS-DOS was also limited by the hardware.
• The intel 8088 for which it was written,
provides no dual mode and no hardware
protection.
Layered Approach

The operating system is broken into a number of


layers(levels).
The bottom layer(layer0) is the hardware;
the highest(layer N) is the user interface.
The main advantage of the layered approach is
simplicity of construction and debugging and
system verification.
The design and implementation of the system are
simplified.
Each layer hides the existence of certain data
structures, operations, and hardware from highest
level layers.
Layered Approach..,

• The major difficulty with the layered approach


is appropriately defining the various layers.
• Because a layer can use only lower-level
layers,
• careful planning is necessary.
Microkernels

• This method structures the operating system by


removing all nonessential components from the
kernel and implementing them as system programs
and user-level programs.
• The result is a smaller kernel.
• There is a little difficulty here, which services should
remain in the kernel and which should be
implemented in user space.
• Microkernels provide minimal process and memory
management, and communication facility.
Microkernels…,
.
• The main function of the microkernel is to provide communication
between the client program and the various services that are also
running in user space.
• Communication is providing through message passing.
• Advantage
• Extending the operating system easier with out modifying the kernel.
• Portable from one hardware design to another
• more security and reliability, since most services are running as user
rather than kernel-processes.
• If a service fails, the rest of the operating system remains untouched.
• Dis-Adv
• The performance of microkernels can suffer due to increased system-
function overhead
Modules

• The best current methodology loadable kernel modules.


• The kernel has a set of core components and links in
additional services via modules, either at boot time or
during run time.
• The kernel to provide core services while other services
are implemented dynamically, as the kernel is running.
• CPU scheduling and memory management algorithms
directly into the kernel and
• add support for different file systems by way of loadable
modules.
Solaris loadable modules

• Operating system structure is organized around a core


kernel with seven types of loadable kernel modules:
• 1.Scheduling classes
• 2.File systems
• 3.Loadable system calls
• 4.Executable formats
• 5.streams modules
• 6.Miscellanous
• 7.Device and bus drivers
• Operating System Debugging
• Failure Analysis
• Performance Tuning
Operating System Debugging

• Debugging is the activity of finding and fixing


errors in a system, both in hardware and in
software
• Performance problems are considered bugs,
so debugging can also include performance
tuning, which seeks to improve performance
by removing the bottlenecks
Failure Analysis

• If a process fails, most operating systems write


the error information to a log file to alert system
operators or users that the problem occurred.
• The operating system can also take a core
dump- a capture of the memory of the process-
and store it in a file for later analysis.
• Running programs and core dumps can be used
by a debugger, to know about the code and
memory of a process
• Debugging user-level process code is a challenge
• OS kernel debugging is even more complex
because of the size and complexity of the kernel,
its control of the hardware and the lack of user-
level debugging tools.
• A failure in the kernel is called a crash.
• When a crash occurs error information is saved
to a log file, and the memory state is save to a
crash dump.
• Different tools used for OS debugging and process
debugging.
• Kernel failure in the file system code is risky, for the
kernel to try to save its state to a file on the file
system before rebooting.
• If the kernel detects an unrecoverable error, it writes
the entire contents of memory to the disk area.
• When the system reboots, a process runs, to gather
the data from that area and write it ti a crash dump
file within a file system fir analysis.
Performance Tuning

• Performance tuning is to improve performance by removing processing


bottlenecks.
• To identify bottlenecks, we must be able to monitor system
• performance by producing trace listings of system behavior.
• All events are logged with their time and parameters and are written to a
file
• Then, an analysis program can process the log file to determine system
performance and to identify bottlenecks and inefficiencies.
• Traces helps to find errors in OS behavior.
• Single-prupose, interactive tools that allow users and administrators to
question the state of various system compoenents to look for bottlenecks.
• Other tools display the state of disk, I/O, memory allocation and network
traffic
Yo u
a n k
T h

You might also like