nie – maharagama

45
06/13/22 1 NIE – Maharagama The main objective of this seminar / workshop is to endow with an in-depth subject knowledge to the participants who are supposed to teach the advanced level Information and Communication Technology subject in schools from year 2009. Therefore, the material provided should be used only as a general guide and not the ultimate source of information.

Upload: gellert-rendor

Post on 30-Dec-2015

47 views

Category:

Documents


0 download

DESCRIPTION

- PowerPoint PPT Presentation

TRANSCRIPT

Page 1: NIE –  Maharagama

04/19/23 1

NIE – MaharagamaNIE – Maharagama

The main objective of this seminar / workshop is to endow with an in-depth subject knowledge to the participants who are supposed to teach the advanced level Information and Communication Technology subject in schools from year 2009. Therefore, the material provided should be used only as a general guide and not the ultimate source of information.

The main objective of this seminar / workshop is to endow with an in-depth subject knowledge to the participants who are supposed to teach the advanced level Information and Communication Technology subject in schools from year 2009. Therefore, the material provided should be used only as a general guide and not the ultimate source of information.

Page 2: NIE –  Maharagama

Operating Systems

“An elephant is a mouse with an Operating System.” — Knuth

04/19/23 2

Page 3: NIE –  Maharagama

Basic Concepts

An OS is a software that controls and organizes the operations of a computer system while helping

execution of other programs and improving systems performance.

What is an OS?

OS is the software layer closest to the hardware of a computer which facilitates controlling and operating hardware and launching application programs and other systems utilities.

Introduction

The purpose of an OS is to run a computer smoothly and efficiently.04/19/23 3

Page 4: NIE –  Maharagama

First Generation

Simple Hardware

- Card Readers, Card Punch, Tape Readers, Line Printers

- Loading program

User (Programmer) Makes the Job Schedule

- Loading compiler

- Compiling

- Running

Inefficient

No requirement for an OS

04/19/23 4

Page 5: NIE –  Maharagama

Second Generation Simple Batch Systems

- User (Programmer) prepares job (Program & Data)

- Submits job to operator

Third Generation

Multiprogramming and Time-sharing concepts

- SPOOLing Used to speed up processing

Fourth Generation

OS for PCs, Workstations, Servers, Networks

Distributed Operating Systems.

Multiprocessing Operating Systems. Real Time Operating Systems.04/19/23 5

Page 6: NIE –  Maharagama

PC Operating Systems – Brief History

1976 Bill Gates and Paul Allen found Microsoft

1981 MS-DOS 1.0

1985 Windows 1.0

1990 Windows 3.1 and Windows for Workgroups 3.1

- 16-bit addressing- Real mode

- First Microsoft GUI operating system- Introduced protected mode

- Eliminated real mode, introduced enhanced mode- Added network support (LANs)

04/19/23 6

Page 7: NIE –  Maharagama

Contd. … 1992 Windows NT 3.1

– New Technology operating system– Created new corporate line– Focused on security and stability– NTFS (NT File System)– Eliminated direct access to memory– 32-bit addressing

1996 Windows NT 4.0– Moved graphics driver into kernel

1995 Windows 95

– 32-bit addressing– DirectX- Simulates direct access to hardware through API

04/19/23 7

Page 8: NIE –  Maharagama

1998 Windows 98

– Last purely consumer line desktop operating system– Does not boot in DOS mode

– Bundled Internet Explorer into operating system

2000 Windows ME

Contd. …

2001 Windows XP

2000 Windows 2000

– Last purely corporate line desktop OS– Active Directory– Kerberos- Enables single sign-on

– Merged consumer and corporate code bases– 64-bit support

04/19/23 8

Page 9: NIE –  Maharagama

Basic Design Goals User Goal - Convenience

Providing an ‘easy to use environment’ hiding all complexities from the user

System Goals

Efficiency - High Throughput, Low Turnaround time and Low response time

Throughput The number of jobs that can be executed in a unit time.

E.g. Multiprogramming provides a better use of CPU and I/O resources.

Multiprogramming – the ability to run more than one program at a time. Thus the utilization of fast devices and slow devices can be compromised.04/19/23 9

Page 10: NIE –  Maharagama

Improved Performance

- Effective use of computer’s resources

The interval from the time of submission of a job to the time of completion.

Turnaround Time

Response time - The amount of time taken to start responding.

Scalability

- The ability to cater for the advancement of the technology by allowing new hardware and methodologies.

Availability

- The ability to accept and successfully process an individual job or a large number of jobs concurrently.

04/19/23 10

Page 11: NIE –  Maharagama

Reliability

- The ability to work with a minimum of failures.- The consistence with which a result can be produced.

Serviceability

Early discovery of troubles

Searching for faulty areas and isolating them

Diagnosing troubles Monitoring overloads Providing security

- Includes on-line diagnosis and repair of malfunctions concurrent with normal job execution.

04/19/23 11

Page 12: NIE –  Maharagama

Portability

- Will the operating system be portable to widely varying types of hardware platforms?

Backward Compatibility and Emulation

- Is it important that software that ran under previous operating system versions or under different operating systems be supported?

Security

- Includes on-line diagnosis and repair of malfunctions concurrent with normal job execution.

04/19/23 12

Page 13: NIE –  Maharagama

Two Layer Model

Kernel

Shell

Resident part of the operating system.

Memory management

Task management

Disk management

Process management

The interface that accepts, interprets and executes user commands or programs. 04/19/23 13

Page 14: NIE –  Maharagama

SHELL

Communicates with kernel

UserCommunicates with the Shell

KERNELProvides

Services by processing all system calls

KERNELProvides

Services by processing all system calls

User Interaction

Kernel is protected from user access

04/19/23 14

Page 15: NIE –  Maharagama

Operating System Architecture

Today’s OSs are complex because they provide many services and support a variety of H/W

OS architecture can help the designers to keep it simple as possible by organizing the OS components.

One of the earliest architecture is Monolithic Architecture. E.g. OS/360, VMS, Linux, UNIX

Every OS component is contained in the kernel and can communicate with each other directly. This feature makes the OS efficient.

04/19/23 15

Page 16: NIE –  Maharagama

SYSTEMS CALL INTERFACE

Memory Manager

Scheduler

I/O Manager

Network Manager

File System

APPLICATIONS

Monolithic Architecture

KERNEL

USER SPACE

KERNEL SPACE

04/19/23 16

Page 17: NIE –  Maharagama

Layered Architecture When the Operating Systems become complex

monolithic designs become unmanageable. OS functions are grouped into layers and each layer

is assigned some specific functions.

Layered architectures promote modular designs.

A module is highly cohesive and the coupling between two adjacent modules is loose.

A modular design helps improving the structure and consistency of an Operating System. Debugging, updating, validation etc. becomes much easy.

A layer in between can communicate with the layer above and below. 04/19/23 17

Page 18: NIE –  Maharagama

Performance degrades as intercommunication among components is not direct.

Each module hides its functional complexity to others and provides a standard interface to communicate with other components.

APPLICATION LAYER

IO MANAGEMENT

INTER PROCESS COMMUNICATION

MEMORY MANAGEMENT

PROCESSOR ALLOCATION & PROCESS SCHEDULING

HA

RD

WA

RE

LAYER 1

LAYER 5

LAYER 4

LAYER 3

LAYER 2

USER

SPACE

KERNEL

SPACE

04/19/23 18

Page 19: NIE –  Maharagama

Microkernel Architecture

Kernel is small and provides a small number of services.

SYSTEMS CALL INTERFACE

APPLICATIONS

US

ER

SP

AC

E

FILE SYSTEM

PROCESS SCHEDULER

DEVICE MANAGER

MEMORY MANAGEMENMT

SYNCHRONIZATION

INTERPROCESS COMMUNICATION

KERNEL

Provides a high degree of modularity.

Components such as Process management, File system, Networking and IO are kept outside the kernel.

E.g. Some versions of Linux, Windows XP

KE

RN

EL

S

PA

CE

04/19/23 19

Page 20: NIE –  Maharagama

Microkernel Architecture

MONOLITHIC KERNEL MICRO KERNEL

Structured, Open, Modular – SW Eng. Techniques can be adapted.

Small kernel, Easy debug

Lack of structure – SW Eng. Techniques cannot be adapted

Re-implementing means rebuilding.

High performance

Daunting, poor performance during inter communication

Needs lot of memory to load

Large kernel, difficult to debug.

04/19/23 20

Page 21: NIE –  Maharagama

Single User Single Task Operating Systems.

Types of Operating Systems

Single User Multi Task Operating Systems.

Multi-processing Operating Systems.

Multi User OS Operating Systems.

Real time OS Operating Systems.

Multi-threading Operating Systems.

Multi-programming Operating Systems.

04/19/23 21

Page 22: NIE –  Maharagama

Only one user can use it and perform only one application at a time

Single User Single Task Operating Systems.

Examples:MS-DOS – IBM PC

Palm OS - PDA

Symbian OS – Mobile phone

A single user performs varieties of tasks simultaneously.

Single User Multi Task Operating Systems.

Examples:

MS Windows MAC OS04/19/23 22

Page 23: NIE –  Maharagama

In preemptive multitasking, the operating system divides the CPU time into slots and each program is

permitted to execute during its own time slot.

There are two basic types of multitasking:

At the end of the time slot, the currently executing task is suspended and the next task in the queue is started or resumed.

Multi Tasking

Preemptive Multitasking

1. Preemptive 2. Cooperative.

The operating system switches between tasks quickly, giving the user the impression that more than one task is performed simultaneously

04/19/23 23

Page 24: NIE –  Maharagama

In cooperative multitasking, each program can use the CPU for as long as it needs it.

If a program is not using the CPU, it may allow another program to use it temporarily.

Microsoft Windows 3.x

Example:

Windows 95, Windows NT, OS/2 and UNIX

Examples:

Allocation of priorities to programs is also possible so that high priority programs can preempt the low priority programs.

Cooperative Multitasking

04/19/23 24

Page 25: NIE –  Maharagama

Multi-User Operating Systems

Many users access server and share resources

Examples:

UNIX

Windows 2003 Server

Operating Systems of Mainframes and Super computers

More than one user can log on to the system at the same time.

04/19/23 25

Page 26: NIE –  Maharagama

Slow I/O devices put the CPU to wait states.

Multi-programming allows loading several programs into memory and making the CPU available to another program while one program is waiting for completion of its I/O request.

Supports running several programs in the same machine at the same time.

Multi Programming Operating Systems

The idea is to use the CPU effectively.

04/19/23 26

Page 27: NIE –  Maharagama

0 10

I/O

30 50ms70 90 100

CPU

CPU I/O CPU I/O

10 ms 30 ms 20 ms 40 ms

Program A

I/O CPU I/O CPU

10 ms 30 ms 20 ms 40 ms

Program B

0 10

I/O

30 50ms70 90 100

CPU

Uni - programming Multi - programming04/19/23 27

Page 28: NIE –  Maharagama

Supports running a program on more than one CPU.

Multi-Processing Operating Systems.

Multi-Threading Operating Systems.

In most operating systems, there is a one-to-one relationship between the task and the program.

Some operating systems allow a program to be divided into multiple tasks and run concurrently. Such systems are called multithreading operating systems.

04/19/23 28

Page 29: NIE –  Maharagama

Real Time Operating Systems. (RTOS)

Responds to input instantly.

Operating Systems used in

Industrial Process control computers

They require minimal user interaction

Robotic Devices

Automobiles

Some home appliances

Examples:

Scientific Instruments04/19/23 29

Page 30: NIE –  Maharagama

Short for Virtual Memory System, a multi-user, multitasking, virtual memory operating system that runs on DEC's VAX and Alpha lines of minicomputers and workstations. VMS was introduced in 1979 along with the first VAX minicomputer. Like the VAX itself, VMS has undergone many changes over the years. DEC now refers to it as OpenVMS.

VMS

An execution mode supported by the Intel 80286 and later processors. In real mode, these processors imitate the Intel 8088 and 8086 microprocessors, although they run much faster.

Real mode, Protected Mode and Virtual Mode

The other mode available is called protected mode. In protected mode, programs can access extended memory and virtual memory. Protected mode also supports multitasking. .

04/19/23 30

Page 31: NIE –  Maharagama

DirectX

A set of APIs developed by Microsoft that enables programmers to write programs that access hardware features of a computer without knowing exactly what hardware will be installed on the machine where the program eventually runs.

The DOS was not designed to take advantage of protected mode, so it always executes programs in real mode unless a protected mode extender is run first.

The 80386 and later microprocessors support a third mode called virtual 8086 mode. In virtual mode, these microprocessors can run several real-mode programs at once

04/19/23 31

Page 32: NIE –  Maharagama

DirectX achieves this by creating an intermediate layer that translates generic hardware commands into specific commands for particular pieces of hardware. In particular, DirectX lets multimedia applications take advantage of hardware acceleration features supported by graphics accelerators.

A new directory service from Microsoft that will be part of Windows NT 5.0.

Active Directory

A network service that identifies all resources on a network and makes them accessible to users and applications.

Directory Service

04/19/23 32

Page 33: NIE –  Maharagama

Resources include e-mail addresses, computers, and peripheral devices such as printers. Ideally, the directory service should make the physical network topology and protocols transparent so that a user on a network can access any resource without knowing where or how it is physically connected.

Kerberos is a network authentication protocol. It is designed to provide strong authentication for client/server applications by using secret-key cryptography developed at Massachusetts Institute of Technology (MIT)

Kerberos

04/19/23 33

Page 34: NIE –  Maharagama

General Functions of an Operating System

1. Processor Management

Controlling processes and applications access of CPU so that each has its fair share.

OS has to ensure that each process and application receives enough of the processor's time to function properly.

Use as many processor cycles for jobs as are possible.

04/19/23 34

Page 35: NIE –  Maharagama

The basic unit of software that the operating system deals with in job scheduling is either a process or a thread (depends on the OS)

Process / Thread

Therefore a process, is considered as a software that performs some action and can be controlled by a user, by other applications or by the operating system.

A process was simply regarded as an application that is running. But it is not always true. An application may cause several other processes to begin.

04/19/23 35

Page 36: NIE –  Maharagama

Controls the different types of memories for the allocation of space to applications.

2. Memory Management

O/S makes sure that instructions and corresponding data are in the RAM for the CPU to process.

If RAM capacity is not enough, the O/S should borrow space from the hard disk. The process of borrowing space from the hard disk to

increase the capacity of RAM is called virtual memory

04/19/23 36

Page 37: NIE –  Maharagama

The condition of excessive paging is called thrashing, making the computer very slow

Later, if this data contained in the swap file is needed, the O/S stores it back in the RAM

(Page). The process of is called paging.

The O/S swaps out data from the RAM that is not currently needed and stores it in a swap file.

04/19/23 37

Page 38: NIE –  Maharagama

Manages the Disk, file storage facilities.

3. Storage Management

Disk Management.

File Management.

- Basic Directory and File Operations.

Create, Open, Close, Read, Write

Attributes

Security, Access rights

Partitioning

Formatting, Boot area, FAT, Inode tables

Copy, Paste, Rename, Join, Move, Delete

- Basic Disk Operations.

04/19/23 38

Page 39: NIE –  Maharagama

Controls devices, mainly through their drivers.

4. Device Management

Managing input and output is largely a matter of managing queues and buffers. E.g. KB

Device drivers translate the commands of a device to commands that the O/S understands and vice versa Plug and Play

- A software and hardware standard

- A user can plug a device into a port and the O/S recognizes the device and its driver immediately.

04/19/23 39

Page 40: NIE –  Maharagama

5. Interface Management

User Interface

OS provides a set of routines, protocols, and tools for building software applications. A good API makes it easier for a programmer to develop a program by providing all the building blocks.

Junction between a user and a computer program.

1. Command Driven Interface

Three types.

2. Menu Driven Interface

3. Graphical User Interface

Application Interface

04/19/23 40

Page 41: NIE –  Maharagama

A menu-driven interface is one in which you select choices from various menus displayed on the screen.

Provides facilities to use a set of commands through which a user communicates with the OS

Menu Driven Interface

Command Driven Interface

A user interface (GUIs) that use windows, icons, and pop-up menus and a pointing device such as a mouse to manipulate them.

Graphical user interface

04/19/23 41

Page 42: NIE –  Maharagama

6. Interrupt Handling

7. Enabling Multi-access

8. Deadlock Handling

9. Security Management

04/19/23 42

Page 43: NIE –  Maharagama

Multitasking:Controls timing of eventsExample

You are typing and at the same time you want to printThe OS receives an interrupt that a job needs to be sent to the printerThe OS puts into a stack the job currently being processed by the CPUThe CPU processes the printer request by sending the data to the printerThe CPU goes back to the stack and retrieves the job that was being processed beforeIf the printer is busy, the OS puts the job into a bufferA program, called spooler, will tell the OS that the printer is free to process new requests

04/19/23 43

Page 44: NIE –  Maharagama

Application Program Interfaces (API)Blocks of code that the application software can use in order to interact with the CPU These blocks are built into the O/SSo, instead of building these blocks into every application, the code is built only once into the O/S

04/19/23 44

Page 45: NIE –  Maharagama

04/19/23 45