0% found this document useful (0 votes)
35 views82 pages

Unit-I-R23 PPT OS

The document provides an overview of operating systems, detailing their functions, structure, and types, including user interfaces, memory management, process management, and device management. It also discusses various computing environments such as personal computing, client-server, and cloud computing, as well as the significance of open-source operating systems. Key concepts like system calls, user mode, and kernel mode are explained, highlighting their roles in operating system operations.

Uploaded by

Swapna CH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views82 pages

Unit-I-R23 PPT OS

The document provides an overview of operating systems, detailing their functions, structure, and types, including user interfaces, memory management, process management, and device management. It also discusses various computing environments such as personal computing, client-server, and cloud computing, as well as the significance of open-source operating systems. Key concepts like system calls, user mode, and kernel mode are explained, highlighting their roles in operating system operations.

Uploaded by

Swapna CH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 82

OPERATING SYSTEMS

UNIT I
Operating Systems Overview: Introduction, Operating
system functions, Operating system
structure, operating systems Operations, protection and
security, 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
structure, operating system debugging, System Boot.
What is an Operating System?
• A program that acts as an intermediary between a user of a computer
and the computer hardware.
• An operating System is a collection of system programs that together
control the operations of a computer system.
• Some examples of operating systems are UNIX, Mach, MS-DOS, MS-
Windows, Windows/NT, Chicago, OS/2, MacOS, VMS, MVS, and
VM.
Operating system goals
• Execute user programs and make solving user problems easier.
• Make the computer system convenient to use.
• Use the computer hardware in an efficient manner
Computer System Components
Hardware Resources
• A Computer System consists of various hardware components such as

Processor RAM Keyboard & Mouse

Hard Disk Monitor Printer

8
Operating System is a control program ,that controls and co-
ordinates all the activities performed with in the computer
system

9
Operating System Functions/Services/Tasks
 Providing User Interface
 Program Development and Execution
 Memory Management
 Processor Management
 Process Management
 Device Management (Facilitating I/O)
 File Management
 Protection and Security
 Control over system performance
 Job and Resource usage Accounting
 Error detecting aids
 Coordination between other software and users
 Handling Network Communications
Providing User Interface
• OS provides an interface to the user to interact with a computer
A user interface (UI) refers to the part of an operating system, program, or device that
allows a user to enter and receive information.
 GUI
 CLI
Graphical user interface (GUI)
• Most common interface
• Windows OS X
• Uses a mouse to control objects
• Uses a desktop
• Shortcuts open programs or documents
• Task switching
• Dialog boxes allow directed input
Command line interfaces(CLI)
• Older interface
• DOS, Linux, UNIX
• User types commands at a prompt
• User must remember all commands
• Included in all GUIs
2. Program development and
Execution
• It provides editors and debuggers to assist (help) the programmer in
creating programs.
Memory Management
An Operating System does the following activities for memory
management:
➢ Keeps track of primary memory i.e. what part of it are in use by
whom what part are not in use.
➢ In multiprogramming the OS decides which process will get memory
when and how much.
➢ Allocates the memory when a process requests it.
➢ De-allocates the memory when a process no longer needs it or has
been terminated
Processor Management
An Operating System does the following activities for
processor management −
• Keeps tracks of processor and status of processor. The
program responsible for this task is known as traffic
controller.
• Allocates the processor (CPU) to a process.
• De-allocates processor when a process is no longer
required.
Process Management
• A process is a program in execution.
The OS is responsible for the following activities of the
process management

• Creating & destroying of the user & system process .


• Allocating H/w resources among the processes.
• Controlling the progress of the process.
• Provides mechanisms for process synchronization and
communication.
• Provides mechanism for deadlock handling.
Device Management
An Operating System manages device communication via their respective drivers.
It does the following activities for device management:

1. Keeps tracks of all devices. Program responsible for this task is


known as the I/O controller.
2. Decides which process gets the device when and for how much
time.
3. Allocates the device in the efficient way.
4. De-allocates devices.
File Management
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directories .

1. It helps to create new files in computer system and placing them at the
specific locations.
2. It helps in easily and quickly locating these files in computer system.
3. It makes the process of sharing of the files among different users very
easily and user friendly.
4. It helps to stores the files in separate folders known as directories. These
directories help users to search file quickly or to manage the files according
to their types or uses.
5. It helps the user to modify the data of files or to modify the name of the
file in the directories.
Protection and Security

Security : It involves guarding of a user’s data and programs


against interference by external entities, e.g. unauthorized
persons.
ex: Restricting the access of system with firewalls and
authentication

Protection : It involves guarding a user’s data and programs


against interference by other authorized users of the system.
ex: Restricting the access of information with permissions
20
Job and Resource accounting − Keeping track of time and
resources used by various jobs and users.

Error detecting aids − Production of dumps, traces, error


messages, and other debugging and error detecting aids.

21
Handling network communications : Providing
communication b/w two computers

22
Control over system performance : Recording delays
between request for a service and response from the system.
Coordination between other softwares and users −
Coordination and assignment of compilers, interpreters,
assemblers and other software to the various users of the
computer system

23
OPERATING SYSTEM STRUCTURE

Operating System is structured with following features

Uni Programming
Multi Programming
Multi Tasking
Multi Processing
Multi Threadding

24
25
26
Multi Tasking

27
Multi Processing

Multiprocessing refers to the hardware (i.e., the CPU units) rather than the software
(i.e., running processes).

28
Multi threading –
A thread is a basic unit of CPU utilization. Multi threading is an execution model that
allows a single process to have multiple code segments (i.e., threads) running
concurrently within the “context”of that process.
e.g. VLC media player, where one thread is used for opening the VLC media player,
one thread for playing a particular song and another thread for adding new songs to
the playlist.

29
COMPUTING ENVIRONMENTS
Computing Environment is a collection of computers which are
used to process and exchange the information to solve various
types of computing problems.
TThe following are the various types of computing environments

 Personal Computing Environment


 Time Sharing Computing Environment
 Client Server Computing Environment
 Distributed Computing Environment
 Peer-to-Peer Computing
 Grid Computing Environment
 Cluster Computing Environment
 Web-Based Computing
30
Personal Computing Environment
Personal computing is a stand-alone machine. In personal computing environment,
the complete program resides on stand alone machine and executed from the same
machine. Laptops, mobile devices, printers, scanners and the computer systems we
use at home, office are the examples for personal computing environment

31
Time Sharing Computing Environment
Time sharing computing environment is stand alone computer in which a single user
can perform multiple operations at a time by using multitasking operating system.
Here the processor time is divided among different tasks and this is called “Time
sharing”. For example, a user can listen to music while writing something in a text
editor. Windows 95 and later versions of windows OS, iOS and Linux operating
systems are the examples for this computing environment.

32
Client Server Computing Environment
The client server environment contains two machines (Client machine and Server
machine). These both machines will exchange the information through an
application. Here Client is a normal computer like PC, Tablet, Mobile, etc., and
Server is a powerful computer which stores huge data and manages huge amount
of file and emails, etc., In this environment, client requests for data and server
provides data to the client.

33
Distributed Computing Environment
In the distributed computing environment, the complete functionality of a software is
not on single computer but is distributed among multiple computers. Here we use a
method of computer processing in which different programs of an application run
simultaneously on two or more computers. These computers communicate with each
other over a network to perform the complete task. In distributed computing
environment, the data is distributed among different systems and that data is
logically related to each other.

34
Peer-to-Peer Computing
• Another model of distributed system
• P2P does not distinguish clients and servers
• Instead all nodes are considered peers
• May each act as client server or both
• Advantage over traditional client-server system is that the server is a
bottleneck. But in a P2P system services can be provided by several nodes.

35
Peer-to-Peer Computing

37
Grid Computing Environment
Grid computing serves computing resources such as network, server,
applications to the individual users. Grid involves the loosely coupled
systems in which jobs are managed and scheduled in a distributed way. It
divides a massive job in smaller chunks and processes those chunks
separately. Grid computing is a combination of non-centralized computing
resources where each geographically separate, independent site has its
own administrative control over it.

38
39
Cloud Computing Environment
Cloud computing is a modern computing paradigm which provides
scalable and flexible IT infrastructure and essential services to the users
through the internet.

40
41
The difference between a cloud and a grid can be expressed as below:

Resource distribution: Cloud computing is a centralized model whereas grid


computing is a decentralized model where the computation could occur over
many administrative domains.
Ownership: A grid is a collection of computers which is owned by multiple
parties in multiple locations and connected together so that users can share
the combined power of resources. Whereas a cloud is a collection of
computers usually owned by a single party.
Examples of Clouds: Amazon Web Services (AWS), Google App Engine.
Examples of Grids: FutureGrid.
Examples of cloud computing services: Dropbox, Gmail, Facebook, Youtube,
RapidShare.

42
Cluster Computing Environment
Cluster computing is a collection of inter connected computers connected by LAN .
These computers work together to solve a single problem. In cluster computing
environment, a collection of systems work together as a single system. Cluster is
tightly coupled . clusters are made up of machines with similar hardware

43
Web-Based Computing
• Web has become ubiquitous(being present everywhere at once)
• Now load balancers are used to manage web traffic among similar servers
• Use of operating systems like Windows 95 client-side have evolved into Linux and
Windows XP which can be clients and servers

44
Web-Based Computing

45
Open-Source Operating Systems

• Operating systems made available in source-code format rather than just binary closed-source
• Started by Free Software Foundation (FSF) which has “copyleft” GNU Public License (GPL)
• Copyrights exist in order to protect authors of documentation or software from unauthorized copying
or selling of their work. A copyright infers that only with the author's permission may such activities
take place.
• Copyleft overrides copyright and promotes the concept that materials be freely used, copied and
modified by others. Copyleft also requires all modified and extended versions of the material also be
freely accessible, used and modified by others.

• Examples include GNU/Linux BSD(Berkeley Software Distribution) UNIX (including core of Mac OS X)
and Sun OpenSolaris , Ubuntu , ReactOS , Haiku OS

46
Ubuntu
The most widely used open source data base is Ubuntu. It is a Linux based operating system and is
distributed free along with the source code. Its desktop looks somewhat similar to that of Windows,
with window controls and icons. There is reasonable large software support available on Ubuntu; the
common applications include Mozilla Firefox web browser, LibreOffice office application suite, GIMP
image editor and so on.
Ubuntu is distributed under GNU and GPL license. It has UNIX shell called as Terminal that can be
used to interact with the network and install third-party applications.

OpenSolaris
OpenSolaris is a computer operating system developed by Sun Microsystems. It runs well on
desktops, laptops, servers and data centers. OpenSolaris is GUI based like Ubuntu and has rich
graphical desktop and windows for easy navigation.
FreeBSD
FreeBSD is an advanced operating system for x86 compatible (including Pentium and Athlon), AMD64
compatible. It is popular among network developers, as FreeBSD offers advanced networking,
performance, security and compatibility features. Most software that runs on Linux can run on
FreeBSD without the need for any compatibility layer.

47
ReactOS
It is a free Windows compatible OS that offers the benefits of running Windows apps natively. Apart
from being an open-source software (its main highlight), the tool has one really cool feature that
Windows failed to offer – An application manager very much similar to Linux package manager.

Haiku OS
What most users like about this OS is its uniformity and cohesiveness.
To start up the operating system, one simply inserts the thumb drive into a USB port and reboot.
This should not pose a problem as most modern computers these days can be set to boot from the
USB key. The OS is fast and responsive. Moreover, it is equipped with a number of applications and
demos pre-installed.

48
Operating-System Operations:

• System calls provide an interface to the services made available


by an operating system
• To understand system calls, first one needs to understand the
difference between kernel mode and user mode of a CPU. Every
modern operating system supports these two modes.

Safe Mode

Privileged Mode

Modes supported by the operating system


Operating-System Operations:
• The modern operating systems are interrupt driven.
• Events are almost always signaled by the occurrence of an interrupt
or a trap.
• A trap (or an exception) is a software-generated interrupt caused
either by an error (for example, division by zero or invalid memory
access) or by a specific request from a user program that an
operating-system service be performed
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.
• That means the system will be in a safe state even if a program in
user mode crashes.
• Hence, most programs in an OS run in user mode.
Kernel Mode
• When CPU is in kernel mode, the code being executed can access
any memory address and any hardware resource.
• Hence kernel mode is a very privileged and powerful mode.
• If a program crashes in kernel mode, the entire system will be halted.
System Calls
• 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. This is done via
something called a system call.
Example of System Calls
• System call sequence to copy the contents of one file to another file
API – System Call – OS Relationship
Types of System Calls
1. Process control
• create process, terminate process
• end, abort
• load, execute
• get process attributes, set process attributes
• wait for time
• wait event, signal event
• allocate and free memory
• Dump memory if error
• Debugger for determining bugs, single step execution
• Locks for managing access to shared data between processes
Types of System Calls
2. File management
• create file, delete file
• open, close file
• read, write, reposition
• get and set file attributes
3. Device management
• request device, release device
• read, write, reposition
• get device attributes, set device attributes
• logically attach or detach devices
Types of System Calls (Cont.)
4. Information maintenance
• get time or date, set time or date
• get system data, set system data
• get and set process, file, or device attributes
5. Communications
• create, delete communication connection
• send, receive messages if message passing model to host name or
process name
• From client to server
• Shared-memory model create and gain access to memory regions
• transfer status information
• attach and detach remote devices
Types of System Calls (Cont.)
6. Protection
• Control access to resources
• Get and set permissions
• Allow and deny user access
Examples of Windows and Unix System Calls
System Programs
• System programs provide a convenient environment for program
development and execution.
• System programs may be divided into these categories:
• File management
• Status information
• File modification
• Programming-language support
• Program loading and execution
• Communications
• Background services
System Programs
Provide a convenient environment for program development and
execution. Some of them are simply user interfaces to system calls;
others are considerably more complex
• System programs may be divided into these categories:
• File management - programs to create, delete, copy, rename, print,
list, and generally manipulate files and directories.
Ex: create and display(cat), copy (cp), rename (mv), print (lpr), examine a file (head,
more, cat), search a file (grep), delete (rm),
• 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.
ex: date, ps
• File modification - e.g. text editors and other tools which can change
file contents.
System Programs (Cont.)
• Programming-language support - E.g. Compilers, linkers,
debuggers, profilers, assemblers, library archive management,
interpreters for common languages, and support for make.
• Program loading and execution - loaders, dynamic
loaders, overlay loaders, etc., as well as interactive debuggers.
• Communications - Programs for providing connectivity
between processes and users, including mail, web browsers, remote
logins, file transfers, and remote command execution.
ex: Chat (write/talk) and email (pine)
• 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.
APPLICATION PROGRAMS
An application program is a comprehensive, self-contained
program that performs a particular function directly for the
user.
Among many others, application programs include:
Email
Web browsers
Games
Word processors
Enterprise software
Accounting software
Graphics software
Media players
Database management
Operating-System Design and Implementation
• Design Goals
• User goals – operating system should be convenient to use, easy to
learn, reliable, safe, and fast
• System goals – operating system should be easy to design,
implement, and maintain, as well as flexible, reliable, error-free, and
efficient
• Mechanisms and Policies :
• Policies determine what is to be done.
• Mechanisms determine how it is to be implemented.
• Implementation
• Traditionally OSes were written in assembly language
• Most modern OSes 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)
Operating System Structures
(STRUCTURES OF OPERATING SYSTEM)

• 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. ). That means affected by choice of
hardware, type of system
• So the Internal structure of different Operating Systems can vary widely
• Start by defining goals and specifications

• User goals and System goals


• User goals – operating system should be convenient to use,
easy to learn, reliable, safe, and fast
• System goals – operating system should be easy to design,
implement, and maintain, as well as flexible, reliable, error-
free, and efficient
Structure/Organization/Layout of OSs:
OS components and its organization and its interactions is called
OS structure.
The following are the some of the OS structures.

1. simple ( unstructured )
2. Monolithic (one unstructured program)
3. Layered
4. Microkernel
5. Modular
6. Hybrid Systems
Simple Structure -- MS-DOS
• MS-DOS – written to
provide the most
functionality in the least
space
• Not divided into
modules
• Although MS-DOS has
some structure, its
interfaces and levels of
functionality are not
well separated
Non Simple Structure or Monolithic --
UNIX
Traditionally, systems such as Unix were built as a monolithic kernel:
The UNIX OS consists of two separable parts
• Systems programs
• The kernel
• Consists of everything below the system-call interface and above the physical
hardware
• Provides the file system, CPU scheduling, memory management, and other operating-
system functions; a large number of functions for one level
user programs

file system, virtual memory,


I/O drivers, process control,
OS kernel everything system services, swapping,
networks, protection,
interrupt handling,
windows, accounting, ...

hardware
• 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.

• Benefits:
• Easier to extend a microkernel
• Easier to port the operating system to new architectures
• More reliable (less code is running in kernel mode)
• More secure
• Detriments:
• Performance overhead of user space to kernel space communication
Microkernel System Structure
Modular kernel
• Many modern operating systems implement loadable
kernel modules
• Uses object-oriented approach
• Each core component is separate
• Each talks to the others over known interfaces
• Each is loadable as needed within the kernel
• Overall, similar to layers but with more flexible
• Linux, Solaris, etc
Solaris Modular Approach
Hybrid Systems
• Most modern operating systems are actually not one pure model
• Hybrid combines multiple approaches to address performance, security,
usability needs
• Linux and Solaris kernel combines monolithic, plus modular for dynamic
loading of functionality
• Windows mostly monolithic, plus microkernel for different subsystem
personalities
ex: Mac OS X Structure

– Apple Mac OS X hybrid, layered, Aqua UI plus Cocoa programming environment


– Below is kernel consisting of Mach microkernel and BSD Unix parts, plus I/O kit and
dynamically loadable modules (called kernel extensions)
– The Mac 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:
Mac OS X Structure
iOS

• Apple mobile OS for iPhone, iPad


• Cocoa Touch Objective-C API for
developing apps
• Media services layer for graphics,
audio, video
• Core services provides cloud
computing, databases
• Core operating system, based on
Mac OS X kernel
Android
• Developed by Open Handset Alliance (mostly Google)
• Open Source
• Similar stack to IOS
• Based on Linux kernel but modified
• Provides process, memory, device-driver management
• Adds power management
• Runtime environment includes core set of libraries and Dalvik virtual machine
• Apps developed in Java plus Android API
• Java class files compiled to Java bytecode then translated to
executable than runs in Dalvik VM
• Libraries include frameworks for web browser (webkit), database (SQLite),
multimedia, smaller libc
Android Architecture
SYSTEM BOOT
• The procedure of starting a computer by loading the kernel is known
as “Booting” the system.
• A small piece of code known as the Bootstrap program or Bootstrap
loader locates the kernel, loads it into main memory and starts its
execution.
SYSTEM BOOT
• When power initialized on system, execution starts at a fixed
memory location
• Firmware ROM used to hold initial boot code
• Operating system must be made available to hardware so hardware
can start it
• Small piece of code – bootstrap loader, stored in ROM or
EEPROM locates the kernel, loads it into memory, and starts it
• Sometimes two-step process where boot block at fixed location
loaded by ROM code, which loads bootstrap loader from disk
• Common bootstrap loader, GRUB, allows selection of kernel from
multiple disks, versions, kernel options
• Kernel loads and system is then running

You might also like