Top Banner
Operating Systems OPERATING SYSTEMS: Lesson 1: Introduction to Operating Systems 1 Jesús Carretero Pérez David Expósito Singh José Daniel García Sánchez Francisco Javier García Blas Florin Isaila
51

OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

Oct 18, 2019

Download

Documents

dariahiddleston
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: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

OPERATING SYSTEMS:

Lesson 1:Introduction to Operating Systems

1

Jesús Carretero PérezDavid Expósito Singh José Daniel García SánchezFrancisco Javier García BlasFlorin Isaila

Page 2: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

WhystudyOperatingSystems?

a) OS,anditsinternals,largelyinfluencesgeneralfunctioning,includingsecurityandperformance.

b) ImportanceofOSchoiceinanorganizationishigherandhigher.Trendtostrategicdecision.

c) Knowledgefundamentaltodevelopapplicationsifgoodperformanceisdesiredandtounderstandcausesofmanyproblems.

2

Page 3: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

UnderstandingOS

• WhichOStakesbetteradvantageofagivensystemcapabilities?

• DoestheOSsupportallthedevicesIintendtoconnecttothecomputer?Ifnot,whatcanIdo?

• Isitsecureenoughfortheenvironmentitwillbeintegratedin?

• Willmyapplicationsrun«smoothly»onthechosenOS?Howwillmyconcreteworkloadadapttotheplatform?

3

Page 4: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Tomaketherightchoice

• IsiteasytofindadminsforthisOS?Isadministrationanobscure taskneedingultra-specializedpersonnel?

• WhatsupportdoestheOShave?Whichistheupdatepublishingrate?

• Besidescost,whatfutureexpectationsdoesithave?

4

Protect your investment

Page 5: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Todevelopsoftwarewithgoodperformance

5

• SoftwareneedsOSservicesformaytasks.– WhatservicesdoestheOSofferandhowdoIinvokethem?

• Totakeadvantageofnewarchitecturesmultithreadingisessential.– HowdoIdevelopamultithreadedapplicationformyOS?

Page 6: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Anengineermustbe

6

OPERATING SYSTEMAGNOSTIC

Page 7: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

FourComponentsofaComputerSystem

7

Page 8: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

ComputerSystemStructure

• Computersystemcanbedividedintofourcomponents– Hardware– providesbasiccomputingresources

• CPU,memory,I/Odevices– Operatingsystem

• Controlsandcoordinatesuseofhardwareamongvariousapplicationsandusers

– Applicationprograms– definethewaysinwhichthesystemresourcesareusedtosolvethecomputingproblemsoftheusers• Wordprocessors,compilers,webbrowsers,databasesystems,videogames

– Users• People,machines,othercomputers

8

Page 9: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

ComputerSystemOrganization

• Computer-systemoperation– OneormoreCPUs,devicecontrollersconnectthroughcommonbus

providingaccesstosharedmemory– ConcurrentexecutionofCPUsanddevicescompetingformemory

cycles

9

Page 10: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

HowaModernComputerWorks

10

Page 11: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Computer-SystemOperation

• I/OdevicesandtheCPUcanexecuteconcurrently• Eachdevicecontrollerisinchargeofaparticulardevicetype

• Eachdevicecontrollerhasalocalbuffer• CPUmovesdatafrom/tomainmemoryto/fromlocalbuffers

• I/Oisfromthedevicetolocalbufferofcontroller• DevicecontrollerinformsCPUthatithasfinisheditsoperationbycausinganinterrupt

11

Page 12: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

InterruptTimeline

12

Page 13: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

CommonFunctionsofInterrupts

• Interrupttransferscontroltotheinterruptserviceroutinegenerally,throughtheinterrupt vector,whichcontainstheaddressesofalltheserviceroutines

• Interruptarchitecturemustsavetheaddressoftheinterruptedinstruction

• Incominginterruptsaredisabled whileanotherinterruptisbeingprocessedtopreventalostinterrupt

• Atrap isasoftware-generatedinterruptcausedeitherbyanerrororauserrequest

• Anoperatingsystemisinterruptdriven

13

Page 14: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

InterruptHandling

• TheoperatingsystempreservestheCPUstatebystoringregistersandtheprogramcounter

• Determineswhichtypeofinterrupthasoccurred.• Separatesegmentsofcodedeterminewhatactionshouldbetakenforeachtypeofinterrupt

14

Page 15: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

I/OStructure

• AfterI/Ostarts,controlreturnstouserprogramonlyuponI/Ocompletion– AtmostoneI/Orequestisoutstandingatatime,nosimultaneousI/Oprocessing

• Systemcall– requesttotheoperatingsystemtoallowusertowaitforI/Ocompletion

• Device-statustablecontainsentryforeachI/Odeviceindicatingitstype,address,andstate

• OperatingsystemindexesintoI/Odevicetabletodeterminedevicestatusandtomodifytableentrytoincludeinterrupt

15

Page 16: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

DirectMemoryAccessStructure

• Usedforhigh-speedI/Odevicesabletotransmitinformationatclosetomemoryspeeds

• DevicecontrollertransfersblocksofdatafrombufferstoragedirectlytomainmemorywithoutCPUintervention

• Onlyoneinterruptisgeneratedperblock,ratherthantheoneinterruptperbyte

16

Page 17: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Storage-DeviceHierarchy

17

Page 18: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

PerformanceofVariousLevelsofStorage

• Movementbetweenlevelsofstoragehierarchycanbeexplicitorimplicit

18

Page 19: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

MigrationofIntegerAfromDisktoRegister

• Multitaskingenvironmentsmustbecarefultousemostrecentvalue,nomatterwhereitisstoredinthestoragehierarchy

• MultiprocessorenvironmentmustprovidecachecoherencyinhardwaresuchthatallCPUshavethemostrecentvalueintheircache

19

Page 20: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

StorageStructure

• Mainmemory– onlylargestoragemediathattheCPUcanaccessdirectly

• Secondarystorage– extensionofmainmemorythatprovideslargenonvolatilestoragecapacity

• Magneticdisks– rigidmetalorglassplatterscoveredwithmagneticrecordingmaterial– Disksurfaceislogicallydividedintotracks,whicharesubdividedintosectors

– Thediskcontrollerdeterminesthelogicalinteractionbetweenthedeviceandthecomputer

20

Page 21: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

StorageHierarchy

• Storagesystemsorganizedinhierarchy– Speed– Cost– Volatility

• Caching – copyinginformationintofasterstoragesystem;mainmemorycanbeviewedasalastcacheforsecondarystorage

21

Page 22: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Caching

• Importantprinciple,performedatmanylevelsinacomputer(inhardware,operatingsystem,software)

• Informationinusecopiedfromslowertofasterstoragetemporarily

• Fasterstorage(cache)checkedfirsttodetermineifinformationisthere– Ifitis,informationuseddirectlyfromthecache(fast)– Ifnot,datacopiedtocacheandusedthere

• Cachesmallerthanstoragebeingcached– Cachemanagementimportantdesignproblem– Cachesizeandreplacementpolicy

22

Page 23: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

WhatisanOperatingSystem?

• Aprogramthatactsasanintermediarybetweenauserofacomputerandthecomputerhardware

• Operatingsystemgoals:– Executeuserprogramsandmakesolvinguserproblemseasier

– Makethecomputersystemconvenienttouse– Usethecomputerhardwareinanefficientmanner

23

Page 24: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

OperatingSystemDefinition

• OSisaresourceallocator– Managesallresources– Decidesbetweenconflictingrequestsforefficientandfairresourceuse

• OSisacontrolprogram– Controlsexecutionofprogramstopreventerrorsandimproperuseofthecomputer

24

Page 25: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

OperatingSystemDefinition(Cont)

• Nouniversallyaccepteddefinition• “Everythingavendorshipswhenyouorderanoperatingsystem” isgoodapproximation– Butvarieswildly

• “Theoneprogramrunningatalltimesonthecomputer” isthekernel.Everythingelseiseitherasystemprogram(shipswiththeoperatingsystem)oranapplicationprogram

25

Page 26: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

OperatingSystemStructure

• Multiprogramming neededforefficiency– SingleprogramcannotkeepCPUandI/Odevicesbusyatalltimes– Multiprogramming organizes jobs(codeanddata)soCPUalwayshasoneto

execute– Asubsetoftotaljobs insystemiskeptinmemory– Onejobselectedandrunviajobscheduling– Whenithastowait(for I/Oforexample),OSswitchestoanother job

• Timesharing(multitasking)islogicalextensioninwhichCPUswitchesjobssofrequently thatuserscaninteractwitheachjobwhileitisrunning, creatinginteractive computing– Responsetime shouldbe<1second– Eachuserhasatleastoneprogramexecutinginmemory[process– Ifseveraljobs readytorunatthesametime[ CPUscheduling– Ifprocessesdon’t fitinmemory,swappingmovestheminandouttorun– Virtualmemoryallowsexecutionofprocessesnotcompletely inmemory

26

Page 27: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Responsetime

27

Page 28: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

MemoryLayoutforMultiprogrammedSystem

28

Page 29: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Operating-SystemOperations

• Interruptdrivenbyhardware• Softwareerrororrequestcreatesexceptionortrap

– Divisionbyzero,requestforoperatingsystemservice• Otherprocessproblemsincludeinfiniteloop,processes

modifyingeachotherortheoperatingsystem• Dual-modeoperationallowsOStoprotectitselfand

othersystemcomponents– Usermodeandkernelmode– Modebitprovidedbyhardware

• Providesabilitytodistinguishwhensystemisrunningusercodeorkernelcode

• Someinstructionsdesignatedasprivileged,onlyexecutable inkernelmode

• Systemcallchangesmodetokernel,returnfromcallresets ittouser

29

Page 30: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

TransitionfromUsertoKernelMode

30

Page 31: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Process Management

• Aprocessisaprograminexecution.Itisaunitofworkwithinthesystem.Programisapassiveentity,processisanactiveentity.

• Processneedsresourcestoaccomplishitstask– CPU,memory,I/O,files– Initializationdata

• Processterminationrequiresreclaimofanyreusableresources• Single-threadedprocesshasoneprogramcounterspecifyinglocationof

nextinstructiontoexecute– Processexecutesinstructionssequentially,oneatatime,until

completion• Multi-threadedprocesshasoneprogramcounterperthread• Typicallyasystemhasmanyprocesses,someusers,someoperating

systemrunningconcurrentlyononeormoreCPUs– ConcurrencybymultiplexingtheCPUsamongtheprocesses/threads

31

Page 32: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

ProcessManagementActivities

Theoperatingsystemisresponsibleforthefollowingactivitiesinconnectionwithprocessmanagement:

• Creatinganddeletingbothuserandsystemprocesses

• Suspendingandresumingprocesses• Providingmechanismsforprocesssynchronization• Providingmechanismsforprocesscommunication• Providingmechanismsfordeadlockhandling

32

Page 33: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

MemoryManagement

• Alldatainmemorybeforeandafterprocessing• Allinstructionsinmemoryinordertoexecute• Memorymanagementactivities

– Keepingtrackofwhichpartsofmemoryarecurrentlybeingusedandbywhom

– Decidingwhichprocesses(orpartsthereof)anddatatomoveintoandoutofmemory

– Allocatinganddeallocatingmemoryspaceasneeded

33

Page 34: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

StorageManagement

• OSprovidesuniform,logicalviewofinformationstorage– Abstractsphysicalpropertiestologicalstorageunit- file– Eachmediumiscontrolledbydevice(i.e.,diskdrive,tape

drive)• Varyingpropertiesincludeaccessspeed,capacity,data-transferrate,accessmethod(sequentialorrandom)

• File-Systemmanagement– Filesusuallyorganizedintodirectories– Accesscontrolonmostsystemstodeterminewhocan

accesswhat– OSactivitiesinclude

• Creatinganddeletingfilesanddirectories• Primitivestomanipulatefilesanddirs• Mappingfilesontosecondarystorage• Backupfilesontostable(non-volatile)storagemedia

34

Page 35: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Mass-StorageManagement

• Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time

• Proper management is of central importance• Entire speed of computer operation hinges on disk subsystem and

its algorithms• OS activities

– Free-space management– Storage allocation– Disk scheduling

• Some storage need not be fast– Tertiary storage includes optical storage, magnetic tape– Still must be managed– Varies between WORM (write-once, read-many-times) and RW

(read-write)

35

Page 36: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

I/OSubsystem

• OnepurposeofOSistohidepeculiaritiesofhardwaredevicesfromtheuser

• I/Osubsystemresponsiblefor– MemorymanagementofI/Oincludingbuffering(storingdatatemporarilywhileitisbeingtransferred),caching(storingpartsofdatainfasterstorageforperformance),spooling(theoverlappingofoutputofonejobwithinputofotherjobs)

– Generaldevice-driverinterface– Driversforspecifichardwaredevices

36

Page 37: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

ProtectionandSecurity

• Protection– anymechanismforcontrollingaccessofprocessesoruserstoresourcesdefinedbytheOS

• Security– defenseofthesystemagainstinternalandexternalattacks– Hugerange,includingdenial-of-service,worms,viruses,identity

theft,theftofservice• Systemsgenerallyfirstdistinguishamongusers,todeterminewho

candowhat– Useridentities(userIDs,securityIDs)includenameandassociated

number,oneperuser– UserIDthenassociatedwithallfiles,processesofthatuserto

determineaccesscontrol– Groupidentifier(groupID)allowssetofuserstobedefinedand

controlsmanaged,thenalsoassociatedwitheachprocess,file– PrivilegeescalationallowsusertochangetoeffectiveIDwithmore

rights

37

Page 38: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Conceptualstructure

• Executionmodes:– Usermode:Executesuserprocesses.– Kernelmode:ExecutestheOSkernel.

• ProcessesandOSuseseparatememoryspaces.

• WhenaprocessneedsaservicerequestsittotheOSthroughasystemcall.– TheOperatingSystementersexecutiontoperformrequestedfunction.

38

Page 39: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Structure

OperatingSystems

Monolitics

Structured

Layered

Client/Server

Modular

39

Page 40: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

MonoliticOS

• Noclearorwelldefinedstructure.• AlltheOScodelinkedintoasingleexecutablerunningin

kernelmode.– Singleaddressspace.– Nodatahidingamongmodules.

• Moreefficientatthecostofverycomplexdevelopmentandmaintenance.

• Examples:– AllOSuntil’80,includingUNIX.– MS-DOSandcurrentUNIXvariants:Solaris,Linux,AIX,HP-UX,...

40

Page 41: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

LayeredOS

• Organizationasasetoflayerswithclearandwelldefinedinterfaces.• Eachlayerontopoflowerlayer.• Advantates:

– Modularity.– Datahiding.– Betterdevelopmentanddebugging.

• Lessefficientduetoneedtocrossmanylayerstoperformanoperation.• DifficulttodistributeOSfunctionsintolayers.• Examples:

– MacOS Xkernel– OS/2

41

Page 42: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Client/Serverapproach

¨ Mostservicesasuserprocesseswithasmallamountoffunctioality intoamicrokernel.

¨ Advantages:¨ Veryflexible. Eachservercanbedevelopedanddebuggedinisolation.¨ Easilyextensible toadistributedmodel

¨ Drawbacks:¤ Overheadinservicesexecution.

¨ Examples:¤ MinixyAmoeba(Tanenbaum)¤ MacOSandWindowsNT.

¤ Howeverservicesexecuted inkernelspaceforperformancereasons.

42

Page 43: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Modular

• Most modern operating systems implement kernel moduleso Uses object-oriented approacho Each core component is separateo Each talks to the others over known interfaceso Each is loadable as needed within the kernel

• Overall, similar to layers but with more flexible

43

Page 44: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Classifications

¨Numberofprocesses:¤Single-Task.¤Multitaks.

¨InteractionMode:¤Interactive.¤Batch.

¨Numberofusers:¤Monouser.¤Multiuser.

¨Numberofprocessors:¤Monoprocessor.¤Multiprocessor.

¨Threading:¤Monothread.¤Multithread.

¨uses:¤Client.¤Server.¤Embedded.¤Real-Time.

44

Page 45: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

OSstartup

• OSstartsupwhecomputerisswitchedon.– Initiallyinsecondarystorage.– Howdoesitcometomainmemory?– Howdesitstartexecutionafterbeingloaded?

45

Page 46: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Phases

ROMBoot

OS Loader

OS resident

partNormal

execution

46

Page 47: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

Computer Startup

• bootstrapprogram isloadedatpower-uporreboot– TypicallystoredinROMorEPROM,generallyknownas

firmware– Initializesallaspectsofsystem– Loadsoperatingsystemkernelandstartsexecution

47

Page 48: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

ROMboot

• RESETsignalloadspredefinedvaluesinregisters.– PC:bootaddressinroomboot.

• StartrunningROMboot:– Systemhardwaretest.– LoadintomemorytoOSloader.

48

Page 49: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

OSloader

¨Programloaderisindiskbootsector.

¨ResponsibleforloadingtherestoftheOS.

¨Verifiesthemagicwordinbootsector.

49

Page 50: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

GeneratingtheOS

• OSdesignedforacompleteclassofmachineswithseveralvariantsofconfigurationsandmanysupporteddevices.

• NeedtogenerateOScopybasedoncharacteristicsofspecificmachineconfiguration.

• Generationperformedduringinitialinstallation.

GenericOS

SpecificOSGeneration

50

Page 51: OPERATING SYSTEMS: Lesson 1: Introduction to ... - UC3Mocw.uc3m.es/ingenieria-informatica/operating-systems/lecture-notes-1/... · OPERATING SYSTEMS: Lesson 1: Introduction to Operating

OperatingSystems

OPERATING SYSTEMS:

Lesson 1:Introduction to Operating Systems

51

Jesús Carretero PérezDavid Expósito Singh José Daniel García SánchezFrancisco Javier García BlasFlorin Isaila