Top Banner
IT Systems Operating System EN230-1 Justin Champion C208 – 3273 www.staffs.ac.uk/personal/engineering_and_techno logy/jjc1
24

IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

Dec 20, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT SystemsOperating SystemEN230-1

Justin Champion

C208 – 3273www.staffs.ac.uk/personal/engineering_and_technology/jjc1

Page 2: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

ContentsWhat is it?

• Why are they there• Functionality which is given by the OS

Page 3: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Most Computers have this in some form Famous Examples

• Microsoft Windows• Linux• Unix• Apple Panther

Some you pay for some are free A operating system (OS) is large program which controls the hardware

and software on a device Computers which have limited functionality do not need a OS

Page 4: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

What does the OS do At the most simplest

• Controls the use of the hardware• Memory• Processor• Interfaces

• Controls the software which runs on the machine• CPU time allocated• Allowing multiple application to run at once, ensuring that they all

get a fair share of the available resources• Allows a programmer to create software without worrying about

the underlying hardware• The hardware is abstracted away from the programmer.

Instructions sent to a piece of hardware will be converted to the correct format

Page 5: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Types of OS Single user Multi-Tasking

• Windows and Linux are examples of this, with multiple things happening at once

• Printing whilst writing a document

Single-user, Single Task• Only one user using the device accessing one item at a time.

• There are not many of these operating system available now

Multi user, Multi-Tasking• Multiple users carrying out a large number of tasks at once

• Windows server edition and UNIX is an example of this

There are other types of OS• Real-Time OS, etc

Page 6: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Starting the machineThe BIOS carries out its interactions

• BIOS Basic Input Output System (BIOS)• Discussed in last weeks lecture

The hard disk is accessed looking for a small program

• This is called the bootstrap• This is located on the hard disc at track zero , head zero,

sector one• In modern motherboards/BIOS the hard disc to boot

from can be selected or can be a CD-ROM

Page 7: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

BootstrapThis small program takes responsibility for

locating the main operating system• It will allocate an area of memory• Load a limited number of drivers to control hardware• Once located it will start the loading of the OS will

begin• Control is then handed to the OS

Page 8: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

The OS Then loads the Kernel

• Microsoft has a kernel as well as Linux• It is just that Linux push the term Kernel more

Kernel is a piece of software which remains in memory• It takes control of

• Memory Management• Task Management• Process Management• Disc Management

Size• As the kernel remains in memory it is essential that it is small

Page 9: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

ShellThis is the software which interacts with the

Kernel

Kernel

GUI ShellCommand Line

Shell

Hardware

Page 10: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

What the OS doesProcess Management

• A process is a small program which needs access to the CPU.

• A single process may generate several processes• Example would be Microsoft Word

• Each of these processes will need access to the processor and memory

Page 11: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Multitasking OS on a single CPUThis is where more than one task can appear to

take place at once• Only one thing can be done by a processor at any

time• To allow the effect of multiprocessing on a single processor

• Process are swapped in and out of memory• The work being stored on the stack• This can the be retrieved later

• The process manager of the OS allocates a number of CPU cycles to the process

• After this all of the settings and position the process is stored and another process can use the CPU

Page 12: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Single task OS These are easier to create They in theory will work on a single task until it is

complete and then start the next• In reality there are certain conditions that the processor must

respond to.• The processor is informed another process needs the processor by

a interrupt.

• Consider a interrupt as a signal to indicate to the CPU to look at it.

• It is the same as in a lecture whilst the lecturer is talking if someone stands up.

• The lecture will stop talking and look at the student waiting for information

Page 13: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Interrupts Interrupts can be generated by hardware or software

• A standard PC has 15 hardware and 255 software interrupts• A lot of the hardware interrupts are defined and set

IRQ Number Description IRQ Number Description

0 System Timer 8 Real-Time Clock

1 Keyboard 9 Open

2 Cascade Interrupt 10 Open

3 Second Serial port 11 Open

4 First Serial Port 12 PS2 mouse

5 Sound Card 13 Floating point unit

6 Floppy Disk Controller 14 Primary IDE hard disc

7 Parallel Port 15 Secondary IDE hard disc

Page 14: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Interrupt typesThe processor does not have to respond to

all interrupts• Some interrupts can be Masked

• This indicates that the processor can ignore them• A keyboard interrupt for example, this can wait until a

suitable time

• Non maskable interrupts indicate that these must be dealt with quickly

• A Memory error is a example of this

Page 15: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Multitask operating systems If we have more than one process on a machine

hardware must be shared• This give the opportunity for more than one process to

request a single resource, like the hard disc• If process A requires the hard disc and tries to write to a

file• Process B then gets access to the CPU and requires the

hard disc trying to write a file locks the hard disc, but can not get access to it because process A has it

• Now two processes have both locked the hard disc, neither of them able to do anything

• This is referred to as Deadlock

Page 16: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

DeadlockThe system will appear to have crashed if

this occurs• The system has not crashed just nothing useful

can be done• The software itself or the OS needs to deal with this

condition

• Other condition to prevent is Live lock

Page 17: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Live lock Process A wants to write to the hard disc

• Process B requests to write to the hard disc• Process A releases the hard disc• Process B now gain access to the hard disc• Process A requests the hard disc• Process B releases the hard disc• Process A gets the hard disc• Process B requests the hard disc• Etc, etc, etc.

No work is actually done As each device gets the device something else requests it

• This is referred to as Live lock, where processes are continuously changing but no useful work is actually done

Page 18: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Methods of dealing with these conditionsSemaphore

• A variable is set which is set to indicate that a resource is being used at a time

• Once this variable is returned to a state where no one is using it the next device can request access to the device and then set the semaphore to busy again

Management of the processes

Page 19: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Management of the processesManaging the processes prevent problemsAll resources can be given a number

• The processes which then request the resource must request them in order

• All resource request must be done at the beginning of the processes life

• In this respect if all of the resources can be granted the process can wait

Page 20: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Management of the processesIn the event of a problem

• Rollback• Roll the processes back to a point where this condition did

not occur• Easier said than done

• Kill the process• Making it restart and request the resources again

• Pre-emption• Forcibly remove a resource from one of the processes

Page 21: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Multitasking OS Each of the processes is given a limited amount of time

with the processors• When it is the turn of a new task the current state and data of

the process is saved and the new process is loaded into the CPU

• If the number of CPU cycles which are allocated to each task is too small then most of these are wasted swapping into the processor

• This is referred to as thrashing, were no real work is done• If too many CPU cycles are allocated to each process then the

machine will appear to be running slowly as it will have to wait for each process to get a turn at the processor

• The processor management part of the OS needs to balance these requirements.

Page 22: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

Memory ManagementPhysical memory

• Is a finite resource• Ensures that the current application is in main

memory

Managing the Virtual Memory• As required, some data will be moved out of

memory into Virtual memory on the hard disk

Page 23: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems

LinksMicrosoft discussion of the Windows XP Kernel

functionality• msdn.microsoft.com/msdnmag/issues/01/12/

XPKernel/default.aspx

Page 24: IT Systems Operating System EN230-1 Justin Champion C208 – 3273 .

IT Systems Summary of what we have discussed

What A OS is BIOS What the OS does

• Process Management• Dead Locks• Live Locks

Memory Management