The UNIX TimeSharing System.docx
- 文档编号:4413402
- 上传时间:2022-12-01
- 格式:DOCX
- 页数:19
- 大小:39.79KB
The UNIX TimeSharing System.docx
《The UNIX TimeSharing System.docx》由会员分享,可在线阅读,更多相关《The UNIX TimeSharing System.docx(19页珍藏版)》请在冰豆网上搜索。
TheUNIXTimeSharingSystem
TheUNIXTime-SharingSystem*
D.M.RitchieandK.Thompson
ABSTRACT
Unixisageneral-purpose,multi-user,interactiveoperatingsystemforthelargerDigitalEquipmentCorporationPDP-11andtheInterdata8/32computers.Itoffersanumberoffeaturesseldomfoundeveninlargeroperatingsystems,including
●Ahierarchicalfilesystemincorporatingdemountablevolumes,
●Compatiblefile,device,andinter-processI/O,
●Theabilitytoinitiateasynchronousprocesses,
●Systemcommandlanguageselectableonaper-userbasis,
●Over100subsystemsincludingadozenlanguages,
●Highdegreeofportability.
Thispaperdiscussesthenatureandimplementationofthefilesystemandoftheusercommandinterface.
NOTE:
*Copyright1974,AssociationforComputingMachinery,Inc.,reprintedbypermission.ThiselectroniceditionofthispaperisareprintoftheversionappearinginTheBellSystemTechnicalJournal57no.6,part2(July-August1978).Inturn,thatwasarevisedversionofanarticlethatappearedinCommunicationsoftheACM,17,No.7(July1974),pp.365-375.ThatarticlewasarevisedversionofapaperpresentedattheFourthACMSymposiumonOperatingSystemsPrinciples,IBMThomasJ.WatsonResearchCenter,YorktownHeights,NewYork,October15-17,1973.MostofthedifferencesbetweenversionsoccurbetweentheC.ACMversionandtheBSTJprinting;weincorporatedupdatednumbersandmaterialonportability.
I.INTRODUCTION
TherehavebeenfourversionsoftheUnixtime-sharingsystem.12Theearliest(circa1969-70)ranontheDigitalEquipmentCorporationPDP-7and-9computers.ThesecondversionranontheunprotectedPDP-11/20computer.ThethirdincorporatedmultiprogrammingandranonthePDP-11/34,/40,/45,/60,and/70computers;itistheonedescribedinthepreviouslypublishedversionofthispaper,andisalsothemostwidelyusedtoday.Thispaperdescribesonlythefourth,currentsystemthatrunsonthePDP-11/70andtheInterdata8/32computers.Infact,thedifferencesamongthevarioussystemsisrathersmall;mostoftherevisionsmadetotheoriginallypublishedversionofthispaper,asidefromthoseconcernedwithstyle,hadtodowithdetailsoftheimplementationofthefilesystem.
SincePDP-11UnixbecameoperationalinFebruary,1971,over600installationshavebeenputintoservice.Mostofthemareengagedinapplicationssuchascomputerscienceeducation,thepreparationandformattingofdocumentsandothertextualmaterial,thecollectionandprocessingoftroubledatafromvariousswitchingmachineswithintheBellSystem,andrecordingandcheckingtelephoneserviceorders.Ourowninstallationisusedmainlyforresearchinoperatingsystems,languages,computernetworks,andothertopicsincomputerscience,andalsofordocumentpreparation.
PerhapsthemostimportantachievementofUnixistodemonstratethatapowerfuloperatingsystemforinteractiveuseneednotbeexpensiveeitherinequipmentorinhumaneffort:
itcanrunonhardwarecostingaslittleas$40,000,andlessthantwoman-yearswerespentonthemainsystemsoftware.Wehope,however,thatusersfindthatthemostimportantcharacteristicsofthesystemareitssimplicity,elegance,andeaseofuse.
Besidestheoperatingsystemproper,somemajorprogramsavailableunderUnixare
Ccompiler
TexteditorbasedonQED[1];
Assembler,linkingloader,symbolicdebugger
Phototypesettingandequationsettingprograms[2,3]
DozensoflanguagesincludingFortran77,Basic,Snobol,APL,Algol68,M6,TMG,PascalThereisahostofmaintenance,utility,recreationandnoveltyprograms,allwrittenlocally.TheUnixusercommunity,whichnumbersinthethousands,hascontributedmanymoreprogramsandlanguages.Itisworthnotingthatthesystemistotallyself-supporting.AllUnixsoftwareismaintainedonthesystem;likewise,thispaperandallotherdocumentsinthisissueweregeneratedandformattedbytheUnixeditorandtextformattingprograms.
II.HARDWAREANDSOFTWAREENVIRONMENT
ThePDP-11/70onwhichtheResearchUnixsystemisinstalledisa16-bitword(8-bitbyte)computerwith768Kbytesofcorememory;thesystemkerneloccupies90Kbytesaboutequallydividedbetweencodeanddatatables.Thissystem,however,includesaverylargenumberofdevicedriversandenjoysagenerousallotmentofspaceforI/Obuffersandsystemtables;aminimalsystemcapableofrunningthesoftwarementionedabovecanrequireaslittleas96Kbytesofcorealtogether.Thereareevenlargerinstallations;seethedescriptionofthePWB/UNIXsystems[4,5],forexample.Therearealsomuchsmaller,thoughsomewhatrestricted,versionsofthesystem[6].
OurownPDP-11hastwo200-Mbmoving-headdisksforfilesystemstorageandswapping.Thereare20variable-speedcommunicationsinterfacesattachedto300-and1200-bauddatasets,andanadditional12communicationlineshard-wiredto9600-baudterminalsandsatellitecomputers.Therearealsoseveral2400-and4800-baudsynchronouscommunicationinterfacesusedformachine-to-machinefiletransfer.Finally,thereisavarietyofmiscellaneousdevicesincludingnine-trackmagnetictape,alineprinter,avoicesynthesizer,aphototypesetter,adigitalswitchingnetwork,andachessmachine.
ThepreponderanceofUnixsoftwareiswrittenintheabovementionedClanguage[7].Earlyversionsoftheoperatingsystemwerewritteninassemblylanguage,butduringthesummerof1973,itwasrewritteninC.Thesizeofthenewsystemwasaboutone-thirdgreaterthanthatoftheold.Sincethenewsystemnotonlybecamemucheasiertounderstandandtomodifybutalsoincludedmanyfunctionalimprovements,includingmultiprogrammingandtheabilitytosharereentrantcodeamongseveraluserprograms,weconsiderthisincreaseinsizequiteacceptable.
III.THEFILESYSTEM
Themostimportantroleofthesystemistoprovideafilesystem.Fromthepointofviewoftheuser,therearethreekindsoffiles:
ordinarydiskfiles,directories,andspecialfiles.
3.1Ordinaryfiles
Afilecontainswhateverinformationtheuserplacesonit,forexample,symbolicorbinary(object)programs.Noparticularstructuringisexpectedbythesystem.Afileoftextconsistssimplyofastringofcharacters,withlinesdemarcatedbythenewlinecharacter.Binaryprogramsaresequencesofwordsastheywillappearincorememorywhentheprogramstartsexecuting.Afewuserprogramsmanipulatefileswithmorestructure;forexample,theassemblergenerates,andtheloaderexpects,anobjectfileinaparticularformat.However,thestructureoffilesiscontrolledbytheprogramsthatusethem,notbythesystem.
3.2Directories
Directoriesprovidethemappingbetweenthenamesoffilesandthefilesthemselves,andthusinduceastructureonthefilesystemasawhole.Eachuserhasadirectoryofhisownfiles;hemayalsocreatesubdirectoriestocontaingroupsoffilesconvenientlytreatedtogether.Adirectorybehavesexactlylikeanordinaryfileexceptthatitcannotbewrittenonbyunprivilegedprograms,sothatthesystemcontrolsthecontentsofdirectories.However,anyonewithappropriatepermissionmayreadadirectoryjustlikeanyotherfile.
Thesystemmaintainsseveraldirectoriesforitsownuse.Oneoftheseistherootdirectory.Allfilesinthesystemcanbefoundbytracingapaththroughachainofdirectoriesuntilthedesiredfileisreached.Thestartingpointforsuchsearchesisoftentheroot.Othersystemdirectoriescontainalltheprogramsprovidedforgeneraluse;thatis,allthecommands.Aswillbeseen,however,itisbynomeansnecessarythataprogramresideinoneofthesedirectoriesforittobeexecuted.
Filesarenamedbysequencesof14orfewercharacters.Whenthenameofafileisspecifiedtothesystem,itmaybeintheformofapathname,whichisasequenceofdirectorynamesseparatedbyslashes,``/'',andendinginafilename.Ifthesequencebeginswithaslash,thesearchbeginsintherootdirectory.Thename/alpha/beta/gammacausesthesystemtosearchtherootfordirectoryalpha,thentosearchalphaforbeta,finallytofindgammainbeta.gammamaybeanordinaryfile,adirectory,oraspecialfile.Asalimitingcase,thename``/''referstotherootitself.
Apathnamenotstartingwith``/''causesthesystemtobeginthesearchintheuser'scurrentdirectory.Thus,thenamealpha/betaspecifiesthefilenamedbetainsubdirectoryalphaofthecurrentdirectory.Thesimplestkindofname,forexample,alpha,referstoafilethatitselfisfoundinthecurrentdirectory.Asanotherlimitingcase,thenullfilenamereferstothecurrentdirectory.
Thesamenon-directoryfilemayappearinseveraldirectoriesunderpossiblydifferentnames.Thisfeatureiscalledlinking;adirectoryentryforafileissometimescalledalink.TheUnixsystemdiffersfromothersystemsinwhichlinkingispermittedinthatalllinkstoafilehaveequalstatus.Thatis,afiledoesnotexistwithinaparticulardirectory;thedirectoryentryforafileconsistsmerelyofitsnameandapointertotheinformationactuallydescribingthefile.Thusafileexistsindependentlyofanydirectoryentry,althoughinpracticeafileismadetodisappearalongwiththelastlinktoit.
Eachdirectoryalwayshasatleasttwoentries.Thename``.''ineachdirectoryreferstothedirectoryitself.Thusaprogrammayreadthecurrentdirectoryunderthename``.''withoutknowingitscompletepathname.Thename``..''byconventionreferstotheparentofthedirectoryinwhichitappears,thatis,tothedirectoryinwhichitwascreated.
Thedirectorystructureisconstrainedtohavetheformofarootedtree.Except
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- The UNIX TimeSharing System