Vous êtes sur la page 1sur 7

UNIVERSITYOFTHESOUTHERNCARIBBEAN

MARACASROYALROAD,MARACAS,ST.JOSEPH

UNIXDerivatives:MacOSXandUbuntu
AKernelApproach

AnAssignment
PresentedinPartialFulfilment
OftheRequirementsfortheCourse
CPTR461:OPERATINGSYSTEMS1

Instructor:ConnellByronHunte

By:

KyleRoach

25thJanuary2014

Approval.

Windowsisthebestoperatingsystem.Thisisastatementoftenmadebyignorant
Windowsuserswhohaveneverusedanotheroperatingsystem.Inthefirstquarterof2014,
88.99%oftheworldwidedesktopusershadaWindowssystemastheiroperatingsystemof
choice(StatCounterGlobalStats2014).Unfortunatelythisnumberincludesuserswhohave
neverusedorbeenexposedtootheroperatingsystems.Tothem,Windowsisthebestandonly
choiceforanoperatingsystem.Howevertosmallerpopulation,weknowthatotheroperating
systemsofferfeaturesandtoolswhichfaroutweighthoseofWindows.OutsideofWindows
systems,theotheroperatingsystemsareallUNIXbasedinsomeway.UNIX,thecomputer
operatingsystemfromBellLabs,isstillregardedasoneofthemostpowerful,versatile,and
flexibleoperatingsystemsinthecomputerworld.Itspopularityisduetomanyfactors,including
itsabilitytorunawidevarietyofmachines,frommicrostosupercomputers,anditsportability
allofwhichledtoitsadoptionbymanymanufacturers(BellLabs2002).Aftermodifications
mademydevelopersovertheyearsweendedupwithtwoprominentkernelsXNUandLinux.
InmypaperIwillseektopointoutthedifferencesandsimilaritiesbetweenthesetwokernels
andhowtheyaffecttheoperatingsystemsthattheyrun.
Onmanyonlineforumsaboutoperatingsystems,youwouldoftenseethecommentbeing
madethatOSXisaLinuxbasedoperatingsystem.HoweverOSXisactuallybuiltontheXNU
kernelwhichlikeLinux,gotitsoriginsfromUNIX.Theoperatingsystemswewilluseifneeded
areApplesOSXwithitsXNUkernelandUbuntuwithitsLinuxkernel.Thecriteriawewill
usetocomparetheseareprocessmanagement,storagemanagement,andnetworkmanagement.
Thefirstandforemostbiggestdifferencebetweenthetwooperatingsystemsliesinthe
architectureofthekernel.Thekernelistheindispensableandthereforemostimportantofan
operatingsystem.ThekernelisthetruebrainsoftheOSandcontrolsvirtuallyallaspectsof
interactingwiththeunderlyinghardware(Taggart2008).Basicallywithoutthisessential
componentoftheoperatingsystemyourcomputerwouldjustbeanexpensivepaperweightwith
spinningfans.Roughlytheoperatingsystemitselfconsistsoftwoparts:thekernelspace
(privilegedmode)anduserspace(unprivilegedmode).Itrunseverybasicsystemservicelike
processandmemorymanagement,interrupthandlingandI/Ocommunication,lesystem,etc.in
kernelspace.Therearetwodierentconceptsofkernels:monolithickernelandkernel
(microkernel)(Roch2004).Amonolithickernelisoneinwhichtheentirekernelexistsasone
largefile.Thesecondapproachisknownasthemicrokernel.AnOSbuiltonthemicrokernel
approachwillhavemanysmallerkernelsthatallcommunicatewitheachother(Taggart2008).
Linuxusesthemonolithicapproachinwhichitskernelisonelargefilethatismadeup
ofover5.9millionlinesofcode.Infact,almostallofthehardwaredriversarecontainedinthe
kernelitself.Thismakesinstalling"drivers"inLinuxanonissue.Mosthardwaresimplyworks
outofthebox.
OntheotherhandXNUishybridkernel,containingfeaturesofbothmonolithickernels
andmicrokernels,attemptingtomakethebestuseofbothtechnologies,suchasthemessage
passingcapabilityofmicrokernelsenablinggreatermodularityandlargerportionsoftheOSto
benefitfromprotectedmemory,aswellasretainingthespeedofmonolithickernelsforcertain
criticaltasks(Taggart2008).ThebasisfortheXNUkernelhoweveristheMachmicrokernel.
TheKernelandDeviceDriverslayerofOSXconsistsoftheMachkernelenvironment,device
drivers,BSDlibraryfunctions(libSystem),andotherlowlevelcomponents.Thelayerincludes
supportforfilesystems,networking,security,interprocesscommunication,programming
languages,devicedrivers,andextensionstothekernel.Thesecombinedformwhatweknowas

Darwin.

ProcessManagement
Nowthatwehaveidentifiedthedifferenceinkernelarchitecture,wecancontinuetohow
theyeachmanageprocesses.TheprocessisoneofthefundamentalabstractionsinUNIX
operatingsystems.Aprocessisaprograminexecution.Aprogramitselfisnotaprocessa
processisanactiveprogramandrelatedresources.Indeed,twoormoreprocessescanexistthat
areexecutingthesameprogram.Infact,twoormoreprocessescanexistthatsharevarious
resources,suchasopenfilesoranaddressspace(Love2005).InOSX,processesdonot
normallysharememory.Instead,thekernelassignseachprocessitsownaddressspace,
controllingaccesstotheseaddressspaces.Thiscontrolensuresthatnoapplicationcan
inadvertentlyaccessormodifyanotherapplicationsmemory(protection)(Apple2004).
Threadsofexecution,oftenshortenedtothreads,aretheobjectsofactivitywithinthe
process.ToLinux,athreadisjustaspecialkindofprocess.Itdoesnotdifferentiatebetween
threadsandprocesses(Love2005).InOSXeachprocessismadeupofoneormorethreads,
eachofwhichrepresentsasinglepathofexecutionthroughtheapplication'scode.Every
applicationstartswithasinglethread,whichrunstheapplication'smainfunction.Processesdo
notdirectlyinteractwiththeprocessor,thisishandledbythreads.Applicationscanspawn
additionalthreads,eachofwhichexecutesthecodeofaspecificfunction.Whenanapplication
spawnsanewthread,thatthreadbecomesanindependententityinsideoftheapplication's
processspace(Apple2013).
Multitaskingoperatingsystemscomeintwoflavours:cooperative
multitaskingandpreemptivemultitasking.BothOSXandUbuntuusepreemptivemultitasking.
Inpreemptivemultitasking,theschedulerdecideswhenaprocessistoceaserunningandanew
processistoresumerunning.BothOSXandUbuntuemploytwogeneralscheduletechniques:
timesharingandfixedpriority.Atimesharingthreadspriorityisraisedandloweredtobalance
itsresourceconsumptionagainstothertimesharingthreads.Fixedprioritythreadsexecutefora
certainquantumoftime,andthenareputattheendofthequeueofthreadsofequalpriority
(Apple2004),(Love2005).
Uniprogrammingenvironmentsranatasktillitwasfinishedandthenstartedanother
task.Withtheintroductionofmultiprogrammingandschedulingprocesses,cametheproblemof
deadlocks.InOSXtherearetwodeadlockimplementations,adeadlockandalivelock.Ina
livelocksituation,athreadgivesupitsfirstlockinanattempttoacquireitssecondlock.Onceit
acquiresthesecondlock,itgoesbackandtriestoacquirethefirstlockagainandthisprocess
continues.BothOSXandUbuntuusethesamemethodsfordetecting,preventing,andresolving
deadlocks.
StorageManagement
Allcomputerapplicationsneedtostoreandretrieveinformation.Whileaprocessis
running,itcanstorealimitedamountofinformationwithinitsownaddressspace.Howeverto
storeinformationpersistently,afilesystemisneeded.UNIXhasprovidedfourbasic
filesystemrelatedabstractions:files,directoryentries,inodes,andmountpoints.Thefilesystem
componentofDarwinisbasedonextensionstoBSDandanenhancedVirtualFileSystem(VFS)
design(Apple2004).TheVirtualFileSystemisthesubsystemofthekernelthatimplementsthe

filesystemrelatedinterfacesprovidedtouserspaceprograms.Thisenablesprogramstouse
standardUNIXsystemcallstoreadandwritetodifferentfilesystemsondifferentmedia(Love
2005).BothOSXandUbuntuuseavirtualfilesystemasanabstractionlayerbetweenthe
userspaceandthefilesystem.Therearethreefilesystemdesigns.(a)Singledirectorysharedby
allusers.(b)Onedirectoryperuser.(c)Arbitrarytreeperuser.InbothOSsonedirectoryisused
peruser(Tanenbaum,Woodhull2006).BothOSXandUbuntuhavethesamefilesystemlayout,
howeverinOSXmanyofthesedirectoriesarehiddenbydefaultfromtheuser,andpermissions
tolimitausersaccesstosystemfilesandotheruserdirectoriesaresetautomatically(Cone
2011).ALinuxsystem,justlikeUNIX,makesnodifferencebetweenafileandadirectory,since
adirectoryisjustafilecontainingnamesofotherfiles.Programs,services,texts,images,andso
forth,areallfiles.Inputandoutputdevices,andgenerallyalldevices,areconsideredtobefiles,
accordingtothesystem.Inordertomanageallthosefilesinanorderlyfashion,manlikesto
thinkoftheminanorderedtreelikestructureontheharddisk,asweknowfromMSDOS(Disk
OperatingSystem)forinstance.Thelargebranchescontainmorebranches,andthebranchesat
theendcontainthetree'sleavesornormalfiles(Garrels2004).ThedefaultfilesysteminOSX
isHFS+whileUbuntuusesExt2,Ext3,Ext4.Thekindofproblemresultinginanerrormessage
sayingthatpermissionisdeniedsomewhereisusuallyaproblemwithaccessrightsinmost
cases.Also,commentslike,"Itworkedyesterday,"and"WhenIrunthisasrootitworks,"are
mostlikelycausedbythewrongfilepermissions.BothUbuntuandOSXprovidethechmod
systemcalltomodifyuserpermissions.
NetworkingManagement
Networkingallowsustocommunicatewithpeopleallaroundtheworld.Networkingalso
occursatadevicelevel,wheredevicescommunicateandtransferdataacrossnetworks.BothOS
XandUbuntubothprovidesupportforvariouscommunicationprotocolsoutoftheboxwhich
provideforeasynetworkmanagementandusage.Innetworkcommunicationisdescribedin
whatwecallaprotocolstack.Eachlayeroftheprotocolstackisconnectedoraccessedbya
groupofprotocolsIntegratedintoOSXskernelisacustomizedversionoftheBerkeley
SoftwareDistribution(BSD)operatingsystem.BSDservesasthebasisforthefilesystemsand
networkingfacilitiesofOSX(Apple2004).ThisprovidesstrongTCP/IPnetworkingwith
supportforindustrystandardssuchasSLIP,PPP,andNFS.OSXcaninteroperateeasilywith
othersystemsaswellasactasanenterpriseserver,providingvitalfunctionssuchasNFS
(remotefileaccess)andemailservices,orInternetservicessuchasHTTP,FTP,routing,and
firewall(security)services(Apple2004).
ThenetworkfunctionisaveryimportantpartoftheLinuxkernel.Morethan30%ofthe
WebserverontheInternetareconstructedonLinux.TheprotocolstackofLinuxisapartofthe
kernelandisembeddedinthekernelcode.Thestructureofthenetworkprotocolmakesit
possibletosupportlotsofprotocolsatthesametime.Linuxprovidesasystemcallnamed
sys_socketcalltoprovideaninterfacetoapplicationprograms.ItprovidesstandardBSDSocket
interfacetorealizetheseparationoftheuserprogramandthenetworkfunctionsoftheLinux
kernel.Thedataintheuserspaceiscopiedintothekernelspace.Thekernelandtheuser
programsaredifferentrunningunits,andhavetheirownbehavior.Inordertoprotecttheunityof
thedata,theuserprogramandthekernelhaveacopyofthedataoftheirownindependently
(Shaoren,&Chuanxiong2000).TCP/IPnetworkinghasbeenpresentinLinuxsinceits
beginnings.Ithasbeenimplementedfromscratch.Itisoneofthemostrobust,fastandreliable

implementationsandisoneofthekeyfactorsofthesuccessofLinux.Linuxandnetworkingare
madeforeachother,insomuchthatnotconnectingyourLinuxsystemtothenetworkmayresult
inslowstartupandothertroubles.Evenifyoudon'tuseanynetworkconnectionstoother
computers,networkingprotocolsareusedforinternalsystemandapplicationcommunications.
Linuxexpectstobenetworked(Garrels2004).
InconclusiontheUNIXoperatingsystemandstandardsgaverisetosparkofkernel
modifications,whichintegrallyledtothedevelopmentofUNIXbasedoperatingsystems,such
asOSXandUbuntu.WesawthateventhoughbothoperatingsystemswereUNIXbased,they
stillhaddifferences,whichwereprimarilydependentonthestructureandarchitectureoftheir
kernels.Bothoperatingsystemsofferadvancedtoolswhichallowthemtobecompetentinthe
businessworld,providingsolidalternativestotheWindowssystemsmeta.Inmyopinion,OSX
anditsXNUkernelprovidesmorepowerandfeaturescomparedtoUbuntuanditsLinuxkernel,
primarilybecausetheXNUkernelishybridwhichallowsfeaturesfrombothkernel
architectures.Howeverasthesayinggoes,Amanwillalwaysusetherighttoolforthejob.In
sayingthis,thereisnobestoperatingsystem,fortheneedsofconsumerwillalwaysdetermine
whatfeaturesofanosheneeds.Windowsisnttheonlyoperatingsystemonthemarket.

References
StatCounterGlobalStats.(2014).Top7DesktopOSsfromJanuarytoMarch2014.Retrieved
fromhttp://gs.statcounter.com/#desktoposwwmonthly201401201403bar
BellLabs.(2002).TheCreationoftheUNIXOperatingSystem.Retrievedfrom
http://www.belllabs.com/history/unix/
Roch,B.(2004).MonolithicKernelvsMicrokernel.Retrievedfrom
http://www.davepowell.org/media/teaching/operatingsystems/handouts/COMP354Lec0
2KernelComparisons.pdf
Tanenbaum,A.S.,&Woodhull,A.S.(2006)OperatingSystemsDesignandImplementation,
(3rded.).NewJersey:PrenticeHall.
Taggart,Michael.(2008).Linuxvs.Windowsvs.OSXTheKernelDebate.Retrievedfrom
http://roala.blogspot.com/2008/01/linuxvswindowsvsosxkerneldebate.html
Love,R.(2005).LinuxKernelDevelopment(2nded.).Indianapolis,IN:SamsPublishing.
AppleInc.(2004).KernelProgrammingGuide.Retrievedfrom
https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KernelProgra
mming/Architecture/Architecture.html
AppleInc.(2013).ThreadProgrammingGuide.Retrievedfrom
https://developer.apple.com/library/mac/documentation/cocoa/conceptual/multithreading/

CreatingThreads/CreatingThreads.html#//apple_ref/doc/uid/10000057iCH15SW2
AppleInc.(2004).MacTechnologyOverview.Retrievedfrom
https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/OSX_Tech
nology_Overview/SystemTechnology/SystemTechnology.html#//apple_ref/doc/uid/TP40
001067CH207TPXREF102
Rusling,D.A.(2000).TheLinuxKernel.NewJersey:PearsonEducation
Shaoren,Z.,&Chuanxiong,G.(2000).AnalysisandEvaluationoftheTCP/IPProtocolStackof
LINUX*.2000InternationalConferenceonCommunicationTechnologyProceedings
(Vol.1).doi:10.1109/ICCT.2000.889245
Garrels,M.(2004).IntroductiontoLinux.California.FultusCorporation
Cone,M.(2011).HowtoSetFilePermissionsinMacOSX.Retrievedfrom
http://www.macinstruct.com/node/415

Vous aimerez peut-être aussi