Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows...
Transcript of Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows...
![Page 1: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/1.jpg)
Introduction to Computer ScienceCSCI109
AndrewGoodneySpring2018
China– Tianhe-2
Lecture8:OperatingSystemsMarch5th, 2018
![Page 2: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/2.jpg)
ìOperating SystemsWorkingTogether
1
![Page 3: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/3.jpg)
ScheduleDate Topic Assigned Due Quizzes/Midterm/Final
8-Jan IntroductionWhatiscomputing,howdidcomputerscometobe?
HW1
15-Jan MLKHoliday
22-Jan ComputerarchitectureHowisamoderncomputerbuilt?Basicarchitectureandassembly
29-Jan DatastructuresWhyorganizedata?Basicstructuresfororganizingdata
HW1Quiz1onmaterialtaughtinclass1/8and1/22
30-Jan
5-Feb DatastructuresTrees,GraphsandTraversals
HW2
12-FebMoreAlgorithms/DataStructures,ComplexityandCombinatorics Recursionandrun-time
Quiz2onmaterialtaughtinclass1/29,2/5
19-Feb PresidentsDay
23-Feb
26-Feb Algorithmsandprogramming(Somewhat)Morecomplicatedalgorithmsandsimpleprogrammingconstructs,compilers
HW2Quiz3onmaterialtaughtinclass2/12
5-Mar Operatingsystems WhatisanOS?Whydoyouneedone? HW3Quiz4onmaterialtaughtinclass2/26
12-Mar SpringBreak
19-Mar Midterm MidtermMidtermonallmaterialtaughtsofar.
26-Mar ComputernetworksHowarenetworksorganized?HowistheInternetorganized?
HW3
2-Apr ArtificialintelligenceWhatisAI?Search,plannningandaquickintroductiontomachinelearning
HW4Quiz5onmaterialtaughtinclass3/26
6-Apr
9-Apr Thelimitsofcomputation Whatcan(andcan't)becomputed?Quiz6onmaterialtaughtinclass4/2
16-Apr RoboticsRobotics:backgroundandmodernsystems(e.g.,self-drivingcars)
HW4Quiz7onmaterialtaughtinclass4/9
23-Apr Summary,recap,review Summary,recap,reviewforfinalQuiz8onmaterialtaughtinclass4/16
4-MayFinalonallmaterialcoveredinthesemester
Finalexam11am-1pminSAL101
LastdaytodropaMonday-onlyclasswithoutamarkof“W”andreceivearefundorchangetoPass/NoPassorAuditforSession001
Lastdaytodropacoursewithoutamarkof“W”onthetranscript
Lastdaytodropaclasswithamarkof“W”forSession001
2
![Page 4: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/4.jpg)
Agenda
u Talkaboutoperatingsystemsu Reviewquizzes1-3(midtermstudying)
u Takequiz4
3
![Page 5: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/5.jpg)
Operating Systems
uWhatisanOS?uThekernel,processesandresources
uProtection/Isolation/SecurityuCompetingfortimeuCompetingforspace
4
Reading:St.Amant Ch.6
![Page 6: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/6.jpg)
The need for an OS
5
CPU,Memory,Disk,I/OProgram
Problem
Solution:Algorithm+DataStructures
Pseudocode
Low-levelinstructions
Executeson
Compilesto
![Page 7: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/7.jpg)
The OS as a executive manager
6
CPU,Memory,Disk,I/OProgram
Problems
Solution:Algorithms +DataStructures
Pseudocode
Low-levelinstructions
Executionsmanagedby
Compileto
Low-levelinstructionsLow-levelinstructions
ProgramProgramProgram
OperatingSystem
![Page 8: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/8.jpg)
What is an Operating System?
uAnexecutivemanagerforthecomputeruManagesresources
v Space(i.e.memory)vTime(i.e.CPUcomputetime)vPeripherals(i.e.inputandoutput)
uOSisaprogramthatstarts,runs,pauses,restarts,andendsotherprograms
u (somecontentfromthefollowingslidesiscourtesyofMarkRedekopp andCS350)7
![Page 9: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/9.jpg)
8
4
Definition
• A piece of software that manages a computer’s resources
• What resources need managing?– CPU (threads and processes)– Memory (Virtual memory,
protection)– I/O (Abstraction, interrupts,
protection)DISK
Processor
Mem. Management Unit
Network
Graphics
I/O Drivers & Protocols
File Systems
Memory Translation
Processes & Scheduling
System Library
System Library
User App User App
Ker
nel
Mod
eH
ardw
are
Use
r m
ode
![Page 10: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/10.jpg)
Examples of Operating Systems
u MicrosoftFamilyv MSDOS,Windows3.1– 98,WindowsNT ->Windows10v Predominatelyx86(Intel)hardware,somePowerPC,someARMv FreeDOS
u POSIX(UNIX/like)v macOS,FreeBSD,openBSD,netBSD,Solaris,AIX,andothers
u Runonmostprocessorarchitecturesv iOSv Linux
u Littlesideprojectofuniversitystudentu ”UNIXclone”thatwonthewaru 20+populardistributionsu Android:heavilycustomizedLinuxandJavaonphone/tablet
u Othersv PlaystationOS,VxWorks
9
![Page 11: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/11.jpg)
10
![Page 12: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/12.jpg)
11
8
Genealogy of Operating Systems
Figure 1.9,OS:PP 2nd Ed.
![Page 13: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/13.jpg)
Important Vocabulary
u Resourcev Somepartofthecomputerthatprogramsuse:
u Memory,CPU,Input/Output devices
u Policyv Rulesenforcedbyalgorithmsthatshareaccesstoresources
u OSDevelopers(humans)writepoliciesthatachievesomesetofgoalsfortheoperatingsystems
12
![Page 14: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/14.jpg)
What does an Operating System do?
uAbarecomputerisjusthardwareuProgramsarewrittentousethathardware,butexclusiveuseisinefficient
uInsimpleterms,theOS:v Enablesmorethanoneprogramatatimetousethecomputerhardware
v Presentcomputerresources(CPU,disk,I/O)throughabstractinterfacestoallowsharing
v Enforcepoliciestomanage/regulatethesharingofresources
13
![Page 15: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/15.jpg)
Roles
14
9
Roles
• Textbook regularly revisits 3 roles an OS plays:
• Referee
– Protection against other applications
– Enforce fair resource sharing
• Why doesn't an infinite loop require a reboot?
• Illusionist (Virtualization)
– Each program thinks it is running separately
– Each program thinks it has full access to computer's resources (or unlimited
resources)
• Glue
– Common services (such as copy/paste)
– Files can be read by any application
– UI routines for look & feel
– Separate applications from hardware
• so you don’t need to know which keyboard, disk drive, etc
![Page 16: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/16.jpg)
OS Design Criteria
u Reliability(andavailability)u Security&Privacy
u Performanceu Portability
15
![Page 17: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/17.jpg)
Reliability and Availably
u Reliablesystemsworkproperlyv Correct(orexpected)outputsaregeneratedforasetofinputsv Ifthisisnotthecase,thesystemhasfailed
u Examples?
u Availablesystemsareavailabletodoworku Availabledoesnotimplyreliable
v Systemcanbeavailablebutnotreliable(systemhasbugs,generateswrongresults)
v Systemcanbereliablebutnotavailableu Crashevery5minutes,butsavesresultsandrestarts5minuteslater
16
![Page 18: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/18.jpg)
Privacy, Security, Isolation
u ForanOSsecuritymeanstheOSdoesnotrununintendedcodeorgetintoacompromisedstatev Novirus/malware
u OSprivacymeansprogramsshouldnotgetaccesstodatatheyshouldnothavev Passwordkeychains,filesinotherusersdirectories
u SecurityandPrivacyrequiresometradeoffswithperformance,whichiswhyOS’sarenot100%securev Somearebetterthanothers!
17
![Page 19: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/19.jpg)
Portability
u Manymachinetypesexist:x86,x86_64,PPC,ARM,MIPSu Manydifferentmotherboardsorhardwareplatformsexist:serverwith8CPUs12PCIe slotstoRaspberryPi,toAppleTV,etc.
u OSwithgoodportabilityabstractsthesedifferencesintoastableAPIsoprogrammersdon’tnotice
u Also,cantheOSitselfbeportedtonewhardwareeasily?
u Goodportabilityleadstowideadoptionv Linux,Windows
18
![Page 20: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/20.jpg)
Performance
u Whatdoesperformancemean?v Lotsofcomputation?v FluidGUIforgame?v Lowlatencydiskfordatabase?
u OSbalancesthesewithpoliciesv Majoraxisisthroughputvs.responsetimev DifferentOS’saretunedbasedonusecasev DBserverhasdifferentpoliciesthanWindowsgamingrig
19
![Page 21: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/21.jpg)
Examples of Policies
uTasksaregivenpriorities;higherprioritytasksarehandledfirst
uSomekindoftasksareneverinterrupteduAlltasksareequalpriority;round-robinuSometaskscanonlyusepartofadiskuSometaskscanusenetwork
20
![Page 22: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/22.jpg)
The kernel
uThekernelisthecoreofanOSuKernelcoordinatesotherprogramsuWhenthecomputerstartsupthekerneliscopiedfromthedisktothememory
uKernelrunsuntilsomeotherprogramneedstousetheCPU
uKernelpausesitselftorunotherprogram21
![Page 23: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/23.jpg)
How memory is used
22
FreeMemory
FreeMemory
Kernel
FreeMemory
ExecutingProgram
Kernel
FreeMemory
Kernel
Start Kernelloaded
Userprogramruns
Userprogramdone
![Page 24: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/24.jpg)
Multitasking
uOneprogramusestheCPUatatimeuOSswitchesCPUusage(rapidly)uCreatesanillusionthatalltheprogramsarerunningatthesametime
uChangeoverfromoneprogramtoanotheriscalledacontextswitch
uExamplesofcontextswitching?uCancontextswitchingbegoodforaprogram?uCancontextswitchingbegoodforaCPU?
23
![Page 25: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/25.jpg)
Abstractions: Processes and Resources
uResourcesv Space(memory)v Time(CPU)v Peripherals(printersetc.)
uProcess:anexecutingprogramv Programcounterv Contentsofregistersv Allocatedmemory&contents
24
uOSdoesn’tworryaboutwhateachprogramdoes
u InsteadOScaresaboutv Whatresourcesdoesaprocessneed?
v Howlongwillitrun?v Howimportantisit?
![Page 26: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/26.jpg)
Protection/Isolation
uOtherprocesseshavetobepreventedfromwritingtothememoryusedbythekernel
uCrashinoneprogramshouldn’tcrashOSorotherprograms
uOShasaccesstoallresources:privilegedmodeuUserprogramshaverestrictedaccess:usermodeuWhenauserprogramneedsaccesstoprotectedresourcesitmakesasystemcall(e.g.,managingfiles,accessingaprinter)
uPrincipleofleastprivilege (kernelhashighestprivilege)
25
![Page 27: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/27.jpg)
Competing for time
uThinkofthetimetheCPUspendsinchunksorblocks
uHowcanblocksoftimebeallocatedtodifferentprocessessothatworkcanbedoneefficiently?
uPolicy:rulestoenforceprocessprioritization
26
![Page 28: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/28.jpg)
Process Scheduling Policies
uTheprocessqueueuRound-robinuFirst-come,first-serveduPriority-based
v Presetpriorityforeachprocessv Shortest-remaining-time
uAllthesepolicieskeeptheCPUbusyuArethereotherwaystojudgeapolicy?
27
![Page 29: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/29.jpg)
Keeping CPU busy
28
![Page 30: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/30.jpg)
How to evaluate a policy?
CPUutilization Throughput Latency Fairness
Round-robin Good Variable Potentiallyhigh
YesNostarvation
First-comefirst-served
Good Variable Yes
Shortestremainingtime
Good High Potentiallyhigh
NoCouldhavestarvation
Fixedpriority Good
29
u Utilization:howmuchworktheCPUdoes
u Throughput:#ofprocessesthatusetheCPUinacertaintime
u Latency:averageamountoftimethatprocesseshavetowaitbeforerunning
u Fairness:everyprocessgetsachancetousetheCPU
![Page 31: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/31.jpg)
Everyday policies
uPlanestakingoff:firstcomefirstservedv Highefficiencyfortherunwayv Ifseveralsmallerplanesinlinebeforealargeone,notefficientfortheaveragepassenger
uTrafficbeingdirectedataccident:roundrobinv Firsttrafficinonedirection,thenanotherv Ifapolicecararrives,thenswitchtopriority-basedv Unlikelytoeverbeshortestremainingtime
30
![Page 32: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/32.jpg)
First-come, first serve (non-pre-emptive)
31
![Page 33: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/33.jpg)
Round Robin (pre-emptive)
32
![Page 34: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/34.jpg)
Weighted Round Robin
33
![Page 35: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/35.jpg)
Shortest-time Remaining
34
![Page 36: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/36.jpg)
Competing for space
uUnliketime,spacecanbereused
uWhenaprocessisrunning,itisallocatedasingleregionofmemory
uWhenaprocessfinishesrunning,thememoryallocatedtoitisgivenbacktotheOS
u Fragmentation35
Kernel
A
B
CD
E
Kernel
A
D
![Page 37: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/37.jpg)
Dealing with fragmentation
uMovememoryallocationaroundallthetimeinthebackgroundsowhenanewprocessneedsmemory,thereisalargeenoughcontiguousblocktoallocate
u Indirectionv Physicalmemoryordering:memorydividedintofixedsizeblockscalledframes
v Logicalmemoryordering:inlogicalmemoryeachframecorrespondstoapage(arenumberedframe)
v Whenaprocessusesmemoryassignedtoit,ituseslogicaladdresses;theOStranslateslogicalmemorylocationstophysicalmemorylocations
36
![Page 38: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/38.jpg)
Virtual memory
uUseindirectiontopretendRAMisbiggerthanitisuDemandpaging
v Whenaprocessstarts,theOSdoesn’tallocateitallthememoryitneeds
v Insteadonlyallocatememoryneededtodoimmediateworkv Keeprestoftherequestedmemoryinsecondarystorage(disk)v Ifapageinmemoryisn’tusedforawhile,it’smovedtodiskv Whenapageisneededbyaprocess,it’scopiedfromdisktoRAM
uOtherexamplesofvirtualization:virtualenvironments(renderondemand),half-courtbasketball,etc.
37
![Page 39: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/39.jpg)
The need for an OS
38
CPU,Memory,Disk,I/OProgram
Problem
Solution:Algorithm+DataStructures
Pseudocode
Low-levelinstructions
Executeson
Compilesto
![Page 40: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/40.jpg)
The OS as a executive manager
39
CPU,Memory,Disk,I/OProgram
Problems
Solution:Algorithms +DataStructures
Pseudocode
Low-levelinstructions
Executionsmanagedby
Compileto
Low-levelinstructionsLow-levelinstructions
ProgramProgramProgram
OperatingSystem
![Page 41: Introduction to Computer Science...Examples of Operating Systems u Microsoft Family v MSDOS, Windows 3.1 –98, WindowsNT-> Windows 10 v Predominately x86 (Intel) hardware, some PowerPC,](https://reader030.fdocuments.us/reader030/viewer/2022040415/5f33dfbcd8d2ce2f3f7c3518/html5/thumbnails/41.jpg)
Quiz #4
40
http://bit.ly/2FdlyCD