Sunteți pe pagina 1din 29

Chapter 8 System Software

Instructor: Hao Zheng


Comp. Sci. & Eng.
USF

8.1 Introduction

8.1 Introduction
The biggest and fastest computer in the world is of
no use if it cannot efficiently provide beneficial
services to its users.
Users see the computer through their application
programs. These programs are ultimately executed
by computer hardware.
System software, including operating systems,
compilers and middleware, is the glue that holds
everything together.
Provides functions/services for user programs to exec.
3

8.2 Operating Systems: Roles


Help applications to interact w. HW.
Provides functions for SW packages to control HW.
An interface of HW to SW.

Manage HW resources to max the system efficiency.


Hide low level details for programming to focus on highlevel problem solving.

Make the system user-friendly.


Imagine there are not windows or no plug-n-play

Protect HW from harmful actions of user


applications.
4

8.2.1 Operating Systems History


The evolution of operating systems has paralleled the
evolution of computer hardware.
As hardware became more powerful, operating systems
allowed people to more easily manage the power of the
machine.

In the days when main memory was measured in


kilobytes, and tape drives were the only form of
magnetic storage, operating systems were simple
resident monitor programs.
Could only load, execute, and terminate programs.
These tasks were originally done by human operators.
5

8.2.1 Operating Systems History


Later, more functions were added into the simple
resident monitor programs.
What if a user program runs for a very long time or
infinitely?
Timers added to terminate the program when its time is up.

What if a user program changes the code/data of a


different program?
HW provides user and monitor modes.
Used by the monitor to run user program safely.

8.2.1 Operating Systems: History


In the 1960s, hardware has become powerful enough
to accommodate multiprogramming, the concurrent
execution of more than one task.
Just an illusion if there is only one CPU.

Multiprogramming is achieved by allocating each


process a given portion of CPU time.
Interactive multiprogramming systems were called
timesharing (time-slicing) systems.
Terminals provided to multiple users to access systems
When a process is taken from the CPU and replaced by
another, we say that a context switch has occurred.
7

Terminology
Process: an active object

Context

Task: a slice of process execution.


A process consists of a sequence of tasks.

8.2.1 Operating Systems History


Real time operating systems control computers
that respond to their environment.
For process control in manufacturing plants, robots,
airplanes, etc.
Program execution needs to satisfy timing constraints.
Hard real time systems have tight timing constraints,
fatal errors occur if not met.
Soft real time systems do not. If not met, undesirable, but
will not crash.

8.2.1 Operating Systems History


Today, multiprocessor systems have become
commonplace.
Tightly coupled multiprocessor systems share a
common memory and the same set of I/O devices.
Symmetric multiprocessor systems are tightly coupled and
load balanced.

Source: wiki

10

8.2.1 Operating Systems History


Loosely coupled multiprocessor systems have
physically separate memory.
These are often called distributed systems a single OS runs
on all machines presenting an image of a single machine.
A networked system consists of a collection of interconnected,
collaborating workstations.

11

8.2.3 Operating Systems Services


The human interface ease of use, productivity.
Process management lies at the heart of operating
system services for
Process creation, scheduling their access to resources,
deletion, and de-allocation of resources allocated during
process execution.

OS monitors synchronizes processes in order to


avoid inconsistent accesses of shared resources.
OS manages inter-process communication.

12

8.2.3 Operating Systems Services


The operating system schedules process execution.
First, the operating system determines which process
shall be granted access to the CPU.
This is long-term scheduling.
After a number of processes have been admitted, the
operating system determines which one will have
access to the CPU at any particular moment.
This is short-term scheduling.
Context switches occur when a process is taken from
the CPU and replaced by another process.
Information relating to the state of the process is preserved
during a context switch.
13

8.2.3 Operating Systems Services

14

8.2.3 Operating Systems Services


Short-term scheduling can be nonpreemtive or
premptive.
In nonpreemptive scheduling, a process has use of
the CPU until either it terminates, or must wait for
resources that are temporarily unavailable.
In preemptive scheduling, each process is allocated
a timeslice. When the timeslice expires, a context
switch occurs.
A context switch can also occur when a higherpriority process needs the CPU.
15

8.2.3 Operating Systems Services


Four approaches to CPU scheduling are:
First-come, first-served where jobs are serviced in arrival
sequence and run to completion if they have all of the resources
they need.
Shortest job first where the smallest jobs get scheduled first.
(The trouble is in knowing which jobs are shortest!)
Round robin scheduling where each job is allotted a certain
amount of CPU time. A context switch occurs when the time
expires.
Priority scheduling preempts a job with a lower priority when a
higher-priority job needs the CPU.

16

8.2.3 Operating Systems Services


Factors that need to be considered during process scheduling
CPU utilization
Throughput - the total number of processes that complete their
execution per time unit.
Turnaround time - the total time between submission of a
process and its completion.
Response time - the amount of time it takes from when a request
was submitted until the first response is produced.
Waiting time - the equal CPU time to each process (or more
generally appropriate times according to each process' priority). It
is the time for which the process remains in the ready queue.
17

8.2.3 Operating Systems Services


Multitasking and multithreading allow programs to
be executed in parallel.
A thread is the smallest unit for scheduling.
A process can have one or several threads.
Threads share the same CPU registers and memory space
allocated to the same process.

Context switch is much cheaper


for threads
Scheduling needs to take care
of multiple processes, each of
which has multiple threads.
18

8.2.3 Operating Systems Services


Resource management: share resources among multiple
users
CPU, memory, and I/O
Scheduling for CPU sharing.

Memory management: Multiple programs residing in the


memory.
Programs broken into blocks.
Only load the necessary blocks for execution.

I/O sharing: OS performs I/O operations on behalf of user


processes.
Coordinates simultaneous user requests
Provides abstraction to user programs.
19

8.2.3 Operating Systems Services


Security and Protection: ensures that the system
resources are not accessed illegally or compromised by
intrusions.
Due to buggy software, or malicious attacks.

Objectives:
Concurrent processes must be protected from each other.
OS must be protected from user processes.

Protections provided by OS
Memory: each process runs in its own memory space.
I/O: user requests are performed by the OS.
Privacy: access control through login names and passwords.
20

8.3 Protected Environments


In their role as resource managers and protectors,
many operating systems provide protected
environments that isolate processes, or groups of
processes from each other.
Three common approaches to establishing protected
environments are virtual machines, subsystems,
and partitions.
These environments simplify system management
and control, and can provide emulated machines to
enable execution of programs that the system would
otherwise be unable to run.
21

8.3.1 Virtual Machines


Virtual machines (VMs) are a protected
environment that presents an image of itself -- or the
image of a totally different architecture -- to the
processes that run within the environment.
A virtual machine is a SW simulation of a real computer.

The underlying real machine is under the control of


the kernel. The kernel receives and manages all
resource requests emitted from processes running in
the virtual environment.
Software running inside a VM is limited to the
resources provided by that VM.
22

8.3.1 Virtual Machines


Different Oss can be
run on different VMs.
VMs can provide HW
not available on the
real machine.
Isolation from each
other.
Better crash recovery.
Provide platform
independent
programming env.
23

8.3.2 Subsystems and Partitions


Subsystems are another type of protected
environment.
A subsystem includes a subset of all system resources.

Subsystems partition large computer systems to make them


more manageable.

They provide logically distinct environments that can


be individually controlled and managed. They can be
stopped and started independent on each other.
If a subsystem is crashed, only the programs executing in it
are affected.

24

8.3 Protected Environments

25

8.3.2 Subsystems and Partitions


In very large computers, subsystems do not go far enough
to establish a protected environment.
Logical partitions provide much higher barriers:
Processes running within a logical partition have no
access to processes running in another partition unless a
connection between them (e.g., FTP) is explicitly
established.
Partitions do not share hardware resources.

Logical partitions are an enabling technology for the


recent trend of consolidating hundreds of small servers
within the confines of a single large system.

26

8.3 Protected Environments

27

Chapter 8 Conclusion
The proper functioning and performance of a
computer system depends as much on its
software as its hardware.
The operating system is the system software
component upon which all other software rests.
Operating systems control process execution,
resource management, protection, and security.
Subsystems and partitions provide compatibility
and ease of management.

28

End of Chapter 8

29

S-ar putea să vă placă și