⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 p5

📁 unix v7是最后一个广泛发布的研究型UNIX版本
💻
字号:
.SHVII. TRAPS.PPThe \*sPDP\*n-11 hardware detects a number of program faults,such as references to non-existent memory, unimplemented instructions,and odd addresses used where an even address is required.Such faults cause the processor to trap to a system routine.Unless other arrangements have been made,an illegal action causes the systemto terminate the process and to write itsimageon file.UL corein the current directory.A debugger can be used to determinethe state of the program at the time of the fault..PPPrograms that are looping, that produce unwanted output, or about whichthe user has second thoughts may be halted by the use of the.UL interruptsignal, which is generated by typing the ``delete''character.Unless special action has been taken, thissignal simply causes the program to cease executionwithout producing a.UL corefile.There is also a.UL quitsignalused to force an image file to be produced.Thus programs that loop unexpectedly may behalted and the remains inspected without prearrangement..PPThe hardware-generated faultsand the interrupt and quit signalscan, by request, be either ignored or caught by a process.For example,the \&shell ignores quits to preventa quit from logging the user out.The editor catches interrupts and returnsto its command level.This is useful for stopping long printoutswithout losing work in progress (the editormanipulates a copy of the file it is editing).In systems without floating-point hardware,unimplemented instructions are caughtand floating-point instructions areinterpreted..SHVIII. PERSPECTIVE.PPPerhaps paradoxically,the success ofthe.UXsystemis largely due to the fact that it was notdesigned to meet anypredefined objectives.The first version was written when one of us(Thompson),dissatisfied with the available computer facilities,discovered a little-used \*sPDP\*n-7and set out to create a morehospitable environment.This (essentially personal) effort wassufficiently successfulto gain the interest of the other authorand several colleagues,and later to justify the acquisitionof the \*sPDP\*n-11/20, specifically to supporta text editing and formatting system.When in turn the 11/20 was outgrown,the systemhad proved useful enough to persuade management toinvest in the \*sPDP\*n-11/45,and later in the\*sPDP\*n-11/70 and Interdata 8/32 machines,upon which it developed to its present form.Our goals throughout the effort,when articulated at all, have always been to builda comfortable relationship with the machineand to explore ideas and inventions in operating systemsand other software.We have not been faced with the need to satisfy someoneelse's requirements,and for this freedom we are grateful..PPThree considerations that influenced the design of.UXare visible in retrospect..PPFirst:because we are programmers,we naturally designed the system to make it easy towrite, test, and run programs.The most important expression of our desire forprogramming conveniencewas that the systemwas arranged for interactive use,even though the original version onlysupported one user.We believe that a properly designedinteractive system is much moreproductiveand satisfying to use than a ``batch'' system.Moreover, such a system is rather easilyadaptable to noninteractive use, while the converse is not true..PPSecond:there have always been fairly severe size constraintson the system and its software.Given the partially antagonistic desires for reasonable efficiency andexpressive power,the size constraint has encouragednot only economy, but also a certain elegance of design.This may be a thinly disguised version of the ``salvationthrough suffering'' philosophy,but in our case it worked..PPThird: nearly from the start, the system was able to, and did, maintain itself.This fact is more important than it might seem.If designers of a system are forced to use that system,they quickly become aware of its functional and superficial deficienciesand are strongly motivated to correct them before it is too late.Because all source programs were always availableand easily modified on-line,we were willing to revise and rewrite the system and its softwarewhen new ideas were invented, discovered,or suggested by others..PPThe aspects of.UXdiscussed in this paper exhibit clearlyat least the first two of thesedesign considerations.The interface to the filesystem, for example, is extremely convenient froma programming standpoint.The lowest possible interface level is designedto eliminate distinctionsbetweenthe various devices and files and betweendirect and sequential access.No large ``access method'' routinesare requiredto insulate the programmer from thesystem calls;in fact, all user programs either call the systemdirectly oruse a small library program, less than a page long,that buffers a number of charactersand reads or writes them all at once..PPAnother important aspect of programmingconvenience is that there are no ``control blocks''with a complicated structure partially maintained byand depended on by the file system or other system calls.Generally speaking, the contents of a program's address spaceare the property of the program, and we have tried toavoid placing restrictionson the data structures within that address space..PPGiven the requirementthat all programs should be usable with any file ordevice as input or output,it is also desirableto push device-dependent considerationsinto the operating system itself.The only alternatives seem to be to load,with all programs,routines for dealing with each device,which is expensive in space,or to depend on some means of dynamically linking tothe routine appropriate to each device when it is actuallyneeded,which is expensive either in overhead or in hardware..PPLikewise,the process-control scheme and the command interfacehave proved both convenient and efficient.Because the \&shell operates as an ordinary, swappableuser program,it consumes no ``wired-down'' space in the system proper,and it may be made as powerful as desiredat little cost.In particular,given the framework in which the \&shell executesas a process that spawns other processes toperform commands,the notions of I/O redirection, background processes,command files, and user-selectable system interfacesall become essentially trivial to implement..SHInfluences.PPThe success of.UXliesnot so much in new inventionsbut rather in the full exploitation of a carefully selectedset of fertile ideas,and especially in showing thatthey can be keys to the implementation of a smallyet powerful operating system..PPThe.UL forkoperation, essentially as we implemented it, waspresent in the \*sGENIE\*n time-sharing system..[lampson deutsch 930 manual 1965 system preliminary.]On a number of points we were influenced by Multics,which suggested the particular form of the I/O system calls.[multics input output feiertag organick.]and both the name of the \&shell and its general functions.The notion that the \&shell should create a processfor each command was also suggested to us bythe early design of Multics, although in thatsystem it was later dropped for efficiency reasons.A similar scheme is used by \*sTENEX\*n..[bobrow burchfiel tenex.]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -