Title: Chapter 1: Operating Systems Overview
1Chapter 1 Operating Systems Overview
2Content
- Introduction
- What is Operating Systems
- What Operating Systems Do
- Computer-System Organization
- Computer-System Architecture
- Operating Systems structure
- User Operating System Interface
- Types of Operating System
- Virtual Machines
- System Boot
- Function of Operating Systems
- As a User/Computer Interface
- As Resource Manager
- Characteristic of the Operating Systems
- Process Management
- Memory Management
- Storage Management
- Protection and Security
3What is an Operating System?
- A program that acts as an intermediary between a
user of a computer and the computer hardware. - 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.
4Computer System Structure
- Computer system can be divided into four
components - Hardware provides basic computing resources
- CPU, memory, I/O devices
- Operating system
- Controls and coordinates use of hardware among
various applications and users - Application programs define the ways in which
the system resources are used to solve the
computing problems of the users - Word processors, compilers, web browsers,
database systems, video games - Users
- People, machines, other computers
5Layers of Computer Systems
6Operating System Definition
- OS is a resource allocator
- Manages all resources
- Decides between conflicting requests for
efficient and fair resource use - OS is a control program
- Controls execution of programs to prevent errors
and improper use of the computer
7Operating System Definition (Cont.)
- No universally accepted definition
- Everything a vendor ships when you order an
operating system is good approximation - But varies wildly
- The one program running at all times on the
computer is the kernel. Everything else is
either a system program (ships with the operating
system) or an application program
8Computer System Organization
- Computer-system operation
- One or more CPUs, device controllers connect
through common bus providing access to shared
memory - Concurrent execution of CPUs and devices
competing for memory cycles
9Operating Systems Structure
- User Operating System Interface
- Types of Operating System
- Virtual Machines
- System Boot
10User Operating System Interface - CLI
- CLI allows direct command entry
- Sometimes implemented in kernel, sometimes by
systems program - Sometimes multiple flavours implemented shells
- Primarily fetches a command from user and
executes it - Sometimes commands built-in, sometimes just names
of programs - If the latter, adding new features doesnt
require shell modification
11User Operating System Interface - GUI
- User-friendly desktop metaphor interface
- Usually mouse, keyboard, and monitor
- Icons represent files, programs, actions, etc
- Many systems now include both CLI and GUI
interfaces - Microsoft Windows is GUI with CLI command shell
- Apple Mac OS X as Aqua GUI interface with UNIX
kernel underneath and shells available - Linux/Solaris is CLI with optional GUI interfaces
(GNOME, KDE,etc)
12Types of OS
- Serial Processing - preOS
- Batch Processing
- Multiprogramming
- Time sharing
- Distributed system Chapter 6
- Real time System Chapter 7
13Serial Processing
- Programmer interacted directly with computer
hardware - Actually there is no OS
- Machines run from console consist of display
light, toggle switch... - Program in machine code loaded directly into the
machine - No scheduling
- Setup included loading the compiler, source
program, saving compiled program, and loading and
linking
14Batch Processing
- User no longer has direct access to the machines
- Simple Batch Systems FIRST OS
- Monitors
- Software that controls the sequence of events
- Batch jobs together
- Program branches back to monitor when finished
15Example 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
16Uniprogramming
- Processor must wait for I/O instruction to
complete before preceding
17Multiprogramming
- When one job needs to wait for I/O, the processor
can switch to the other job
18Multiprogramming
19Utilization Histograms
20Example
21Time Sharing
- Using multiprogramming to handle multiple
interactive jobs - Processors time is shared among multiple users
- Multiple users simultaneously access the system
through terminals
22Virtual Machines
- A virtual machine takes the layered approach to
its logical conclusion. It treats hardware and
the operating system kernel as though they were
all hardware - A virtual machine provides an interface identical
to the underlying bare hardware - The operating system creates the illusion of
multiple processes, each executing on its own
processor with its own (virtual) memory
23Virtual Machines (Cont.)
- The resources of the physical computer are shared
to create the virtual machines - CPU scheduling can create the appearance that
users have their own processor - Spooling and a file system can provide virtual
card readers and virtual line printers - A normal user time-sharing terminal serves as the
virtual machine operators console
24Virtual Machines (Cont.)
- (a) Nonvirtual
machine (b) virtual machine
Non-virtual Machine
Virtual Machine
25The Java Virtual Machine
26System Boot
- Operating system must be made available to
hardware so hardware can start it - Small piece of code bootstrap loader, locates
the kernel, loads it into memory, and starts it - Sometimes two-step process where boot block at
fixed location loads bootstrap loader - When power initialized on system, execution
starts at a fixed memory location - Firmware used to hold initial boot code
27Function of Operating Systems
- As a User/Computer Interface
- Controls execution of programs to prevent errors
and improper use of the computer - As Resource Manager
- Manages all resources
28User/Computer Interface
- User only a computer systems in term of set of
applications - OS provides services in the following areas
- Program development - text editor, compiler,
debugger, utilities,.. - Program execution - Scheduling duties
- Access to I/O devices - Simple reads and writes
- Controlled access to files structure of data,
protection mechanisms
29User/Computer Interface .cont
- OS provides services in the following areas
- System access protection of resource, resolve
conflicts - Error detection response by ending the
application, retrying the operation, simply
reporting the error - Accounting collect usage statistics, Monitor
performance, anticipate future enhancement,
billing purpose , etc
30Resource manager
- Responsible for managing resources
- Decides between conflicting requests for
efficient and fair resource use - Functions same way as ordinary computer software
- It is program that is executed
- Operating system relinquishes control of the
processor
31(No Transcript)
32Characteristic of the Operating Systems
- Process Management
- Memory Management
- Storage Management
- Protection and Security
33Process Management
- A process is a program in execution. It is a unit
of work within the system. Program is a passive
entity, process is an active entity. - Process needs resources to accomplish its task
- CPU, memory, I/O, files
- Initialization data
- Process termination requires reclaim of any
reusable resources - Single-threaded process has one program counter
specifying location of next instruction to
execute - Process executes instructions sequentially, one
at a time, until completion - Multi-threaded process has one program counter
per thread - Typically system has many processes, some user,
some operating system running concurrently on one
or more CPUs - Concurrency by multiplexing the CPUs among the
processes / threads
34Process Management Activities
- The operating system is responsible for the
following activities in connection with process
management - Creating and deleting both user and system
processes - Suspending and resuming processes
- Providing mechanisms for process synchronization
- Providing mechanisms for process communication
- Providing mechanisms for deadlock handling
35Memory Management
- All data in memory before and after processing
- All instructions in memory in order to execute
- Memory management determines what is in memory
when - Optimizing CPU utilization and computer response
to users - Memory management activities
- Keeping track of which parts of memory are
currently being used and by whom - Deciding which processes (or parts thereof) and
data to move into and out of memory - Allocating and deallocating memory space as needed
36Storage Management
- OS provides uniform, logical view of information
storage - Abstracts physical properties to logical storage
unit - file - Each medium is controlled by device (i.e., disk
drive, tape drive) - Varying properties include access speed,
capacity, data-transfer rate, access method
(sequential or random) - File-System management
- Files usually organized into directories
- Access control on most systems to determine who
can access what - OS activities include
- Creating and deleting files and directories
- Primitives to manipulate files and dirs
- Mapping files onto secondary storage
- Backup files onto stable (non-volatile) storage
media
37Mass-Storage Management
- Usually disks used to store data that does not
fit in main memory or data that must be kept for
a long period of time. - Proper management is of central importance
- Entire speed of computer operation hinges on disk
subsystem and its algorithms - OS activities
- Free-space management
- Storage allocation
- Disk scheduling
- Some storage need not be fast
- Tertiary storage includes optical storage,
magnetic tape - Still must be managed
- Varies between WORM (write-once, read-many-times)
and RW (read-write)
38I/O Subsystem
- One purpose of OS is to hide peculiarities of
hardware devices from the user - I/O subsystem responsible for
- Memory management of I/O including buffering
(storing data temporarily while it is being
transferred), caching (storing parts of data in
faster storage for performance), spooling (the
overlapping of output of one job with input of
other jobs) - General device-driver interface
- Drivers for specific hardware devices
39Protection and Security
- Protection any mechanism for controlling access
of processes or users to resources defined by the
OS - Security defense of the system against internal
and external attacks - Huge range, including denial-of-service, worms,
viruses, identity theft, theft of service - Systems generally first distinguish among users,
to determine who can do what - User identities (user IDs, security IDs) include
name and associated number, one per user - User ID then associated with all files, processes
of that user to determine access control - Group identifier (group ID) allows set of users
to be defined and controls managed, then also
associated with each process, file - Privilege escalation allows user to change to
effective ID with more rights
40End of Chapter 1