Upload
gayora
View
40
Download
0
Embed Size (px)
DESCRIPTION
Lesson 1: Operating System Basics. What is an Operating System?. OS = Operating System A program that controls the execution of application programs. An interface between applications and hardware. Makes the computer more convenient to use. What is an Operating system?. - PowerPoint PPT Presentation
Citation preview
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:1
Lesson 1: Operating System Basics
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:2
What is an Operating System?
OS = Operating System
A program that controls the execution of application programs.
An interface between applications and hardware.
Makes the computer more convenient to use
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:3
What is an Operating system?
Manages the resources of a computer and controls the way they are used.
Allows resources to be used in an efficient manner.
Examples of OS’s?
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:4
Where are OS’s used?
In more and more places! Desktop and Server Computers DOS + Windows 95/98/ME
Windows NT/2000/XP Free Unix variants: Linux, FreeBSD,
NetBSD, etc. Commercial Unix variants: Solaris, HP-
UX, AIX, etc.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:5
Where are OS’s used?
MacOS Some Game Consoles Xbox: Cut-down Windows 2000 Personal Digital Assistants (PDAs) PalmOS Windows CE Windows Mobile
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:6
Where are OS’s used?
Embedded Linux Mobile Phones Symbian OS Windows Mobile Cars (fancy ones)
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:7
Where are OS’s used?
In the future also: Digital Cameras (fancy ones) MP3 Players (iPods, etc.) Refrigerators! Others?
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:8
Layers of a Computer System
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:9
Services And System Calls
User Program(requests service) from
kernel
UNIX system kernel
(provides services) toThe user
Service,dataand
Status returned
Type,Data details Are sent
Services offered and system calls
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:10
Services Provided by the OS
Program execution Access to Input/Output (I/O)
devices Disks, screens, keyboards, mice Printers, cameras, speakers, etc.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:11
Services Provided by the OS
Controlled access to files System access Sometimes: Program development Compilers, editors and debuggers Error detection and response Internal and external hardware errors Memory errors
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:12
Services Provided by the OS
Device failures Software errors Arithmetic overflow Division by zero Access to forbidden memory locations
(why?) Operating system cannot grant request
of application
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:13
Operating System as Software
The OS functions the same way as ordinary computer software It is a program that is executed … … but it has special privileges The OS relinquishes control of the processor to execute other
programs
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:14
Provide a user interfaceProvide a user interface Run programsRun programs Manage hardware devicesManage hardware devices Organized file storageOrganized file storage
Functions of Operating Systems
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:15
Types of Operating Systems
Real-time operating systemReal-time operating system Very fast small OS Built into a device Respond quickly to user input MP3 players, Medical devices
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:16
Types of Operating Systems
Single user/Single tasking OSSingle user/Single tasking OS One user works on the system Performs one task at a time MS-DOS and Palm OS Take up little space on disk Run on inexpensive computers
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:17
Types of Operating Systems
Single user/Multitasking OSSingle user/Multitasking OS User performs many tasks at
once Most common form of OS Windows XP and OS X Require expensive computers Tend to be complex
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:18
Multi user/Multi tasking OS
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:19
Providing a User Interface
User interfaceUser interface How a user interacts with a
computer Require different skill sets
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:20
Providing a User Interface
Graphical user interface (GUI)Graphical user interface (GUI) Most common interface
Windows, OS X, Gnome, KDE Uses a mouse to control objects Uses a desktop metaphor
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:21
Contd:
Shortcuts open programs or documents
Open documents have additional objects
Task switching Dialog boxes allow directed
input
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:22
Graphical User Interface
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:23
Running Programs
Many different applications supportedMany different applications supported System callSystem call
Provides consistent access to OS features
Share information between programsShare information between programs Copy and paste Object Linking and Embedding
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:24
Managing Hardware
Programs need to access Programs need to access hardwarehardware
InterruptsInterrupts CPU is stopped Hardware device is accessed
Device drivers control the Device drivers control the hardwarehardware
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:25
Organizing Files and Folders
Organized storageOrganized storage Long file namesLong file names Folders can be created and Folders can be created and
nestednested All storage devices work All storage devices work
consistentlyconsistently
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:26
Enhancing an OS
UtilitiesUtilities Provide services not included
with OS Goes beyond the four functions Firewall, anti-virus and
compression Prices vary
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:27
Enhancing an OS
Backup softwareBackup software Archives files onto removable
media Ensures data integrity Most OS include a backup
package Many third party packages exist
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:28
Backup Software
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:29
Enhancing an OS
Anti-virus softwareAnti-virus software Crucial utility Finds, blocks and removes
viruses Must be updated regularly McAfee and Norton Anti-Virus
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:30
Enhancing an OS
FirewallFirewall Crucial utility Protects your computer from
intruders Makes computer invisible to
hackers Zone Labs is a home firewall Cisco sells hardware firewalls
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:31
UNIX
Unix is a multi-user, multi-tasking Unix is a multi-user, multi-tasking operating system.operating system.
You can have many users logged You can have many users logged into a system simultaneously, each into a system simultaneously, each running many programs. running many programs.
It's the kernel's job to keep each It's the kernel's job to keep each process and user separate and to process and user separate and to regulate access to system regulate access to system hardware, including cpu, memory, hardware, including cpu, memory, disk and other I/O devices. disk and other I/O devices.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:32
History of UNIX
First Version was created in Bell First Version was created in Bell Labs in 1969.Labs in 1969.
Some of the Bell Labs programmers Some of the Bell Labs programmers who had worked on this project, who had worked on this project, Ken Thompson, Dennis Ritchie, Ken Thompson, Dennis Ritchie, Rudd Canaday, and Doug McIlroy Rudd Canaday, and Doug McIlroy designed and implementeddesigned and implemented
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:33
History of UNIX
the first version of the Unix File the first version of the Unix File System on a PDP-7 along with a System on a PDP-7 along with a few utilities. It was given the name few utilities. It was given the name UNIX by Brian Kernighan. UNIX by Brian Kernighan.
00:00:00 Hours, Jan 1, 1970 is time 00:00:00 Hours, Jan 1, 1970 is time zero for UNIX. It is also called as zero for UNIX. It is also called as epoch.epoch.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:34
History of UNIX
1973 Unix is re-written mostly 1973 Unix is re-written mostly in C, a new language developed in C, a new language developed by Dennis Ritchie. by Dennis Ritchie.
Being written in this high-level Being written in this high-level language greatly decreased the language greatly decreased the effort needed to port it to new effort needed to port it to new machines. machines.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:35
History of UNIX
1977 There were about 500 1977 There were about 500 Unix sites world-wide. Unix sites world-wide.
1980 BSD 4.1 (Berkeley 1980 BSD 4.1 (Berkeley Software Development) Software Development)
1983 SunOS, BSD 4.2, System 1983 SunOS, BSD 4.2, System V V
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:36
History of UNIX
1988 AT&T and Sun 1988 AT&T and Sun Microsystems jointly develop Microsystems jointly develop System V Release 4 (SVR4). System V Release 4 (SVR4). This later developed into This later developed into UnixWare and Solaris 2. UnixWare and Solaris 2.
1991 Linux was originated.1991 Linux was originated.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:37
What is LINUX
Linux is a free Unix-type operating Linux is a free Unix-type operating system originally created by Linus system originally created by Linus Torvalds with the assistance of Torvalds with the assistance of developers around the world. developers around the world.
It originated in 1991 as a personal It originated in 1991 as a personal project of Linus Torvalds, a Finnish project of Linus Torvalds, a Finnish graduate student.graduate student.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:38
What is LINUX
The Kernel version 1.0 was The Kernel version 1.0 was released in 1994 and today the released in 1994 and today the most recent stable version is 2.6.9most recent stable version is 2.6.9
Developed under the Developed under the GNU General Public License , the the source code for Linux is freely source code for Linux is freely available to everyone. available to everyone.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:39
LINUX Distributions
Mandrake: Mandrake: http://http://www.mandrakesoft.comwww.mandrakesoft.com//
RedHat: RedHat: http://http://www.redhat.comwww.redhat.com//
Fedora: Fedora: http://http://fedora.redhat.comfedora.redhat.com//
SuSE/Novell: SuSE/Novell: http://http://www.suse.comwww.suse.com//
Debian: Debian: http://http://www.debian.orgwww.debian.org//
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:40
Red Hat
Red Hat Enterprise Linux is a Red Hat Enterprise Linux is a Enterprise targeted Operating Enterprise targeted Operating System. It based on mature Open System. It based on mature Open Source technology and available at Source technology and available at a cost with one year Red Hat a cost with one year Red Hat Network subscription for upgrade Network subscription for upgrade and support contract.and support contract.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:41
UNIX Structure
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:42
Components of a Linux System
Like most UNIX implementations, Like most UNIX implementations, Linux is composed of three main Linux is composed of three main bodies of code; the most important bodies of code; the most important distinction between the kernel and distinction between the kernel and all other componentsall other components
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:43
Kernel
Portion of operating system that is always in main memory
Contains most-frequently used functions
Also called the nucleus Good performance of the kernel is
very important
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:44
Components of a Linux System (Cont.)
The kernel is responsible for The kernel is responsible for maintaining the important maintaining the important abstractions of the operating abstractions of the operating system.system.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:45
Components of a Linux System (Cont.)
Kernel code executes in kernel mode with full access to all the physical resources of the computer.
All kernel code and data structures are kept in the same single address space.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:46
Components of a Linux System (Cont.)
The system libraries define a The system libraries define a standard set of functions through standard set of functions through which applications interact with the which applications interact with the kernel, and which implement much kernel, and which implement much of the operating-system of the operating-system functionality that does not need the functionality that does not need the full privileges of kernel code.full privileges of kernel code.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:47
Shell
Shell is the command interpreter.Shell is the command interpreter.
It is a interface between a user and It is a interface between a user and the system. the system.
The kernel activates an interactive The kernel activates an interactive program called shell for each user program called shell for each user logged into the system. logged into the system.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:48
Shell
Shells provide a way to separate Shells provide a way to separate users or tasks from each other.users or tasks from each other.
Kernel maintains a unified overall Kernel maintains a unified overall control. control.
Shell provides a prompt like $ or %.Shell provides a prompt like $ or %. This is called the command line This is called the command line
interface of the shell. interface of the shell.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:49
Shell
The user can type any valid The user can type any valid UNIX/Linux command.UNIX/Linux command.
Can run a shell script and press Can run a shell script and press enter to intimate the shell about enter to intimate the shell about the task to perform.the task to perform.
The shell interprets the typed The shell interprets the typed command and searches a command and searches a predefined path for the executable predefined path for the executable file by the name of the command file by the name of the command typed. typed.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:50
Shell
It checks the syntax of the It checks the syntax of the commands and if all is fine, starts commands and if all is fine, starts the corresponding executable the corresponding executable running and goes into waiting mode. running and goes into waiting mode.
After the command finishes After the command finishes executing, it exits and control is executing, it exits and control is returned to the shell. returned to the shell.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:51
Shell
A shell prompt is returned to the A shell prompt is returned to the user. user.
Actual fetching and returning of Actual fetching and returning of data at the request of the shell is data at the request of the shell is done by the kernel.done by the kernel.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:52
Before Operating Systems…
Serial Processing No operating system Machines run from a console with
display lights and toggle switches, input device, and printer.
Schedule time
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:53
Before Operating Systems…
Setup included loading the compiler, source program, saving compiled program, and loading and linking.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:54
Uniprogramming
Uniprogramming Processor must wait for I/O
instruction to complete before preceding.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:55
Uniprogramming
But! Processors are much faster than I/O devices… inefficient use of CPU
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:56
Multiprogramming
When one job needs to wait for I/O, the processor can switch to the other job.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:57
Multiprogramming
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:58
Example Effects
Uniprogramming MultiprogrammingUniprogramming Multiprogramming
Processor use 22% Processor use 22% 43%43%
Memory use Memory use 30% 67% 30% 67%
Disk use 33% Disk use 33% 67% 67%
Printer use Printer use 33% 33% 67% 67%
Elapsed time 30 min. Elapsed time 30 min. 15 min. 15 min.
Throughput rate 6 jobs/hr 12 jobs/hrThroughput rate 6 jobs/hr 12 jobs/hr
Mean response time 18 min. 10 min.Mean response time 18 min. 10 min.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:59
Achievements in OS Research
Processes Memory management Information protection and
security Scheduling and resource
management System structure
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:60
Processes
A program in execution An instance of a program running on a
computer The entity that can be assigned to and
executed on a processor A unit of activity characterized by a
single sequential thread of execution a current state an associated set of system resources
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:61
Processes
Consists of three components An executable program, i.e., some
code Associated data needed by the
program Execution context of the program
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:62
Processes
All information the operating system needs to manage the process.
e.g., who owns the process, which priority does it have, what resources does it currently ‘own’.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:63
OS Support for Processes
Creating, destroying, starting, stopping,setting priorities, …
Process synchronisation Semaphores (wait/signal) Monitors Deadlock detection Inter-process communication Shared memory
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:64
Processes in Linux
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:65
Modern Operating Systems
Multithreading• Each process is divided into threads that can
run simultaneously.
Thread• Dispatchable unit of work• Executes sequentially and is interruptible.
A process is a collection of one or more threads
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:66
Modern Operating Systems
Symmetric multiprocessing. There are multiple processors. These processors share same main
memory and I/O facilities. All processors can perform the
same functions.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:67
Modern Operating Systems
Distributed operating systems
• Provides the illusion of a single main memory and single secondary memory space.
• Distributed shared memory• Distributed file systems
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:68
Example OS: PalmOS
•Used for PalmPilot PDAsand successors.• Multitasking sincePalmOS 5.• CPUs: Intel XScale,Texas InstrumentsOMAP, MotorolaDragonball MX• Wireless: 802.11b,Bluetooth, GSM, CDMA• 320×320+ displays Good battery utilisation
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:69
Example OS: SymbianOS
•Designed for mobile phones• Gives access to graphics, multimedia, networking, telephony, crypto, PC connectivity, etc.
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:70
The OS Wars
Why is the OS such a big deal?• Windows vs Linux vs Mac• Symbian vs PalmOS vs Windows Mobile
IncompatibilitiesIncompatibilities• OS’s have different interfaces.• programs must be written differently.• applications for one OS don’t run on another.
Tendency to bloatware• Applications tend to move into the OS• Internet Explorer, Media Player, Search?
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:71
Security: Windows vs Linux
Windows Family Developed from DOS Originally single-user machines No network few threats
Linux Developed from Unix Originally multi-user networked servers Designed to withstand with security threats
from the beginning
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:72
THANK YOUTHANK YOU
Copyrights© 2008 BVU Amplify DITM
DATA BASE MANAGEMENT systemDATA BASE MANAGEMENT system
Page:73