+ All Categories
Home > Documents > Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions...

Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions...

Date post: 24-Apr-2020
Category:
Upload: others
View: 9 times
Download: 0 times
Share this document with a friend
38
Operating Systems Operating Systems Fall 2008 Fall 2008 Tiina Niklander Tiina Niklander
Transcript
Page 1: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Operating SystemsOperating Systems

Fall 2008Fall 2008

Tiina NiklanderTiina Niklander

Page 2: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Distributed Systems andDistributed Systems and NetworkingNetworkingspecialization areaspecialization area

Page 3: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Distributed Systems and NetworkingDistributed Systems and Networking

Bachelor level: basic communication & protocols, concurrency concepts,security, computer organisation

Master level: Operating systems, distributed systems, networking,

Interoperable

Distributed

Networking

Operating system

Hardware

Interoperable

Distributed

Networking

Operating system

Hardware

Page 4: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

MaterialMaterial

Course book:Course book: A.S.A.S. TanenbaumTanenbaum,, ModernModernOperating Systems, 3rd. ed.Operating Systems, 3rd. ed., Prentice, Prentice--Hall, 2007Hall, 2007

Any other large OS book, f.e. Stallings, Silbershatz, or Deitel,Any other large OS book, f.e. Stallings, Silbershatz, or Deitel,should be feasible alternativeshould be feasible alternative

Lectures & exercises on the course web pageLectures & exercises on the course web pagehttp://www.cs.helsinki.fi/u/niklande/opetus/kj/http://www.cs.helsinki.fi/u/niklande/opetus/kj/

Page 5: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Course structureCourse structure

1: Overview1: Overview2: Processes and Threads2: Processes and Threads3: Virtual Memory and3: Virtual Memory andPagingPaging4: Page4: Page ReplacementReplacement5: Segmentation5: Segmentation6: File6: File Systems, partSystems, part 117: File Systems, part7: File Systems, part 22

Tanenbaum: SectionsTanenbaum: Sections 1,2,3,41,2,3,4

8: I/O8: I/O ManagementManagement9: Multiple9: Multiple ProcessorProcessorSystemsSystems1010: Example: Linux,: Example: Linux,Windows, SymbianWindows, Symbian11:11: Design IssuesDesign Issues12:12: Recapitulation, hintsRecapitulation, hintsfor examfor exam

,,5,8,10,11,12,13,145,8,10,11,12,13,14

Page 6: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

ScheduleSchedule

Lectures (in Finnish) twice a weekLectures (in Finnish) twice a weekRead the book carefully,Read the book carefully,Focus on mastering the points given in slidesFocus on mastering the points given in slides

Exercises once a weekExercises once a weekProblems available one week beforeProblems available one week beforeMust be solved in advance, that is BEFORE theMust be solved in advance, that is BEFORE themeeting (not during it!)meeting (not during it!)

One weekly problem to be submitted on paperOne weekly problem to be submitted on paperEXAMEXAM: Wed 15.10. 16.00: Wed 15.10. 16.00

Page 7: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Operating SystemOperating SystemOverviewOverview

Page 8: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

8

IntroductionIntroduction

A computer system consists ofA computer system consists ofhardwarehardwaresystem programssystem programsapplication programsapplication programs

Page 9: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

9

Main Tasks of OperatingMain Tasks of Operating SystemSystem

Provide abstractionsProvide abstractionsAbstractions (like file,Abstractions (like file, address space)address space) to user programsto user programsImplement and manage the abstract objectsImplement and manage the abstract objectsHideHide thethe ugly and messyugly and messy detailsdetails inin thesethese

Manage resourcesManage resourcesMultiplexingMultiplexing in time and in space!in time and in space!Each program gets time with the resourceEach program gets time with the resourceEach program gets space on the resourceEach program gets space on the resourceOptimize the hardware usage to improve performanceOptimize the hardware usage to improve performance

Page 10: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Concepts (Abstractions)Concepts (Abstractions)

ProcessProcessIs a container that holds all information needed to run aIs a container that holds all information needed to run aprogramprogramProcess table entry contains all process related infoProcess table entry contains all process related info

Address SpacesAddress SpacesMemory locations 0..MAX available for one processMemory locations 0..MAX available for one processProtected from each otherProtected from each other

FileFileDirectories to contain files: working directory, pathDirectories to contain files: working directory, pathFile descriptorFile descriptorFileFile systemsystem

Page 11: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

OS structureOS structureUser

Devices and device drivers

Applications System programsShell

I/O module(Device controller)

Interrupt handling

Process management

I/O management

Memorymanagement

File systemblocks

System calls

protection

Resource management

Page 12: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

HardwareHardware

Page 13: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Computer HardwareComputer Hardware ReviewReview

Set of instructionsSet of instructionsRegistersRegisters

Program counterProgram counterStack pointerStack pointerProcess Status Word (PSW)Process Status Word (PSW)

Kernel mode vs User modeKernel mode vs User modeSystem call (service call, trap)System call (service call, trap)

13

Monitor

Page 14: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

14

InterruptsInterrupts

I/O deviceI/O device controllercontroller provides a clean interface to the deviceprovides a clean interface to the deviceDeviceDevice driverdriver is the software that communicates with controlleris the software that communicates with controllerInterruptInterrupt is the way for controller to inform driver about statusis the way for controller to inform driver about statuschangechange

Page 15: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Sta Fig 1.11

Returnfrominterrupt

Startinterruptprocessing

Interrupt in detailsInterrupt in details

Page 16: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Memory hierarchyMemory hierarchy

Pentium 4 cache:8 KB data, 12 KB code/text, external 256 KB

nano = 10-9, micro = 10-6, milli = 10-3

Page 17: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

LLocality of referenceocality of referenceSpatial and temporal locality:Spatial and temporal locality:

For example in a loop a small set of instructions isFor example in a loop a small set of instructions isexecuted several timesexecuted several timesCertain part of code only uses a small set ofCertain part of code only uses a small set ofvariables (data)variables (data)

When program makes a memory reference (data orWhen program makes a memory reference (data orinstructions), it is likely to refer again to the sameinstructions), it is likely to refer again to the samelocation or a location near bylocation or a location near by

This is the principle behind the usage of cachesThis is the principle behind the usage of caches

Page 18: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

18

Computer HardwareComputer Hardware ReviewReview

Structure of a large PentiumStructure of a large Pentium system:system:multiple busesmultiple buses

Page 19: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

System callsSystem calls

Page 20: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Systems callsSystems calls

IInterface between usernterface between userprograms and OSprograms and OSdealing with abstractionsdealing with abstractionsSpecial kind ofSpecial kind ofprocedure call: switchprocedure call: switchbetween user and kernelbetween user and kernelmodemodeTrap into kernel andTrap into kernel andinvoke OSinvoke OS

System call

Interrupt

Page 21: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

read(read(fdfd, buffer,, buffer, nbytesnbytes)) Tan08 1Tan08 1--1717

Page 22: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

22

POSIX: SomePOSIX: Some System Calls ForSystem Calls ForProcess and File ManagementProcess and File Management

Page 23: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

23

POSIX: SomePOSIX: Some System Calls ForSystem Calls ForDirectory Management and MiscDirectory Management and Misc

Page 24: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

A stripped down shellA stripped down shell Tan08 F.1Tan08 F.1--1919

”Riisuttu” komentotulkki

Page 25: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

25

Some Win32 API CallsSome Win32 API Calls

Page 26: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Operating SystemOperating SystemStructuresStructures

Page 27: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Some examplesSome examples

Monolithic SystemMonolithic SystemLayered SystemLayered SystemMicrokernelMicrokernelClientClient--Server ModelServer ModelVirtual MachinesVirtual MachinesExokernelsExokernels

Page 28: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

MonolithicMonolithicSystemsSystems

Whole OS as one program in kernel modeWhole OS as one program in kernel modeCollection of procedures, linked togetherCollection of procedures, linked together

Basic structure of a monolithic systemBasic structure of a monolithic systemMain program invokes requested service procedureMain program invokes requested service procedureService procedures carry out the system callsService procedures carry out the system callsUtility procedures help service proceduresUtility procedures help service procedures

There might be loadable extensionsThere might be loadable extensions

Page 29: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

LayeredLayeredsystemssystems

Generalization of the procedure approachGeneralization of the procedure approachEach layer has specific tasksEach layer has specific tasksExample: THE systemExample: THE system

The layers mainly a design aidThe layers mainly a design aid

Structure of the THE operating system

Page 30: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

MicroMicro--kernelkernel

Split the OS to small, wellSplit the OS to small, well--defined modulesdefined modulesOnly the microkernel module runs in kernel modeOnly the microkernel module runs in kernel modeOther modules run in user modeOther modules run in user modeGoal: increase availabilityGoal: increase availability

A buggy driver cannot crash the whole computerA buggy driver cannot crash the whole computerMINIX has reincarnation server to automatically replaceMINIX has reincarnation server to automatically replacefailed modulefailed module

Disadvantage:Disadvantage:A lot of mode switches within OS itselfA lot of mode switches within OS itself

Page 31: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

ClientClient--Server ModelServer Model

ClientClient--server model is an abstraction that can be usedserver model is an abstraction that can be usedon single computer or networked computerson single computer or networked computersClients send message saying what it wants over networkClients send message saying what it wants over networkor e.g. using microkernelor e.g. using microkernel

Page 32: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Virtual machinesVirtual machines

Virtual machine abstraction was designed 40 years agoVirtual machine abstraction was designed 40 years agoBasic idea:Basic idea:

Virtual machine monitor does multiplexing of the virtualVirtual machine monitor does multiplexing of the virtualmachinesmachinesEach virtual machine is ‘exact’ copy of the bare hardware andEach virtual machine is ‘exact’ copy of the bare hardware andhas its own OS and applicationshas its own OS and applications

Structure of VM/370 with CMS

Page 33: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

Virtualization todayVirtualization today

Virtual machine monitor renamed asVirtual machine monitor renamed as hypervisorhypervisor

JavaJava virtual machine uses thevirtual machine uses the virtualization abstractionvirtualization abstractionfor codefor code portabilityportability

(a) Type 1 hypervisoron top of hardwaremultiplexall OS in parallel

(b) Type 2 hypervisoron top of host OSmultiplexonly guest OSes

Page 34: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

ExokernelsExokernels

Partitioning of the machinePartitioning of the machineEach virtual machine gets only a subset of theEach virtual machine gets only a subset of theexiting resources (not the image of the wholeexiting resources (not the image of the wholemachine)machine)

Page 35: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

C and Metric UnitsC and Metric Units

MustMust be able to use:be able to use:Reading CReading C--codecode examplesexamplesUnitUnit conversionsconversions

Page 36: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

History of OperatingHistory of OperatingSystemsSystems

Page 37: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

37

History of Operating SystemsHistory of Operating Systems(1)(1)

Early batch systemEarly batch systembring cards to 1401bring cards to 1401read cards to taperead cards to tapeput tape on 7094 which does computingput tape on 7094 which does computingput tape on 1401 which printsput tape on 1401 which prints outputoutput

Page 38: Operating Systems Main Tasks of OperatingMain Tasks of Operating System System Provide abstractions Abstractions (like file,Abstractions (like file, address space) address space) to

38

History of Operating SystemsHistory of Operating Systems(2)(2)

First generation 1945First generation 1945 -- 19551955vacuum tubes, plug boardsvacuum tubes, plug boards

Second generation 1955Second generation 1955 -- 19651965transistors, batch systemstransistors, batch systems

Third generation 1965Third generation 1965 –– 19801980ICs and multiprogrammingICs and multiprogramming

Fourth generation 1980Fourth generation 1980 –– presentpresentpersonal computerspersonal computers


Recommended