2. WHAT IS AN OPERATING SYSTEM?(OS)
An operating system (OS) is a
collection of software that manages
computer hardware resources and
provides common services for
computer programs.
The operating system is a vital
component of the system software
in a computer system. Application
programs usually require an
operating system to function.
4. FUNCTION OF OS
Providing a user interface
Running applications
Support for built in utility
programs.
Control to the computer
hardware
5. COMPONENTS OF OS
• Process Management
• Memory management
• I/O Device management
• Network management
• Network services
• User Interface
6. TYPES OF OS
Single user,
Single Task
Single user,
Multi- tasking
Multi user, Multi-
tasking.
7. SINGLE USER, SINGLE TASK
• As the name implies, this operating
system is designed to manage the
computer so that one user can
effectively do one thing at a time.
The Palm OS for Palm handheld
computers is a good example of a
modern single-user, single-task
operating system
8.
9. SINGLE USER MULTI-TASKING
Single user multi-tasking os allows user to perform one or more than one task at same time
Commonly os are MS windows Apples macintosh
} Microsoft Windows:
Windows is a series of operating
systems developed by Microsoft. Each
version of Windows includes a
graphical user interface, with a desktop
that allows users to view files and
folders in windows. For the past two
decades, Windows has been the most
widely used operating system for
personal computers PCs.
MacOS X:
} OS X is version 10 of the Apple
Macintosh operating system. OS X was
described by Apple as its first
“complete revision” of the
OS since the previous version is OS 9, with
a focus on modularity so that future changes
would be easier to incorporate.
Written in c++ .c .objective -c
10. MULTI USER, MULTI- TASKING.
• Multi-user software is software that
allows access by multiple users of a
computer. Most batch processing
systems for mainframe computers
may also be considered "multi-user",
to avoid leaving the CPU idle while it
waits for I/O operations to complete.
However, the term "multitasking" is
more common in this context.
11. Advantage of OS
• Easy to use
• User friendly
• Intermediate between all
hardware's and software's of the
system
• No need to know any technical
languages
• Its the platform of all programs
Disadvantage of OS
• If any problems affected in
OS, you may lose all the
contents which have been
stored already
• Unwanted user can use your
own system
12. OPERATING SYSTEM FUNCTIONS
Besides managing hardware and software
resources on the system, the OS must manage
resources and memory.
There are two broad tasks to be accomplished.
An operating system is a piece of software that
manages the allocation of computer hardware.
The coordination of the hardware must be
appropriate to ensure the correct working of the
computer system and to prevent user programs
from interfering with the proper working of the
system.
13. OS - MEMORY STORAGE AND MANAGEMENT
Each process must have enough memory in which to
execute, and
It can neither run into the memory space of another
process,
Nor be run into by another process.
Memory management is the process of controlling and
coordinating computer memory, assigning portions
called blocks to various running programs to optimize
overall system performance. Memory
management resides in hardware, in the OS (operating
system), and in programs and applications.
14. 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 −
Loads a program into memory.
Executes the program.
Handles program's execution.
Provides a mechanism for process synchronization.
Provides a mechanism for process communication.
Provides a mechanism for deadlock handling.
15. 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 −
Program needs to read a file or write a file.
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.
16. PROCESS SCHEDULING QUEUES
• Job queue − This queue keeps all
the processes in the system.
• Ready queue − This queue keeps a
set of all processes residing in main
memory, ready and waiting to
execute. A new process is always put
in this queue.
• Device queues − The processes
which are blocked due to
unavailability of an I/O device
constitute this queue.
17. THREAD
A thread is a flow of execution through the process code, with its own program counter that keeps
track of which instruction to execute next, system registers which hold its current working
variables, and a stack which contains the execution history.
A thread shares with its peer threads few information like code segment, data segment and open
files. When one thread alters a code segment memory item, all other threads see that.
A thread is also called a lightweight process. Threads provide a way to improve application
performance through parallelism. Threads represent a software approach to improving performance
of operating system by reducing the overhead thread is equivalent to a classical process.
Each thread belongs to exactly one process and no thread can exist outside a process. Each thread
represents a separate flow of control. Threads have been successfully used in implementing
network servers and web server. They also provide a suitable foundation for parallel execution of
applications on shared memory multiprocessors. The following figure shows the working of a
single-threaded and a multithreaded process.
18.
19. TYPES OF THREAD
• User Level Threads − User managed
threads.
• Kernel Level Threads − Operating
System managed threads acting on
kernel, an operating system core.
20. USER LEVEL THREADS
• In this case, the thread management kernel is not aware of
the existence of threads. The thread library contains code for
creating and destroying threads, for passing message and
data between threads, for scheduling thread execution and
for saving and restoring thread contexts. The application
starts with a single thread.
• Thread switching does not require Kernel mode privileges.
• User level thread can run on any operating system.
• Scheduling can be application specific in the user level
thread.
• User level threads are fast to create and manage.
• In a typical operating system, most system calls are
blocking.
21. KERNEL LEVEL THREADS
• In this case, thread management is done by the Kernel. There is no
thread management code in the application area. Kernel threads are
supported directly by the operating system. Any application can be
programmed to be multithreaded. All of the threads within an
application are supported within a single process.
• The Kernel maintains context information for the process as a whole
and for individuals threads within the process. Scheduling by the
Kernel is done on a thread basis. The Kernel performs thread
creation, scheduling and management in Kernel space. Kernel threads
are generally slower to create and manage than the user threads.
22. MULTITHREADING MODELS
• Some operating system provide a combined user level thread and
Kernel level thread facility. Solaris is a good example of this
combined approach. In a combined system, multiple threads within
the same application can run in parallel on multiple processors and
a blocking system call need not block the entire process.
Multithreading models are three types
1. Many to many relationship.
2. Many to one relationship.
3. One to one relationship.
23. MANY TO MANY MODEL
• The many-to-many model multiplexes any number of
user threads onto an equal or smaller number of
kernel threads.
• The following diagram shows the many-to-many
threading model where 6 user level threads are
multiplexing with 6 kernel level threads. In this
model, developers can create as many user threads
as necessary and the corresponding Kernel threads
can run in parallel on a multiprocessor machine. This
model provides the best accuracy on concurrency
and when a thread performs a blocking system call,
the kernel can schedule another thread for
execution.
24. MANY TO ONE MODEL
• Many-to-one model maps many user level
threads to one Kernel-level thread. Thread
management is done in user space by the
thread library. When thread makes a blocking
system call, the entire process will be blocked.
Only one thread can access the Kernel at a
time, so multiple threads are unable to run in
parallel on multiprocessors.
• If the user-level thread libraries are
implemented in the operating system in such a
way that the system does not support them,
then the Kernel threads use the many-to-one
relationship modes
25. ONE TO ONE MODEL
• There is one-to-one relationship of
user-level thread to the kernel-level
thread. This model provides more
concurrency than the many-to-one
model. It also allows another thread to
run when a thread makes a blocking
system call. It supports multiple threads
to execute in parallel on
microprocessors.
• Disadvantage of this model is that
creating user thread requires the
corresponding Kernel thread. OS/2,
windows NT and windows 2000 use
one to one relationship model.