Sie sind auf Seite 1von 41

Introductory Concepts in

Operating Systems
IT 221 Operating Systems

GILBERT R. HUFANA, MCS


Professor

Operating System

A program that acts as an intermediary between a


user of a computer and the computer hardware.
The software responsible for the management and
coordination of activities and the sharing of the
resources of the computer.
(http://en.wikipedia.org)
Use the computer hardware in an efficient manner.
Its job is to coordinate the execution of all other
software, mainly user applications.
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

Operating System
user
application
operating system
hardware
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

The Computer System

Hardware provides basic computing resources

CPU, memory, I/O devices

Operating system

Controls and coordinates use of hardware among


various applications and users

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

The Computer System

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

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

Computer System Organization

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

Von Neumann Architecture

All temporary computer


designs are based on VON
NEUMANN architecture
KEY CONCEPTS:

Data & instructions are stored in


a single read-write memory
Contents of memory are
addressable by location
Execution occurs in a sequential
fashion
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

Computer System Operation

I/O devices and the CPU can execute concurrently.


Each device controller is in charge of a particular
device type.
Each device controller has a local buffer.
CPU moves data from/to main memory to/from
local buffers
I/O is from the device to local buffer of controller.
Device controller informs CPU that it has finished
its operation by causing an interrupt.
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

Components of a Modern OS
Storage
Management

Process
Management

File
Management

User
Interface

Device
Management

Memory
Management

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

Process Management

The Operating System must ensure that each


running application (process) is treated fairly
in terms of processor time allocated in a
Multi-Tasking environment
The processor is maximally and efficiently
utilized

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

10

Storage Management

Disk storage is only one of the memory types


that must be managed by the operating
system, and is the slowest.
The operating system must balance the needs
of the various processes with the availability
of the different types of memory, moving data
in blocks (called pages) between available
memory as the schedule of processes dictates.
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

11

Memory Management

When an operating system manages the


computer's memory, there are two broad tasks
to be accomplished:

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.
The different types of memory in the system must be
used properly so that each process can run most
effectively.
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

12

Device Management

Managing input and output is largely a matter of


managing queues and buffers, special storage
facilities that take a stream of bits from a device

especially important when a number of processes are


running and taking up processor time

Ex.: OS instructs a buffer to continue taking input


from the device, but to stop sending data to the CPU
while the process using the input is suspended.

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

13

File Management

A method for storing and organizing


computer files and the data they contain to
make it easy to find and access them.
File systems uses data storage device such as
a hard disk or CD-ROM and involve
maintaining the physical location of the files

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

14

User Interface

An interface is a set of commands or menus through


which a user communicates with a program.
otherwise regarded as the shell

one of the most important parts of any program

used to indirectly issue commands which are the


handed on to the kernel
determines how easily you can make the program do what
you want.

Command-driven or Graphical User


DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

15

Operating System Services

User Interface
Program Execution
Resource Allocation
I/O Manipulation
Communication
Error Detection
Accounting
Protection and Security
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

16

OS Service: Program Execution

The system must be able to load a program


into memory and to run that program, end
execution, either normally or abnormally
(indicating error)

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

17

OS Service: Resource Allocation

When multiple users or multiple jobs running


concurrently, resources must be allocated to
each of them

Many types of resources - Some (such as CPU


cycles, main memory, and file storage) may have
special allocation code, others (such as I/O devices)
may have general request and release code.

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

18

OS Service: I/O Manipulation

A running program may require I/O, which


may involve a file or an I/O device

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

19

OS Service: Communication

Processes may exchange information, on the


same computer or between computers over a
network

Communications may be via shared memory or


through message passing (packets moved by the OS)

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

20

OS Service: Error Detection

OS needs to be constantly aware of possible


errors

May occur in the CPU and memory hardware, in I/O


devices, in user program
For each type of error, OS should take the appropriate
action to ensure correct and consistent computing
Debugging facilities can greatly enhance the users
and programmers abilities to efficiently use the
system
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

21

OS Service: Accounting

To keep track of which users use how much


and what kinds of computer resources
For what?

Basis for caching

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

22

OS Service: Protection & Security

The owners of information stored in a multi-user or


networked computer system may want to control use
of that information, concurrent processes should not
interfere with each other

Protection involves ensuring that all access to


system resources is controlled
Security of the system from outsiders requires user
authentication, extends to defending external I/O
devices from invalid access attempts.
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

23

System Calls

the mechanism used by an application program to


request service from the operating system
On Unix-based and POSIX-based systems, popular
system calls are open, read, write, close, wait, exec,
fork, exit, and kill.
Many of today's operating systems have hundreds of
system calls.
A typical way to implement this is to use a software
interrupt.
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

24

System Calls

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

25

System Call Implementation

Typically, a number associated with each system call

System-call interface maintains a table indexed


according to these numbers

The system call interface invokes intended system


call in OS kernel and returns status of the system call
and any return values
The caller need know nothing about how the system
call is implemented

Just needs to obey API and understand what OS will


do as a result call
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

26

System Call: An Illustration

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

27

OS Design & Implementation

Design and Implementation of OS not solvable,


but some approaches have proven successful
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
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

28

OS Design & Implementation

Affected by choice of hardware, type of system


Important principle to separate
Policy: What will be done?
Mechanism: How to do it?
Mechanisms determine how to do something,
policies decide what will be done

The separation of policy from mechanism is a very


important principle, it allows maximum flexibility if
policy decisions are to be changed later
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

29

OS Structures

Simple/Monolithic
Layered
Virtual Machine

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

30

OS Structure: Monolithic

Most primitive form of the OS


Practically no structure
Characterized by a collection of procedures that can
call any other procedure
All procedures must have a well-defined interface
Does not allow information hiding (private functions
for procedures)
Services provided by putting parameters in welldefined places and executing a system call.
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

31

OS Structure: Monolithic

Basic structure

Main program that invokes requested service procedures


Set of service procedures to carry out system calls
Set of utility procedures to help the service procedures

User program executes until

program terminates
program makes a service request
a time-out signal occurs
an external interrupt occurs
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

32

OS Structure: Layered

Organizes the OS as a hierarchy of layers -- one


above the other
THE system (1968) layers are organized as

Allocation of processor, switching between processes


Memory and drum management
Operator-process communication -- process and operator
console
I/O management
User programs
Operator
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

33

OS Structure: Layered

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

34

UNIX System Structure

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

35

OS Structure: Virtual 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
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

36

OS Structure: Virtual Machines

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

37

VMware Architecture

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

38

JVM

DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

39

OS Structure: Client-Server Model

User process (client) sends a request to server


process
Kernel handles communications between client and
server
Split OS into parts

File service
Process service
Terminal service
Memory service
DMMMSU-MLUC Institute of Information Technology, Center of Development in I.T.

40

End of Lecture
IT 221 Operating Systems

Any Question?

Das könnte Ihnen auch gefallen