操作系统复习提纲.docx
- 文档编号:23813754
- 上传时间:2023-05-21
- 格式:DOCX
- 页数:70
- 大小:421.42KB
操作系统复习提纲.docx
《操作系统复习提纲.docx》由会员分享,可在线阅读,更多相关《操作系统复习提纲.docx(70页珍藏版)》请在冰豆网上搜索。
操作系统复习提纲
Chapter1
概念(列表)
对比性的要关注
Job/CPUschedule
JOBschedule:
chooseajobamongseveralonesreadytobebroughtintomemory
CPUschedule:
chooseajobamongseveralonesreadytorun(intocpu)
Processvirtualsystem
Symmetricmultiprocessing(SMP)/Asymmetricmultiprocessing
Symmetric:
Eachprocessorrunsidenticalcopyoftheoperatingsystem.
Asymmetric:
Eachprocessorisassignedaspecifictask;masterprocessorschedulesandallocatedworktoslaveprocessors
DesktopSystem(个人计算机系统)
Userconvenienceandresponsiveness
ParallelSystems【多处理器系统(并行系统或紧耦合系统)】
MorethanoneCPU,sharememoryandclock,communicatethroughsharedmemory.Advantages:
increasedthroughput,economical,increasedreliability.
DistributedSystems(分布式系统)
Distributethecomputationamongseveralphysicalprocessors,ownlocalmemory,communicatethroughcommunicationlines.
Advantages:
resourcessharing,computationspeedup,reliability,communication.
Requiresnetwork,maybec-sstructure
ClusteredSystems(集群系统)
Sharestorage,providehighreliability
Asymmetricclustering:
onerunswhileothersstandby
Symmetricclustering:
allrunsapplication
Real-TimeSystems(实时系统(软/硬))
Hardreal-time:
secondarystoragelimited
Softreal-time:
priority
HandheldSystems(手持系统)
Cellphone,limitedmemory,slowprocess,smallscreen
Interrupt(中断)
transferscontroltotheinterruptservicethroughinterruptvector
savetheaddressofinterruptedinstruction
disabledinterruptoccurwhenainterruptisprocessing
Cache
Fasterstorage
Process(进程)
Process:
Aprogramloadedintomemoryandexecutingiscommonlyreferredtoasaprocess
Aprograminexecution
Systemcalls
Providetheinterfacebetweenarunningprogramandoperatingsystem
单核/微核
虚拟机(知道)
Chapter2
一、
进程
进程与线程的区别和联系
进程状态(图)
New:
theprocessisbeingcreated
Running:
instructionsarebeingexecuted
Waiting:
theprocessiswaitingforsomeeventtooccur
Ready:
theprocessiswaitingtobeassignedtoaprocess
Terminated:
theprocesshasfinishedexecution
PCB(processcontrolblock)
进程调度
PCBisadatastructureintheoperatingsystemkernelcontainingtheinformationneededtomanageaparticularprocess
Informationassociatedwitheachprocess:
-processstate
-programcounter
-cpuregister
-cpuschedulinginformation
-memory-managementinformation
-accountinginformation
-i/ostateinformation
Longterm(job)/Shortterm(CPU)schedule
JOBqueue:
setofallprocessesinthesystem
Readyqueue:
setofallprocessesinmainmemory,readyandwaitingtoexecution
Devicequeue:
setofprocesseswaitingfori/odevice
Longtermschedule:
selectswhichprocessshouldbeboughtintoreadyqueue
Shorttermschedule:
selectwhichprocessshouldbeexecutednextandallocatescpu
Thelongtermschedulecontrolsthedegreeofmultiprogramming
ContextSwitch(上下文切换)(特征)
cpuswitchtoanotherprocess,thesystemsavedthestateoftheoldprocessandloadedthesavedstateforthenewprocess
contextswitchtimeisoverhead(notuseful)
二、InterprocessCommunication(IPC)(进程间通信)
Mechanismforprocesstocommunicateandtosynchronizetheiractions
Messagesystem:
processescommunicatewitheachotherwithoutresortingtosharedvariables
Synchronization同步/异步(不好考-)
Blocking–synchronous
Non-blocking-asynchronous
进程/线程(区别,好处)
进程是可以拥有资源的独立单元,同时又是可独立调度和分派的基本单元
线程是在轻量级进程,他与同一进程下的其他线程共享代码段、数据段和其他操作系统资源
Benefit:
responsiveness,sharing,economy,multiprocessorsarchitectures
用户/内核线程的区别(邮箱)
Userthreadsarewhosemanagementdonebyuser-levelthreadslibrary
Kernelthreadsaresupportedbythekernel
三、CPU调度
CPUschedulerselectsaprocessfromprocessesinmemorythatarereadytoexecute,andallocatestheCPUtoit
图
抢占/非抢占
Nonpreemptive:
switchesfromrunningtowaitingstate,fromrunningtoreadystate,fromwaitingtoready,terminates
Othersispreemptive
Dispatcher(次要概念)
DispatchermodulegivescontrolofCPUtotheprocessselectedbytheshort-termscheduler;thisinvolves:
switchingcontext,switchingtousermode,jumpingtotheproperlocationintheuserprogramtorestartthatprogram
Dispatchlatency:
timeittakesforthedispatchertostoponeprocessandstartanotherrunning
SchedulingCriteria计算
CPUutilization:
keeptheCPUasbusyaspossible
Throughput:
thenumberofprocessesthatcompletetheirexecutionpertimeunit
Turnaroundtime:
amountoftimetoexecuteaparticularprocess
Waitingtime:
amountoftimeaprocesshasbeenwaitinginthereadyqueue
Responsetime:
amountoftimeittakesfromwhenarequestwassubmitteduntilthefirstresponseisproduced,notoutput(fortimesharingenvironment)
Waitingtime/turnaroundtime/averagetime
Ganttchart
FCFSisthesimplestCPUschedulingalgorithm,withwhich,theprocessthatrequesttheCPUfirstisallocatedthefirst.ImplementationoftheFCFSpolicyiseasilymanagedwithFIFOqueue
SJFassociatewitheachprocessesthelengthofitsnextCPUburst,(smallestnextCPUburst)
Priorityscheduling:
aprioritynumberisassociatedwitheachprocess,theCPUisallocatedtotheprocesswiththehighestpriority(smallest==highest)
注意几种算法的缩写
SJF平均等待时间最短
一般:
优先数越小优先级越高(注意审题)
饥饿:
解决方法
Priority++
RR(roundrobin):
eachprocessgetsasmallunitofCPUtime,usually10-100ms
多级反馈(MultilevelFeedbackQueue)
Multilevelqueue:
readyqueueispartitionedintoseparatequeues,eachqueuehasitsownschedulingalgorithm
Schedulingmustbedonebetweenqueues(fixedpriorityortimeslice)
Multilevelfeedbackqueue:
allowprocesstomovebetweenqueues.Eachqueuehasdifferentpriority.Preventstarvation
四、进程同步
临界区(代码段)
Criticalsection:
acodesegment,whichprocessessharedata
Ensurethatwhenoneprocessisexecutinginitscriticalsection,nootherprocessisallowtoexecuteinitscriticalsection
Solution:
mutualexclusion,progress,boundedwaiting
剩余区,进入区,退出区(解决临界区3条)
justlikejdbcconnect(entrysection)dosth(criticalsection)close(exitsection)dealwithdata(remindersection)
信号量(编程,必考)(wait:
减;signal:
加)
生产者/消费者读者/写者
Monitor(管程)(简答)
Amonitorisanobjectintendedtobeusedsafelybymorethanonethread
五、Deadlock(死锁)
Deadlock:
Twoormoreprocessesarewaitingindefinitelyforaneventthatcanbecausedbyoneonlyofthewaitingprocess
Starvation:
indefiniteblocking.Aprocessmayneverberemovedfromthesemaphorequeueinwhichitissuspended.
Deadlocksheadling:
Prevention,Avoidance,Detection,Recoverfromdeadlock
产生原因
Mutualexclusion,holdandwait,nopreemption,circularwaits
特点(4条)
银行家算法/死锁检测(二者选其一)
资源分配图
处理方法(预防、避免、恢复)
Chapter3
逻辑地址/物理地址
Logicaladdress:
generatedbytheCPU
Physicaladdress:
addressseenbythememoryunit
Logicalandphysicaladdressarethesameincompile-timeandload-timeschema,butdifferentinexecution-timeschema
MMU(Memory-ManagementUnit)
MMU:
isahardwaredevicethatmapsvirtualtophysicaladdress
Sotheuserprogramdealswithlogicaladdresses;itneverseestherealphysicaladdresses;thememorymappinghardwareconvertslogicaladdressintophysicaladdresses
Dynamiclinking(动态链接)
Dynamicloading:
aroutineisnotloadeduntilitiscalled
Dynamiclinking:
linkingpostponeduntilexecutiontime
Stub:
itisasmallpieceofcode,usedtolocatetheappropriatememory-residentlibraryroutine
Overlays
Overlays:
inordertoenableaprocesstobelargerthantheamountofmemoryallocatedtoit;soitkeepinmemoryonlythoseinstructionsanddataareneededinanygiventime
Swapping(进程)
Aprocesscanbeswappedtemporarilyoutofmemorytoabackingstoreandthebroughtbackintomemoryforcontinuedexecution
连续分配
Eachprocessiscontainedinasinglecontiguoussectionofmemory
Hole
Ablockofavailablememory
First/best/worstfit
First-fitandbest-fitbetterthanworst-fitintermsofspeedandstorageutilization
内外部碎片(结合别的知识点考察)
Externalfragmentation:
totalmemoryspaceexiststosatisfyarequest,butitisnotcontiguous.
Internalfragmentation:
allocatedmemorymayslightlylargerthanrequestedmemory;thissizedifferenceismemoryinternaltoapartition,butnotbeingused
Paging
Pagingisamemory-managementschemethatpermitsthephysicaladdressspaceofaprocesstobenoncontiguous
frames:
Dividephysicalmemoryintofixed-sizedblocks
pages:
dividelogicalmemoryintothesamesize
pagenumber:
usedasanindexintoapagetablewhichcontainsbaseaddressofeachpageinphysicalmemory
pageoffset:
combinedwithbaseaddresstodefinethephysicalmemoryaddressthatsenttothememoryunit
Pagingitselfisformofdynamicrelocationonlycausedinternalfragmentation
PTBR(page-tablebaseregister):
pointstothepagetable
PTLR(page-tablelengthregister):
indicatessizeofthepagetable
TLB
Translationlook-asidebufferisaCPUcachethatmemorymanagementhardwareusedtoimprovevirtualaddresstranslatespeed
TLBMISS:
ifthepagenumberisnotintheTLB(knownasaTLBMISS)
EAT
Effectivememory-accesstime:
thepercentageoftimesthataparticularpagenumberisfoundintheTLBiscalledthehitratio
有效/无效性
Associatingprotectionbitwitheachframe
Pagetablestructure(画页表)
Hierarchicalpagetable:
breakupthelogicaladdressspaceintomultiplepagetable
Hashedpagetable:
Hashedfunction->linkedlist->framesandoffset
Invertingpagetable:
共享页(理解)
Sharecode
Segment(段)
Segmentationismemory-managementschemethatsupportsthisuserviewofmemory
Segmentisalogicalunit
Segmentationarchitecture:
segmenttable:
mapstwo-dimensionallogicaddressestoone-dimensionalphysicaladdress
STBRandSTLR
Virtualmemory(虚拟内存)
Separationofuserlogicalmemoryfromphysicalmemory,whichimplementedviademandpagingordemandsegmentation
Virtualm
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 操作系统 复习 提纲