Beruflich Dokumente
Kultur Dokumente
CS341:OperatingSystem
Lect01:30th July2014
Dr.A.Sahu
DeptofComp.Sc.&Engg.
IndianInstituteofTechnologyGuwahati
Coursewebsite:
http://jatinga.iitg.ernet.in/~asahu/cs431/
ClassVenue
Require Knowledgeof
CS204:Algorithms
CoreIII:3202
UseofAlgorithmdesign,Graph,Analysis,
Use of Algorithm design, Graph, Analysis,
Approximation,Heuristics,etc..
ClassTiming&Venue
Tue
Wed
Thu
Mon
Course,Attendance,ReferenceBook
Whatdowestudyinthiscourse?
Whyshouldthisbestudied?
y
WhatisOperatingSystem?
Howisthecoursestructured?
09.00AM09.55AM
10.00AM10.55AM
11.00AM11.55AM
08.00AM08.55AM(Slotformakeupclass)
CS222:ComputerOrg.&Architecture
InterfacetoBIOS,ArchitectureandISA
OthersReferenceBook
TextBook
Silberschatz,A.andGalvinP.B,OperatingSystem
Concepts,8/e.Wiley,2008
ReferenceBook
Stalling,W.OperatingSystems:Internalsand
DesignPrinciples,6/e.Pearson,2008.
Tanenbaum,A.SModernOperatingSystem.3/e.
Pearson,2007.
Dhamdhere,D.MOperatingSystems:AConcept
BasedApproach,McGrawHill,2008.
5
MauriceHerlihy,Nir Shavit,ArtofMultiprocessor
Programming,Elsevier2009
C.CrowleyOperatingSystems:ADesignOriented
Approach,TataMcGraw HillEducation,2009
Buttazzo GiorgioC.HardRealTimeComputing
Systems,SpringerVerlag,2011
P.Brucker SchedulingAlgorithms,Springerverlag,
2007
J.Corbet,A.Rubini LinuxDeviceDrivers,,3rd Ed.
O'ReillyMedia,2005
6
7/30/2014
75%AttendanceisMandatory
Copy/Plagiarismleadto`FGrade
AnykindofCopy/Plagiarismleadto`FGrade
Grading
TakehomeexamandQuiz
Bothsource(fromcopied)anddestination(tocopied)
willbepenalized
Open:Ifyouraretakingfromsomesources,please
f
k f
l
site/mentionthesource(Internetorpeersorseniors)
5%classparticipation
30%midsemester+45%endsemester
10%Quiz(2Quiz)+10%takehome(2times)
Takewillbeannouncedinclassandtobe
submittedinthenextclass
Takehomeandquizwillnotbeannounced
earlier
RelativeGrading:Butwith
Above80pointismandatoryforAAgrades
MaynotensureAA
FailGrade:lessthan30%ofhighestscore
amongallthestudentsofCS341
Acomputersystemconsistsof
Hardware,Systemprograms,Applicationprograms
Office
Word,Excel
Banking
System
WebBrowser
Command
Interpreter
OperatingSystem
C
Compilers
il
Edit
Editor
MachineLanguage
Microarchitecture
Anoperatingsystemmanagesall:
Input
gettinginformationintothecomputerfroman
externalsources
keyboard,amouse,ascanner,oradisk.
y
,
,
,
Application
Program
S
System
Program
Processing
Afterreceivinginput:manipulatesoraltersthedata
Output
Hardware
Oncetheinputhasbeenprocessed
Resultoutputtoamonitor,printer,diskorsentvia
emailortheWeb
10
PhysicalDevices
9
PCOS
Microsoft:Window95,98,XP,Vista,7,8,NT
Apple:Machintos,IBM:OS2,OS360/390
Unix,Linux,Ubuntu,Fedora,BSDUnix,Solaris
EmbeddedOS
MainframeOS,ServerOS
Multiprocessoroperatingsystems
Personalcomputeroperatingsystems
Realtime
Real
timeoperatingsystems
operating systems
Aircraft,RadarDetection,Naval/SpaceMachine
Android,iOS,WindowCE/Phone8.1,Bada OS,
QNX,MeeGo,BlackBarry,uLinux,TinyOS
Embeddedoperatingsystems
WebBrowserOS:Crome OS,EyeOS,YouOS
RouterOS:CSIRONET,Netware,CiscoIOS,SAN
Smartcardoperatingsystems
OS
11
Mobile,Printer,Scanner,Projector,Camera,
WashingMachine
Ecos,TinyOS,SensorOS
12
7/30/2014
OSisanextendedmachine
Hidesthemessydetailswhichmustbe
performed
Presentsuserwithavirtualmachine,
Presents user with a virtual machine
easiertouse
ApplicationPrograms
BeautifulInterface
OperatingSystem
OSisaresourcemanager
Eachprogramgetstimewiththeresource
Eachprogramgetsspaceontheresource
UglyInterface
Hardware
13
Delvingintothedepthsrevealsmore
information
Anabstractionomitsunneeded
detail, helpsuscopewithcomplexity
In time
In space
16
intsum(intx,inty)
{
intt=x+y;
returnt;
}
_sum:
assembly
pushl%ebp
movl%esp,%ebp
movl12(%ebp),%eax
addl8(%ebp),%eax
movl%ebp,%esp
popl%ebp
ret
0x401040<sum>:
machine
code
0x55
0x89
0xe5
0x8b
0x45
0x0c
0x03
0x45
0x08
0x89
0xec
0x5d
0xc3
Register file
CPU
PC
ALU
System bus
Bus interface
Memory bus
Main
memory
bridge
I/O bus
USB
controller
Mouse
17
Graphics
adapter
Keyboard Display
Disk
controller
Disk
18
7/30/2014
Bridgethegapbetweenhardwareand
software
Establishafoundationforbuildinghigher
levelprograms
level programs
Providesavirtualexecutionenvironment
ontopofhardware
Thatismoreconvenientthantheraw
hardwareinterface
Allofthecodeyoudidnotwrite
MoreSimple,Morereliable,More
secure,Moreportable,More
efficient.
Howtooptimizeprograms?
Howtodebuglargesystems
Howtodealwithcomplexity
19
Managephysicalresources
Providevirtualresources
Implementmechanismsandenforce
p
policiesforthecontrolanduseof
resources
Mediatetheinteractionofmutually
distrustingapplications
20
CPU,Memory
StorageDevices,Networks
I
InputDevices(keyboard,mice,cameras)
D i
(k b d i
)
OutputDevices(printers,displays,
speakers)
Andmanyvirtualresources
21
22
Tolearn
Tolearn
Theorybehindresourcemanagement
Theorybehindconcurrencyandrelated
issues
Howtoadopttonewhardwareresources
andstandardization
Issuesaffectingmodernoperating
systems(Android,VxWork,Distributed
OS,)
AdvancedPowerManagementSupport
MulticoresupportinOS
Howtodevicedriverandhowallthe
H t d i di
dh
ll th
interfaceworks
Howthesystemcallworks..
23
24
7/30/2014
t2
t1
tn1
t4
t3
t5
tn
Scheduler
P1
P2
P3
25
Assumption(Verysimplistics)
26
OptimizationCriterion
LetsNTaskarrivesattime0
Alltasksareindependenttask
ith tasktakest
task takes ti amountoftimetoexecuteon
amount of time to execute on
anyprocessor
Homogenous:Allprocessorareofsametype
andspeed
Interruptionnotallowed:Taskassignedtoa
processorwillexecutecompletelywithout
interruption
Minimizefinishingtimeoflastexecuted
task:MinimizeCmax
27
t2
t1
t4
t3
tn1
t5
ProcessManagement
tn
Processandthread,schedulingexamples
SchedulingAlgorithms:Theoreticalprospects
Scheduler
P1
P2
28
Concurrency
P3
Mutualexclusion,synch.,semaphores,deadlocks
Mutual exclusion synch semaphores deadlocks
AtomicInstructions,designandproofof
Synchronizationalgorithmsandpolices
HowtoSolve?Isthereanyapproaches?
H t S l ? I th
h ?
ScheduleLongestTaskfirst===>FAIL
ScheduleshortestTaskfirst====>FAIL
DynamicProgramming====>FAIL
NPCompleteProblem
NeedtosolveusingApproximationorHeuristics
MemoryManagement
29
Allocation,protection,hardwaresupport,paging,
segmentation,virtualmemory,demandpaging,
allocation,replacement,TLBs
Algorithmictreatment:Memorymanagement 30
7/30/2014
FileManagement
Naming,fileoperationsandtheirimplementation;
FileSystems
Allocation,freespacemanagement,directory
management,mounting;
DistributedFileSystem
I/OManagement
Devicedrivers,diskscheduling
LinuxDeviceDriver&KernelProgramming
31
32