V_6.0ref Man_Jun86 V 6.0ref Man Jun86
V_6.0refMan_Jun86 V_6.0refMan_Jun86
User Manual: V_6.0refMan_Jun86
Open the PDF directly: View PDF .
Page Count: 326
Download | |
Open PDF In Browser | View PDF |
V·System 6.0 Reference Manual Distributed Systems Group David R. Cheriton and Keith A. Lantz. Principal Inv~tigators Computer Systems Laboratory Deparanents of Computer Science and Electrical Engineering Stanford University 20 June 1986 Hi Preface The following are a list of some of the major changes evident in Version 6.0 as compared to Version 5.0: • General changes: o Support for Sun2lS0's, Sun..3's and VaxStation-Irs. o Better documenltation: as you can see... • Lots of new commands. including: o the C program development environment, including ccS8, 1 de8, and bu 11 d, an enhanced version ofmaka o draw has been completely redone, including Postscript support o the Revision COllltrol System o xli sp, a variant ofUsp o 'The family ofTeX document compilers, including tax and 1 atax (sorry, no sources) • New or changed services: o Global authentircation scnices: Users now authenticate themselves once and need no longer authenticate each "session" independently. This is implemented by a combination of a global authentication server and V-to-UNIX "correspondence tables" maintained by the V servers running under UNIX. o Decentralized object naming: Local name servers have been eliminated in favor of each manager maintaining the name space of the objccts it manages. Objccts are located with group [PC. e Group IPC: Logically. messages arc now sent to groups of processes, rather than to individual .proccsscs. ("Singleton" groups arc. in fact. special cased.) This pennits a sender to send one copy of a message, but have it delivered to multiple recipients, in response to which multiple rcpHes may (and can) be received. .) "RAM disk": A V-storage-scrver-compatible server whose files arc stored in main memory. Useful for temporary files and the like. This reference manual attempts to be as faithful to the indicated release of the system as possible. Unfortunately. there are almost certainly many errors - most frequently errors of omission. rlne typical solution to this problem is to read the source code. but this too has its problems. The V-System is the product of a r~search effort and is constantly undergoing revision. It has not always been possible to keep released and experimental versions sUictly separated. Often. the source will include conditionally compiled code, or dcclarnlions fhr constant'i alild dala types t11at are not fully supported in the released version of the system. 'Illerefore. programmers should be wary of using teatures found in the code that are not documented in this manual. In brief: W""';",.· Any advisory. pan of the V-System may changc without notice. As a result. this document should be regarded strictly as Notes for installing the Y-System are to be found in Appendix C. Contributing authors include Lance M. Rcrc. Eric 1. Berglund. Per Rothner. Kenneth P. Brooks, David R. Chc!riton. Stephen E. Deering. J. Craig Dunwoody. Judy L. Edighoffer. Ross S. Finlayson, Cary Gray, Bruce L. Hitson, David R. Kaelbling. Keith A. Lanu.. TimotilY P. Mann. rl110mas Maslen. Robert 1. Nagler, V·Systelll 6.0 RCrt'ft'ncc Manual 16Junc 1986 William I. Nowicki, Joseph Pallas, Paul J. Roy, Jay Schuster, Michael Stumm, Marvin M. Theimer, Christopher Zuleeg. and Willy Zwaenepoel. The following arc trademarks of Digital Equipment Corporation: DEC, DECSystem-20, Tops-20, Unibus. VAX, VAxStation. VMS, vr-100, and MicroVAX. Ethernet is a trademark of Xerox Corporation. SlDl Workstation is a trademark of Sun Microsystems Inc. UNIX is a trademark of AT&T Bell Laboratories. V-System is a trademark QfLeland Stanford Junior University. V·Syst('ft16.0 Reference Manual 16 June 1986 , Table of Contents Preface .' 1. Introduction 1.1. The Hardware Environment 1.2. The User Model 1.3.. The System Model 1.4. The Application Model 1.5. Outline iii 1·1 1-1 1-1 1-2 1-4 1-7 Part I. Using V' 2. User Interface Overview 2.1. The User Interface Architecture 2.2. Oetting Started 2.3. VOl'S Conventions ." 2.4. Workstation ~fanagement 2.5. Line Editing Faci1iti(~ 2.6. Paged Output Mode 2.7. Sending Mouse Events to Text-:oriented Applications 2.8. Emulating the Mouse with the Keyboard 2.9. STS Conventions 3. Using the V executive 3.1. Introduction 3.2. Naming 3.3. Logging [n and Out 3.4. Remote Program Execution on a Unix Server 3.5. Remote Exccution on V Hosts 3.6. Facilities for Command Specification and Modification 3.7. Support for Heterogeneous Processors 4. Command Summary 4.1. Workstation Comm2lnds 4.2. Commands on Non-V Hosts 5. am,aze: A Maze Game 6. checkers 7. bits: a bitmap and faInt editor 7.1. Command Input 7.2. Rasters 7.3. Changing Raster Siz1e 7.4. Bitmap I/O 7.5. Painting 7.6. Inverting a Raster 7.7. Raster Operations (BitBlt) V-System 6.0 Reference Manual 2·1 2-1 2-4 2-6 2-7 2-10 2-11 2-11 2-12 2-13 3-1 3-1 3-1 3-2 3-3 3-4 3-4 3-7 4·1 4-1 4-9 5-1 6·1 7·1 7-1 7-1 7-1 7-2 7-2 7.. 2 7.. 2 17.June 19M 7.8. Reflection and Rotation 7.9. [Replace in table] 7.10. Making a Copy of the Screen,; CURRENTLY NON-WORKING 7.11. Fonts 7.12. Sample Texts 7.13. Printing a Raster 7.14. Bugs and Problems 8. build: Maintaingroups of dependent programs 7-2 7-2 7-2 7-3 7-3 7-4 7-4 8·1 8-1 8-1 8-1 8.1. Macros 8.2. Including other dependency files 8.3. Conditional dependency rules 8.4. Search paths 8.5. Dependency patterns:··'; 8.6. Suggestion .. ~.; . 8.7. Bugs 8-r . .. 8-2 8-2 8-2 9. debug: The V Debugger 9-1 9.1. Synopsis 9.2. Description 9.3. Commands 9.4. Bugs 9-1 9-1 9-2 .. 9-6 10. draw: A Drawing Editor 10·1 10.1. Conceptual Model 10.2. Screen Layout 10.3. Generalstyle ofintcraction 10.4. Control Points and Sticky Points 10.5. Mouse Duttons 10.6. Verbs 10.7. Nouns . 10.8. Attributes 10.9. Commands 10.10. groups 10.11. Inserting Draw pictures in text documents 10.12. Joumalling 10-1 10-1 10-3 10-3 10-4 10-4 10-5 10-6 10-7 10-9 10-9 10-11 11. hack: Exploring The Dungeons of Doom 11·1 11.1. Command format 11.2. Description 11.3. Options 11.4. Authors 11.5. Files 11.6. Bugs 11-1 11-1 . 11-2 11-2 11-2 ll-2 12. siledit: A Simple Illustrator 12.1. Dasic Operation 12.2. Commands. 12.3. Selecting Alternate Fonts 12.4. Generating Printed Copy V'Syst"m 6.0 Reference Manual '12·1 -·1 12-1 12-1 12-3 12-3 17 June 1986 vii 13. timeipc: A V Perfornlance Measu rement Tool 13.1. Types of Tests 13.2. Process Configurations 13.3. Input to limeipc 13.4. Output from limeipc 13.5. ~arnings and Precautions 14. ved: A Text Editor 13-1 13-3 13-4 13-5 13-6 ''; I 14.1. Starting up 14.2. Some Notational Conventions 14.3. Special Commands 14.4. Cursor Motion 14.5. Paging and Scrolling 14.6. Special Characters 14.7. The Kill Buffer 14.8. Ba<;ic Editing Commands 14.9. Mark and Region 14.10. C-Spccific Editing Commands 14.11. Searching and Replacing 14.12. File Access 14.13. Windows and 8utT(~rs 14.14. lbe Mouse 14.15. lbe Right Hand and the Left 14.16. Ved Initialization 14.17. Crash Recovery 14.18. Some Hints on Usage 14-1 '" -.1 15. xlisp: An Experimental Object Oriented Language 15.1. Introduction 15.2. A Note From the Alllthor 15.3. XLISP Command Loop 15.4. Break Command Loop 15.5. Data Types 15.6. lhe Evaluator 15.7. Lexical Conventions 15.8. ObjeCts 15.9. Symbols 15.10. Evaluation Functions 15.11. Symbol functions 15.12. Property List Functions 15.13. r.ist Functions 15.14. I >CStnictivc loist Functions 15.1.5. Predicate Function:s 15.16. Control Functions 15.17. Looping Functions 15.18. The Program Featlllre 15.19. Debugging and Error Handling 15.20. Arithmetic Functions 15.21. nitwisc I.ogical FUllctions 15.22. Relational Functions 15.2.3. String Functions V'Syslcm 6.0 Reference Manual 13-1 14-1 14-1 14-2 14-2 14-3 14-3 14-3 14-3 14-4 14-4 14-5 14-5 14-6 14-7 14-8 14-9 14-12 14-13 15-1 15-1 15-1 15-2 15-2 15-2 15-3 15-3 15-4 15-6 15-6 15-7 15-8 15-9 15-11 15-12 15-13 15-14 15-15 15-16 15-17 15-18 15-18 15-19 17 Junr 1986 nU 15.24. Input/Output Functions 15.25. File 110 Functions 15.26. System Functions 16. Standalone Commands 16.1. Vload 16.2. Netwatch··. " 16.3. Postmortem 16.4. Diskdiag- 15-19 15-21 1S~21 16-1 16-1 l 16-4 16-6 16-6 . Part II. V Programmi"ng' .' '(:;i 17. Program Environment Overview. 17.l. Groups of Functions .: 17.2. Header Files 18. Program Construction and.:~xecutlon 18.1. Writing the C Program '. 18.2. Compiling and Linking 18.3. Program Execution " 18.4. Program Initialization ',. 19. The V·System Configuration. Database 19.1. Querying the Database:· ~,: 19.2. Currently Defined Keywords 19.3. Implementation 19.4. Usage 20. Control of Executives 21. Fields: Using an AVT as a Menti ~ 21.1. Formats· ,I 2L2.1be l--ield Table as a Menu: Selecting an Action 21.3. Displaying Fields 21.4. User Input to Fields 21.5. An Example: 21.6. Limitations 22. Input and Output 22.1. Standard C I/O Routines 22.2. V I/O Conventions 22.3. V 110 Routines 22.4. Portable binary integer I/O 23. Intra-Team Locking 24. Memory Management" , 24:1. Usc in multi-process teams 25. Naming 25.1. Current Context 25.2. Descriptor Manipulation 25.3. Local Names or Aliases 25.4. Naming Protocol Routines 25.5. Direct Name Cache Manipulation 11\ ,,', V'SyslC!m 6.0 R~rcrc.'ncc Manual 11-1 17-1 j 17-2 18·1 18-1 18-1. 18..2 18-3 19·1 19-1 19..1 19.-2 19-3 20·1 21·1 21-1 21-2 21-2 21-2 21-3 21-4 22·1 22-1 22-1 22-2 22-9 23·1 24·1 24'-2 25·1 25-1 25-1 25-2 25 .. 3 25-4 17 .June 1986 Ix 25.6. Environment Variables 26. Numeric and Mathematical Functions 26.1. Numeric Functions 26.2. Mathematical Functions 27. Processes and Interprocess Communication 27.1. Process-Related Kernel Operations 27.2. Logical Host-Related Functions' .. ' 27.3. Other Process-Relat(:d Functions 27.4. Process Group Operations 27.5. Interprocess CommUlnicritioii" 28. Program Execution Functions 28.1. Program Execution " 28.2. Host Selection 28.3. Remote Exccutio~,~fUnix Commands 28.4. Other Program Executio~ I~outines 29. User Interface Funct,ions 29.1. Virtual Tenninal and View Management 29.2. ANSI Tenninal Emulation 29.3. Graphical Output 29.4. Graphical Input 29.5. Miscellaneous Functions 29.6. Example Program 29.7. Some Logistics 29.8. Rolling Your Own 30. Miscellaneous Functions 30.1. Time Manipulation Functions 30.2. Strings 30.3. Exception Handling Functions 30.4. Other Functions 2S-S 26·1 26·1 26-1 27·1 .27-1 "27-6 '21-7 27-8 "'27-9 ~8·1 . ·28-1 i ;28-3 ; .. ,28-3 '\ .-28-4 .29·1 29-1 29-2 29-5 , 29~12 29-14 29-15 29-17 29-17 30·1 30-1 30-2 30-4 30-4 Part UI. V Servers 31. Servers Overview 31.1. The 8asic Servers - hI Isolation 31.2. 'Inc System in Operation 31.3. Summary 32. Message Codes and Format Conventions 32.1. Message Fonnat Conventions 32.2. Byte-Ordering Considerations 32.3. Standard System Request Codes 32.4. Standard System Reply Codes 33. Tho V-Syste~ 1/0 Pr'otocol 33.1. CREATE INSTANCE 33.2. QUERY INSTANCE 33.3. CREATE DUPLEX INSTANCE 33.4. RELEASE INSTANCE 33.5. READ INSTANCE V·System 6.0 Rdercncc Manual 31·1 31-1 31-5 31-8 32·1 32-1 32-1 32-2 32-2 33·1 33-3 33-4 33-4 33-5 33-6 17 June 1986 x 33.6. WRITE INSTANCE 33.7. SEf INSTANCE OWNER 33.8. SET BREAK PROCESS 33.9. SET PROMPI' 33.10. QUERY FILE and NQUERY FILE 33.11. MODIFY FILE and NMODIFY FILE 34. The V-System Naming Protocol 34.1. Overview 34.2. Character String Names 34.3. Contexts and Context Ids 34.4. Prefix Caching ~4.5. Static Context Identifiers 34.6. Generic Names and Group Names 34.7. Name Request Fonnat. 34.8. Name Lookup Algorithm 34.9. Standard CSNH Server Requests 34.10. Context Directories and Object Descriptors 35. Authentication and the Authentication Server 35.1. Authserver 35.2. User Numbers 35.3. Authentication Library Functions 35.4. Adding a New User 35.5. Authentication Database . 36. Device Server 36.1. Ethernet 36.2. Disk 36.3. Mouse: The Graphics Pointing DeviCe 36.4. Serial Line 36.5. Console 36.6. Framcbuffer 36.7. Null Devices 37. Exception Server 38. Exec Serve~ 39. Internet Server 39.1. Running the Internet Server 39.2. Acccs.c;ing the Internet Server 39.3. DARPA Internet Protocol (lP) 39.4. DARPA Transmission Control Protocol (rCP) 39.5. Adding New Protoculs 39.6. Monitoring and Debug Facilities 40. Memory Server 41. Pipe Server 42. Team Server 42.1. Overview 42.2. Team I.oading 42.3. Team Tennination and Exit Status Values 42.4. Host Status V·System 6.0 Ih,rercnce Manual 33-6 33-7 33-7 33-8 33-8 33-8 34·1 34-1 34-2 34-2 34-3 34-3 34-4 34-5 34-5 34-6 34-9 35·1 35-1 35-1 35-2 35-4 35-4 36-1 36-1 36-2 36-2 36-3 36-3 36-3 36-4 37·1 38·1 39·1 39-1 39-1 39-2 39-2 39-3 39-11 40-1 41·1 42·1 42-1 42-1 42-2 42-2 17 .Junt 1986 xi 42.S. Remote Execution 42.6. Round-Robin Scheduling 42.7. Exception Handling 42.8. Migration 43. Unix Server 42-2 42-3 42-3 42-3 43-1 43.1. Sessions 43.2. File Access 43.3. Program Execution, 43.4. File Descriptors 43.5. Debugging Se·ssions 43-1 43-2 43-3 43-3 43-4 44. Workstation Agents 44-1 44.1. Implementation of Workstation Agents 45. Simple 'Terminal Server 45.1. STS Line Editing Facilities 45.2. Hardware Environment 45.3. Remote Tenninal Server 46. Virtual Graphics Terminal Server 46.1. Current VOTS Versions 46.2. Avr Escape Sequences 46.3.~OTS Message Interface 46.4. Internal Organization 46.5. Debugging the VOTS 44-1 45-1 4S-1 4S-1 4S-2 46-1 46-1 46-1 . 46-3 46-4 46-S Part IV. Appendices Appendix A. A V-System Bibliography Appendix B. C Programming Style 0.1. General Format 0.2. Names R.3. Comments 8.4. Indenting B.s. File Contents 0.6. Parentheses B.7. Messages Appendix C. Installatioln Notes C.l. V-System Distribution Tapes C.2. Binary Distribution Tape C.3. Source Distributiol1l Tape Appendix O. List of Library Functions defined in libc Index V'System 6.0 Rder('ncc M:mual A-1 B-1 0-1 8-1 8-2 8-3 U-J 8-4 8-S C-1 C-l C-l C-7 0-1 Index-1 17 June 1986 xii 'List of Figu res Figure t-l: A workstation-based distributed system. Figure 1-2: rille distributed V kernel. Figure 1-3: Client interfaces to the V-System Figure 1-4: Some possible applications. Hgure 10-1: The Draw menu Figure 10-2: An example figure . Figure 31-1: The V-System: A single workstation view. Figure 31-2: VOTS process structure. Figure 31-3: Loading a team. Figure 31 -4: Handling an exception. Figure 34-1: Decentralized Global Directory V·System 6.0 Hdcrrnce Manual 1-2 1-3 1-4 1-6 10-2 10-10 31-2 31-4 31-6 31-7 34-2 .7 June 1986 "iii List of T'ables Table 2-1: Accelerators thr workstation management functions. Table 2-2: Events that generate escape sequences. Table 29-1: Encodings for graphical escape sequences. V·S1~tCn1 6.0 RcCercll('e Manuol 2-10 2-12 29-4 17 JUlie 1986 1·1 -1I nt rod u ction The V-System is a message-based distributed operating system designed primarily for high-performance workstations connected by local networks. It permits the workstation to be treated as a multi-function component of the distributed system. rather than solely as a intelligent terminal or personal computer. Ultimately. it is intended to provide a general-purpose program execution environment similar to some degree to UNIX. The programs are intended to interact with each other, and with programs running on traditional timesharing systems. to produce an integrated distributed system. 1.1. The Hardware Environment 1be V-System is targeted for a hardware environment consisting of(sce Figure 1-1): • powerful workstationsl with: o a high-resolution (e.g. 1024 by 1024) raster display; o a general-purpose 1 MIPS (or better) processor; o 2 Mbytes or motre oflocal memory; o a large (greater than 20 bits) virtual address space; o a graphics input device, such as a mouse: and optionally, o adist which. typically. will be dedicated to a single u~r at a time; • a fast (greater than 1 ~,1H7.) communications network that wil1link the works~1tions; • a number of dedicatc~d processors providing printing, file storage. general computation support. and other services; and • access to time-sharing or special-purpose computers and to long-haul computer networks. This release of the system runs on Sun and VaxStation workstations interconnected by either 3 or 10 Mb Ethernet "Guest-lever' implementations are available for 4.2BSD and 4.38SD UNIX systems (with Stanford enhancements). 1.2. The Use r Model One of the most important functions for the workstation is to provide state-of-the-art user interface support. rille workstation should function (1S a frolll elld to all available resourccs. whether lncal to the worksL1tion or remote. To do so. tJ1C V-System adhercs to tJuee fundament,,1 principles: 1. '1111e interface to app~ication programs is (reasonably) independent of particular physical devices or intervening networks. 2. The user is allowed to perform multiple tasks simultaneously. 3. Response to user interaction is fast Adhering to these principles. the V-System supports a reasonably sophisticated "window system", Multiple exccutives or shells may be run simultaneously. each of which may run one "pptication in the "foreground" and any number in tJ1C "background" (a la the UN IX C-shell). Applications may nm local to thc workstation or remote. r.:ach application may be associatcd with one or more scptlratc.,irlualtermillals, each of which may V'S,stclIU 6.0 Rderence Manual 17 June 1986 IntrodlictioD 1-1 Cluster ., Network User Cluster Cluster Network Network User User User USer --==-----. User t.=::cr--. a.==...---_ Trunk Network Long-haul Gateway Network Workstation Printer Server File Server Timesharing System 14'igurc I-I: A workstation-based distributed system. -be used to emulate either a vr-lOO terminal or-A 2-D "structured graphics" tenninal. 1.3. The System Model The V-System adheres to the server model: rille world consists of a concetion of resources al'Cessible by diellls l and managed by servl'rs. 1\ server dcfines the abstract reprcsentation of its rcsourcc(s) and the operations on Ulis representatiun. A resuurce may only be "cccs.~d or manipulaled through its server. Because servers are constructed with well-defined interfaces. Ule implementation demils of a resource are of concern only to its server. Note that a server frequen~ly acts as a client when it accesses resources managed by other servers. Thus. client and server are merely roles played by a process. Clients and servers may be distributed throughout the (inter)network. By default. access to resources is network transparent; a client may llCCCSS a remote resource with the same semantics as it accesses a local resource. The result is an environment in which clients may communicate with servers without regard for the 1A client is a program requesting access to a resource, typically on behalf or a human V-System 6.0 Reference Manual US". 17 June 1986 The System Model 1-3 topology of the distributed system as a whole. However. we do not intend that a client cannot detenninc or influence the location of a particular resource, rather that a transparent mechanism is available. Moreover. we allow for clients and servers that were not written with network-transparent access in mind. ' Architecturally. then. the V-System consists of a distributed kernel and a distributed set of server processes. 1.3.1. the Distributed ICernel The distributed kernel consists of the collection of kernels resident on each participating machine (see Figure 1-2). Each host kernel provides process management. interprocess communication. and low-level device management faciliti'cs. All other operating system services are implemented as (collections) of processes outside the kernel. A host kernel may be implemented at a base level (as on the SUN workstation) or a guest/evel (as under 4.2BSD). workstation r I11 - - - ---01 ____ ~ distributed -1'-- kernel kernel ----- -------1-1 kernel kernel II 1 interkernel protocol IL ------- - - - - - ______ ___.__________________ ~ I _~ __ I ~Arl.I~----------------- r Ethernet Figure 1-2: The distributed V kernel. The host kernels arc integrated via a low-overhead illler-kenlel protocol (lKP) that supports transparent interproces.') communication between machincs. IKP is a reliable request-response protocol. intermediate in complexity between conventional datagram and virtual circuit protocols. 1.3.2. Servers Servers include: virtual graphics lenninal server Provides all terminal management functions. including Vr-lOO emulation and 2-D graphics. One per workstation. . . interne! server' Provides network and transport level support for'traditional network nrchitcctures. nnmcly, ARPA Inllernet and Xerox PUP. Higher-level protocols. such a~ TEI.NET. are provided as separate packages that interface to the internet servcr. V,SYS."nI 6.0 Reference Manual 17.June 1986 IntroducUOD 1-4 pipe server Provides asynchronous, butTered communication facilities similar to UNIX pipes. team server Provides team creation, destruction, and management One per workstation. exception server Fields process exceptions and dispatches them to registered handlers, such as debuggers. One per workstation. storage server Provides file storage. device server(s) Interfaces to a specific physical device, such as the console, mouse, serial1inc, or disk. 1.4. The Application Model In general. it is just as easy to write applications to run under the V-System as it is to write applications to run under any traditional operating system. such as UNIX. A standard program environment is defined, the principal instance of which is the C program library. The C library provides runtime suppon for standard C and UNIx-like library functions, including both byte-stream and block-I/O facilities (see Figure 1-3). In effect. these libraries can be used to "hide" the underlying V-System kernel ~ thus facilitating the porting of existing C programs. User Programs " .. ' C Library Byte Stream Library _JL_ 1/0 Protocol - - - - --T.-- - - - - Kernel Stub Library " " Kernel Figure 1-3: Client interfaces to the V-System On the other hand. an application programmer may choose to ~1ke advan~,ge of the enhanced £.1Cilities provided by the V-System. These Ihcililic..'S fall in two major categories: user interaction and concurrent programming. Additional advantage accrues from tJle fact that applications may be distributed across multiple m~lchincs. V'Systl'm 6.0 Reference Manual 17 June 1986 The ApplicatioD Model 1·5 1.4.1. User Interaction With respect to user intc:raction, the V-System provides two principal enhancements over traditional UNIx-like systems. First, a program may manipulate multiple vinual tenninals (windows) simultaneously. Second. an application may employ structured graphics. Specifically. a graphical object can be defined in terms of other objects, which can in turn be defined in terms of yet other objects. Thus. the VGTS supports structured display files rather than the more common segmented display files. The resulting l'irtual graphics tenninal protocol (VGTP) is a high-level object-oriented protocol that minimizes both the frequency of communication between application and VGTS and the amount of data transmitted at anyone time. 1.4.2. Concurrent Programming Using the distributed kernel well requires understanding the model of processes and messages that the kernel provides, and how they ar~ intended to be used. Processes represent logical activities within the application. 'Illey are intended to be sufficiently inexpensive to allow the use of multiple processes to achieve the desired level of concurrency. In panicular. multiple processes may share the same address space or leam. to facilitate fine-grain sharing of code and data. A team must be entirely contained on a single machine. Processes can be dynamically created and destroyed. When a process is created, it is assigned a unique process identifier that is used subsequently to specify that process. Synchronous messagc-pas.~ing &1Cititates communication between processes that looks to the sender like a procedure call. That is, the sender blocks until a reply to his request is received. Greater flexibility is provided to the receiver to allow scheduling of requests. Messages are addressed to thc process identificr of the recipient; thcre is no con1cept of a mailbox or port distinct from a process. Messages arc short and fixed-length. To facilitate transfer of large amounts of data. a separate data transfer facility is provided. Spccifically. a process can pass. in a message. access to an area in its team space. This facility follows the procedure paradigm in being used primarily to access what are logically "cail-byrefcrencc" parameters. Sync:hronil.ation between the two processes involved in the data transfer is guaranteed by vinue of thc fact that the recipient will not reply to the sender (and hence awaken him) until the transfer is complete. lbe lcernet also provides process groups and group interprocess communication. Each process can create, join. and leave groups dymllmically. and can belong to many groups simultaneously. A message sent to a group is delivered reliably tu the first group member lo reply, and unreliably to the rest Replies subsequent to the first may be received (unreliably) by the sender. or ignored. at its option. Procc.'SS scheduling is stric:tly priority~bascd. The effcctive priority of a process is the sum of its process priority and its team priority. Team priorities are dynamically varied by the team server to provide timeslicing. . . 1.4.3. Classes of Applic:ations From the previous discussion it should be apparent that applications may run local to the user's workstation or on any other host accc~ssibic via the various network protocols. Ultimately. all applications must communicate with the user via the virtual graphics tenninal server (VGTS) resident Oil the user's workst41tion. The application inter'lacc to Ilhe VGTS is referred to as the virtual graphics tenninal protocol (VGTP). 111e VGTP is cons~'nt over all applications. However, some applications have no knowledge of the VGTP and some applications arc running on machines that do not support the interproccss communication mechanisms underlying the' VGTP. The following situations arise (see Figure 1-4, in which each intcrmachine arc is labeled with an example (presentation pr%col. transport protocol) pair): • Application A runs (>n the workstation and communicat~ via the VGTP. Current examples includc text editors, document illustrators, ~md design aids, many of which arc documented here. • Application B runs on a machine that supports V kernel services, specifically, network-transparent V·Syslem 6.0 Reference Manual 17 June 1986 Introductioa 1-6 VAX VLSI Layout Editor SUN Compiler VGTP VGTP RTP/BSP IKP DEC·20 VAX Local Illustrator Text Editor Tetnet TCP Distributed Game Custom NaP Figure 1-4: Some possible applications. interproccss communication via IKP. B communicates with the VGTS via the VGTP, as in the case of a application A. • Application C nms on a machine that docs not suppon IKP. but docs support a traditional network architecture such as the (ntemet protocol filmily. In addition. a VOTP interface package is available that encapsulates the VOTI' within the appropriate transport protocol. Similarly. a local agent fhr the application. C: is created on the workstation to d(.'Capsulate the VOTP. 'l1lUs. the application may still be written in tcnns of the VOTP and neither it nor the VOl'S have any knowledge that the other is remote. Our VLSllayout editor, for example. can be run in this fashion under VAX/UNIX. • Application D has no knowledge of the VOTS or the VOTP; it wishes to regard the workstation as just another tcmlinal. The local agent, D: is "user TELNET" and pcrfonns the appropriate translations between Tl!LNET and VGTP. Any pre-existing application that runs on a remote host falls into this class. • Application E is distributed hetween the workstltion and one or more other machincs. 'Ine local agent, E: is responsible for representing the multitude to the VOTS. It must perfonn the appropriate set of protocol conversions indicated above. In addition. it may wish to perfonn application-sp<.'Cific functions. such as caching. In that case, the protocol used to communicate with the remote applications may require more than simple transpon service. The Amaze game documented herein is an example of such an application. V-System 6.0 Rdercft(,c Manual 17 June 1986 The Application Model 1·7 1.5. Outline The remainder of this manual c?nsists of four parts: Part'l Using V: describes the user interface and available application programs. Part 2 V Programming: defines the V-System program environment in terms of the existing C program Inbrary. Part 3 V Servers:: defines the standard message fonnats, request and reply types, and protocols; presents the various server-specific protocols: and gives some implementation details. . Part 4 Appcndic(s: a V-System bibliography, notes on programming style, installation notes, and a list of where the various library functions are defined. • V·System 6.0 Reference Manual 17.June 1986 Part I: Using V 2·1 -2- User Interface Overview This chapter presents an overview of what it is like for the user to interact with the V-System. Details of tenninal emulation or graphics support' are not 'discussed, since that is best described by the programmer's interface in Chapter 29. Rather. the basic stylistic conventions are presented. including an o\"erview of how applications' actions are manifested to the user. Also included is a discussion of the the basic architecture of the user interface. in the hop·e that it will enable the us~r to better understand the style of inte:-dction and the facilities available to him. 111e user who is "in a hurry" to get started may skip this discussion, at least on first readin& and begin with Section 2.2. The following chapter discusses command interpretation in some detail. 2.1. '·he User Interface Architecture In a typical operating syst1em, the user is presented with the illusion of interacting with a single, unified front end. often referred to as an "executive" or "shell". However, in contemporary workstation-based systems., this front end actuaUy provides three basic levels of interaction: " l. dc,ice 110: Manipulation of input devices and generation of output on output devices. 2. command interpretation: Command (or argument) specification and response handling, and invocation . of applications. 3. window management: ~,fanagement of multiple simultaneous applications (in separate "windows"). Rather than combine these three levels of function in one module, the V-System distinguishes three separate software components - respectively: 1. the workslation agent, 2. the execU/ive. and 3. the work.slalion ma"agi~r. This separation was inspired by a desire to be able to configure each component independent of the others. While this release of the V-System docs not reflect the ideal realil.ation of this separation. it nevertheless fits the basic framework. Womilf,: The workstation agcnt was originally refcrred to as the terminal agent. The two tenns arc used int.crchangc:lbly. " 2.1.1. Workstation Agents The workstation agent provides the lowest-level interface between the hardware and the rest of the system. One of it') principal functions is to hide any idiosyncrasies of that hardware - through a virtual tenninal interface. 2.1.1.1. Virtual Terminals Rather than dealing with Ithe "raw" hardware. applications internet with a virtual tenninal. They request input from a virtual keyboard or mouse, for example. and write output to a virtual stocc. Depending on the "class" of reat tenninal (workstation) being emulated. the characteristics of the virtual input and output devices may vary widely. In the simplest implementation. each workstltion agent emulatl.'S exactly one class of real tenllinal: emulating a different tenninal requires a new workstation agent More sophi3ticated workstation agents emulate multiple classes pf tenninals simultaneously. Note that the number of classes 0/ lenninGls emulated is independent of the number of virlual/enuillals being emulated at anyone time. Using V 17 June 1986 User Interface Ove"iew 1·1 Historically, the most common clas.ct of terminal emulated has been the page-mode (character) tenninalexemplified by the DEC Vr-lOO. Even in this case. the workstation agent can be thought of as emulating different types of terminals, corresponding to the various input and output modes provided by a Vf-lOOcharacter-at-a-time versus block transmission. local editing facilities, and the like. In general. the workstation agent. through its virtual tenninals, provides a set of facilitics that might be refcrred to as "cooked lion ranging from character cc:hoing to line-editing to page-editing to graphics-editing. These facilities are enabled and disabled on a virtual terminal by virtual terminal basis. True to its name, a virtual terminal nced have no physical, real-world manifestation. In particular, it is possible to write output to a virtual terminal without seeing that output displayed on the screen. Hence, any application may run and change the store of any virtual tenninal at any time. While it is common for multiple applications to be generating output simultaneously, it has historically (if erroneously) been thought less desirable to permit the user to direct input to multiple applications simultaneously. True to this historical bias, the V-System currently restricts input to one application at a time. We refer to the application and associated virtual tenninals as being "selected" (for input). Selection for input has no effect on the underlying application's ability to generate output. As with output, however, it is possible to generate kcyboard input for a virtual tenninal without having the virtual tcnninal mapped to the screen; users should be wary of the possible consequencesl 2.1.1.2. Views In order for the user to actually see the output from or generate graphical input to a virtual terminal, the virtual tcnninal must bc mapped to thc· screcn through a view. A view defines thc portion of the vinual tenninars store that should be displayed, the area on thc screen in which it should be displayed, and the transformation that should be applied whcn mapping thc store to the screcn. Using traditional graphics tenninology, the store is referred to as the display file, the portion of the store is a Willdow, the area of the screen is a viewport. and the transfonnation is a viewing Irans/onnalion. 2 Viewportsarc invariably rectangular, ... although there l'i no conceptual reason for this to b.e the case. Typically. an .lpplication will create one view of a virtual tcnninal at the same time it creates the virtual terminal. Nevc,thelcss, vicws are main~1ined as entities distinct from virtual terminals because, in general, each virtual terminal may have more than one view associated with it When using the YGTS. for example, the same picture. maintained as one entity by the program. may appear in two separate view ports on the screen. possibly with different viewing transformations. That is. a second view may look upon a different portion of the virtual terminal's store from the first. or at a different magnification. Note: UCCIUSC a view is the physical mnnircstation of a vinuallCrminal on the di!q)lay scrccrt. we will tend to U.4iC the lcnn "vicw" rathcr than "vinual tcrminal" when discussing screen management is.\"Ues. Where ncccssary to be even more specific. we wil~ usc the tcrm "viewport". So. a virtual tenninal may be ac;.c;ociated with more than one view. On the other hand because the virtual terminal is independent of its physical manifestation. there need be no views associated with it Destruction of all views does not in any way affect the virtual terminal. though it will make it rather difficult for the user to sec what is going on. . One common policy is that views are the domain of the user. A program that creates a virtual terminal should create a view of it. so that the lIser knows lhat it exists. hut "fler that. in the ordinary course ur things. the program should leave the view alone. The program should not depend on the continue existence of that view, nor need it be aware of any other views of the virtual terminal that the user chooses to create. Let the user decide where on the screen he wants views to be, and how big. and with what viewing transformations. That is what the workstation manager is for. 2UnronUnalCly, traditional "window systcm" tcrminology tends to usc the word "window" to mean any or aU defincd). vicwpon.. view. or vinual tcnninai. 17 .June 1986 V·Sys'~m or window (as just 6.0 Rcrcrcncc Manual The Uscr Interrace Architecture 2.1.1.3. V-System Agents 1·3 ." •t lbe V-System currently supports two workstat~on agents. the simple lenninai server (STS) and the ~irtual graphics tenninal server (VGTS). The STS providcs basic text tenninal emulation by making the workstation appear as a single. traditional. page-mode tenninal - compatible with ANSI standard X3.64.) Character echoing and line-editing arc optional. The STS is used principally to interface to ASCII terminals. but it can also be used over remote tc:rminal connections and as the interface to the nonnal workstation keyboard and display. . The VGTS provides considerably greater functionality, including support of what is commonly referred to as a window system (more on this later). Any "window" may emulate the same type of terminal provided by the STS. Alternatively. a window may emulate a (structured) graphics terminal that provides roughly the tacilities available in the ISO standard Graphical Kernel System, together with rudimentary modeling facilities in the fonn of stru1ctured display files. Thus, the VGTS provides simultaneous support for two very different types of real teoninal. Each virtual terminal may have any number of views associated with it. Any number of views of any number of virtual terminals can be mapped to the screen at the same time. Applications arc unaware of the number of views or what is being displayed in them. except insofar as graphical input events return the appropriate world coordinatcs. The VGTS is used when it is desired to make the best use of devic(:s typically found on contemporary workstati9ns - such as bit-mapped displays, en~odcd keyboards, and mice. While the abstractions lfor keyboard and mouse are common across (existing) virtual terminals, the abstractions for the store are quite different, as discussed in Chapter 29. When neccs.~ry to distinguish the two classes of virtual terminals currently supported,· we wilt refer to the type of virtual terminal that emulates an ANSI standard tenninal as an ANSI virtual tennillai (A Vf) and the type of virtual terminal that emulates a structured graphics tenninal as a structured graphics virlual tenninal (SGV1). ' Wami",: The "store" of an AVT is referred to as a pad UnfortunalCly~ that lCnn has been most frequently (and erroneously) used ac; a plateholder for the complete AVI' abstraction, While this manual attempts to use each lenn where it -is appropriate, thc code uses "pad" almost exclusively, Consequently, many of the routines described herein also refer to "pad", Similarly, the term "vinual graphics tcnnina'" (or VG1,) has been used almost exclusivcly in the code, rather than the lcnn "structured graphics vinual tcnninal", In both cases, we trust the readcr will be able to make thc appropriate semantic substibJtions. The bulk of the discussion to fonow assumes usc of the VOTS. 2.1.2. Workstation Managers 111e workstation manager permits the user to control multiple simultaneous execlltives -- with accompanying applications.. 'lluough it executives are created and destroyed. programs arc interrupted and kH1ed. and both virtual telnninal and views arc manipulated. With respect to the last. in particular, the workstation manager is the module that enforccs the cOllslraillls on view management that the user desires. For example, it enforces thc~ precise position and front-to-back "ordering" of view ports. It is crucial to appreciat:e the distinction between workstntion managers and workslc1tion agents. rille manager exerts "control" over the "facilitics" provided by the agent. while at the same time using those facilities to internct with thc~ user. Different users may want diflerent styk.'S of control. For example. one user may prefer to spccify all views llIanually~ where~ls ,mother user may prefer the system to determine the "best" view "ulUmatically: one user may prefer his view ports to be tiled. whereas another may prefer them to overlap. 'I1,CSC styles are independent of the basic facilities provided by the workstation agent. In principle. it should be possible to define the ideal workstation manager. independent of all workstation agents. But, just as workstation agents arc limited in pmctice by the classes of real terminals they support, workstation managers are -limited in practice by the av,lilable classes of workstation agents.. For example, the VGTS comes with a large and powerful workstation agent, called the view manager, which is accessed via lrhc most widcsprc:ld examplc of a lcrminaladhcring to this standard is the Doc vr -100, UsllII V 17 JUlie 1986 User laterfate OYeniew popup menus. Many of its commands require the user to select or position view ports on the screen. Such "::\.. interaction works best in an environment with a mouse, for example. yet some workstation agents may not' provide an efficient emulation of a !Jlouse. The S1'S, on the other hand. has only a trivial vestige of a workstation manager. Its primary function is to guarantee thc existence of one cxecutive running on the tenninal at aU times. . ~L ,'_ :" 2.1.3. Executives ;.: .... '" \~ t...l '_ Workstation agents and managers provide the basic facilities by which the user interacts with the workstation. But little has been said about how the user actually specifics commands and applications. In fact. these functions are providcd by executives (or shells). Some systems penn it only one executive. often running only one application at a time, but sometimes capable of running multiple applications at' time - onc in the Uforegroundtt and the rest in the "background", for example. Under the STS. the V-System provides one executive (of the latter variety). Under thc VGTS, multiple executives are supponed simultaneously; the view manager is responsible for creating (and destroying) them. ,.,. :~r:,'v,: ": .1: a ,~;\ " ! .' .. ,', - : ... 2.1.4. Summary We have outlined th'e ba.c;fc concepts underlying thc user interface to the V-System. The rest of this chapter discusses the more practical details of how the user actually interacts with the system via its workstation agents.: ':; . .' and workstation managers. Interaction with executives is discussed in thencxt chapter. . 2.2. Getting Started" .. '. , '. ':II:; When you come up to an idle workstc1tion, it may be in one of several states. If the screen is blank. it is probably running V, but idle. The VGTS blanks the screen on idle workstations after a few minutes of inactivity. Move the mouse slightly or press any key on the keyboard to restore the display. A previous user may have left one or more of his sessions (see below) active. The command logout , :":1; will tenninate them all and get you otT to a fresh start. If the workstation is running something other than V, is dead. powered down. or the like. it will be necessary to reboot it. as described in the following paragraphs; 2.2.1. Booting the Workstation, As previously noted. the V-System runs on a variety of workstations. Hooting procedures vary depending on the manuf:,cturer and un the model. Section 16.1 describes in detail how to boot al1 of the workstt1tion , configurations supponed with this rel~1SC. 'lbe following is an overview that should cover most situations. 2.2.1.1. Vax Stations When in the PROM monitor VaxS~,tinns display a »> prompt If the works~'tion is not in this state. press the hal t bullon twice (once to put it in. once to bring it OUl). If this utx,.'sn"t h"lt the machine, prcs.c; reset. These bultuns are on the front panel of the Vax Station CPU. Once at the PROM prompt. the command b xqaO will cause the workstation to boot over the ethe~net 2.2.1.2. SM. Workstations, . .:; An SMI workstation in a random state can be reset to the PROM monitor by holding down thc key in the upper left hand corner of the keyboard. and hitting the "A" key. (,Ille key in the upper Jefl hand corner may be laheled either LI. SI~r-UI). or ERASE EOF depending on the exact muueI.) There is no reset button on SMI workstations. so a very serious crash can make it necessary to power-cycle the workstation. 17 June 1986 ·t,. V'Sysl(,DI 6.0 Rererence I\-lanunl .• ".! 1·5 Getting Started Once you have gotten into the PROM monitor. the next thing to do is to type the k2 command, which simulates a power-up reset (Shortcuts are sometimes possible. but k2 is the safest route.) After the power-up memory test i.4\ completed, the workstation will try to boot its default program. Most Sun workstations at Stanford are configured to boot the V-System with VOTS. The bootstrap program first loads the workstation's configuration file (see Chapter 19) to find out what its defaults are. It next prints "V-System" or "xV-System" to ind!cate whc:thcr the production or experimental version of V is being loaded, then prints the filenames. of the kernel and initial team as it loads them. If you notice the workstaHon is not booting what you want it to, you can interrupt the autoboot with the reset key sequence described above. then type in the exact boot command you want. Most of the time, one of the following simple commands will do the job: Boots the default program. b ", ' . .'.• j Boots the production verSion of the V'System, with the VOTS. b V Boots the experimental version of the V-System, with the VOTS. b xV General boot commands and the V bootstrap loader are described fully in section 16. : .!' ,',111 I' Note: M~t SMt workstati(ms at Stanford use the Sun-2 processor board. but a few Sun-Is have not been upgraded. The above description is correct for SMI workstations with Sun-l processors as well as Sun-2s, but the details of the general boot command and other PROM monitor commands vary. The V k.ernel tickles a bug in the current Sun-3 PROMS. Rebooting a Sun-3 usually requires pow~r cycling the workstation. 2.2.1.3. Cadlinc Workstations .'' .. A Cadlinc workstation in a random state can be reset to the PROM monitor by typing pressing the reset button. or (in desperation) power-cyc1ing the workstation. It is best to try prcs.~ing the comma klcy on a Cadlinc's numeric keypad before resetting it If the V kernel is act~ve at that point this key instructs it to turn off the mouse, necessary for proper operation of the PROM monitor. Otherwise. you may have to power cycle the workstation or keyboard to regain controLks first for a V program in the current context (i.e.• current working directory), then il1l the [bin] context You can specify a different search path using the PATH environment variable (section 3.6.7). If the command is not found on your search path, the exec will try to execute it remotely, on the server that is providing your current c~>ntext The executive waits for c~ach command to exit. unless the last field on the command line is the single character &. In this case, the command runs in the background, while the executive continues to accept commands from the keyboard. The View Manager and STS provide mechanisms for stopping or interrupting a command running in the foreground. A program running in the background may be terminated using the des troy command (see chapter 4). Other exec features arc described in section 3.6. 3 . 2. Naming A context in the V system is similar to the directories provided by other systems such as Unix. Each process (and thus each executive) h;ils its own current context, i.e., current 'working directory. A filename is normally interpreted in the current context. unless it begins with a square bracket f['). The square bracket flags the name as being either an absolute name, or a local alias. In V. the first component of an absolute name generally specifies the type of object or service being named. The second component often specifics a particular server. For example, [storage/pescadero]/etc/passwd names the liJe letc/passwd on the storage server pescadero. 'nle closing square bracket is optional here. Most servers accept it as an alternative to the sumdard slash character f r) used to separate name components. Usel's can define their own local aliases for contexts. using the define and undefine commands. For example, define 9 [sto~age/gregorio]/user/mann defines, [g] as an abbreviation for user Mann's home directory on the storage server Gregorio. The comm,and undef1ne 9 Using V 7.June 1986 Using the V Exccati.e removes this definition. The command printdef lists the local aliases that are currently defined. Several other standard aliases are automatically defined by the executive when you log in. These include [home] The 10~ged-in lIser's home directory. [sys] [b 1 n] The directory containing standard V-System files. The directory from which standard V-System commands are loaded. Normally the same as [sys]b1n. [V] The directory containing standard production V-System files. The same as [sya] if you are running the production V-~ystem. [xV] The directory containing standard experimental V-System files. The same as [sys] if you are running the experimental V-System. The "home" server used for program execution. Nonnally [team/local], the local team server. See section 3.6.9. . When running with the VGTS, aliases defined in any exec created by the view manager are global to all such execs. since all the execs run on the same team. A program run under the exec inherits a copy of the exec's aliases. Later changes to the exec's aliases do not affect it. [hom.x] 3.2.1. Changing the Current Context ' The cd (change directory) command can be used to change the current context for an exec. The command format is cd pathflame The path name is interpreted in the (previous) current context. If the path name is omitte file or cmd » file The latter form specifies that the output should be appended to the ft1e whereas the first form wi1t overwrite any data ulready existent in the ft1e. Error output can be redirected by specifying >1 or »1. The forms >& and> >& redirect both stand,llrd output and standard error to the same file. A special fonn of redirection is available for bidirectional ft1es, such as the serial lines available on Suns. Specifying . cmd <> file cmlses the command's input and output to be redirected to the same file. To be precise. the file is opened in FCREATE mode, and standard output is redirected lo the ins~1nce thus created. Sl4mdurd input is redirected to come frum an instUlce whiose id is equal to the output instance id plus 1. This matches a convention used by severul V-System I/O servers. 111e fonn <>& also redirects standard error to the same instance as standard output Pipes can be set up between several commands by separating them with a I·on the command line. Thus. for exumple. the command line cmd1 I cmd2 I cmd3 > log will create two pipes and redirect [/0 so that the output of cmdl wilt be used as the input to cmd2. the output Using V 7 .June 1986 Using the VExecud,e of cmd2 will be used as the input to cmd2•.and the output of cmd2 will be redirected into the file log. All the special characters described above must be surrounded by spaces for the executive to recognize them. Redirection clauses must appear after all arguments to be passed to the command. 3.6.6. Quoting Command Arguments Sometimes it is desirable to include a space in a single argument to a command. To do thi~ put a pair of either single quotes (t) or double quotes (") around the argument An argument quoted by one ofthesc may contain the other. Unmatched quotes are ma~hed by ,the end of the line. 3.6.7. Environment Variables The command setenv vaT valut sets the environment variable WlT to the character-string value value. (The latter should be quoted if it contains spaces.) As with local aliases for context names, environment variables are shared among all execs created by the View Manager. and are inherited by programs run under any excc. . The command unsetenv vaT removes the definition of var, while the command pr 1ntenv var prints its definition. The pr 1ntdet command with no arguments prints all environment variables. A command argument that begins with a dollar sign ('$') is replaced by, the value of the rest of the nrgument interpreted as an environment variable, if such a variable is defined. Otherwise the argument is left unchanged. When trying to execute a V command. the exec detennines the search path to be used from the environment variable PATH. if it is set. as ~o all programs that use the stand1rd V-System program execution library routines. The value of PATH should be a list of context names separated by spaces. The default path, used if PATH is not set. is"./ [bin)". 3.6.8. Concu rrent Commands , Commands can be specified as beillg concurrent by including an .. at the end of the command line. This causes the executive to return immediately to the user for another command rather than waiting until the current command completes. Also. while nonconcurrent (foreground) commands are tenninated if their executive is deleted. concurrent (background) commands will continue even if the executive that initiated' them goes away. In fact, concurrent commands continue to execute even if the user that initiated them logs out The &must be preceded by a space for the executive to recognize iL 3.6.9. Execution of Commands on Another Host ',' Commands can be designated to execute on another host by including i ] [ ] The unit of migration is the logical host. not individual teams. All remotely executed programs are created in their own logical host. whereas all locally executed programs are run in the system logical host, which never migrates. Thus only remotely executed "guest" programs will ever migrate. Currently there is noway to create a locally invoked program in a separate logical host other than to invoke it remotely from another machine. If no arguments are specified then all guest programs on a machine are migrated to "lightly loaded" machines.. where lightly loaded is defined in the same sense as any is defined when initially executing a program remotely. The -p flag specifies that information about what programs are being migrated where should be printed out The -h flag allows specification of a particular machine to migrate to. The machine to migrate to may be specified by either the hex pid of its team server (in the form Ox(pid» or by giving its official string name (e.g. sun-mj416). If specific programs are specified then only those programs are migrated. Programs may be specified by the hex pid of one of their processes or by theill' full invocation name, as stored by the team server. mon This program monitors resource utilization of the workstation and presents it graphically. The -d fla,g specifies a vertical display ("down") instead of horizontal. The default display shows percentage used of memory and processor, and the number of incoming Ethernet packets per second. The flags em, -p, and -e limit' the display to only those specified. The -f flag violates the user interface standards by putting the display in the upper right corner of the workstation instead of requiring th~ user to position it with the mouse. name Prints the login name of the user under whose account the command is running. newterm Change te:rminal agents. Takes one argument. the filename of a new terminal agent to take the place of the existing one. All executives running underthe old terminal agent are destroyed; the new one will presumably provide means of creating a new one. For example. :newterm sts replaces the VGTS with the Simple Terminal Server~ which does no ' graphics 'but simply presents the workstation as an ascii terminal. If no argument is given, it defaults to "vgts". Wambrr: If the named program is not in fact a terminal agent. you will probably lose control of your workstation. 18 June 1986 4-6 pagemode password pc68 pwd pwx Q query Command Summary Enable or disable paged output mode in the current executive. Takes one argument, which may have one of two values: "on" or "otr'. When paged output mode is on. the tcnninal agent stops writing to a AVT when the AVT fills up with output The terminal agent then displays the message ''Type (space) for next page" and waits for the user to issue a command which unblocks the AVT. The user interface for paged output mode is described in section 2.6. Use this program to change your V password, home directory, or personal name. The V superuser can also use it to create new accounts or modify other users' accounts. Uses the f1el ds package (section 21). To modify the displayed Name, fname, or Home, click on the old value with the mouse, use the normal line-editor commands to change the value, then hit return. To make the change take effect, click on Alodify and supply your old and new passwords. Other functions: click on find to flDd another user's authentication database entry. Click add to add a new user account (a unique user number is selected for you). Click delete to delete the displayed account Qick exit to leave the program. Compiles Pascal source programs for running on the m68000 processors. See the Unix man page. The flags are similar to those ofcc68. Prints the absolute name of the current working directory. Built in to the exec. Prints the (absolute) name of your current execution context-see section 3.6.9. This command is built into the exec. This is an experimental interactive functional programming language (m68k only). See Per Bothner (bothner@su-pescadero) for information and a user guide. Prints out the result of perfonning various 'query' operations. In particular, query kernel prints the result of the QueryKernel () library routine (see page 27-3), query conf1 g prints the contents of the workstation's configuration file (see Chapter 19), and query ethernet prints the result of querying the "ethemet" device (see section 36.1). query ? lists the possible options. " queryexec Find out the status of the specified executive. Useful mainly for system testing. ranlib68 Identical to the UNIX ran 11 b command, but handles archives of either m68k or vax binaries. This command is installed on UNIX under the name ranl1b88, and on V under both the names ranl1b and ranl1b88. Part of the Revision Control System. Described by a UNIX manual page. Part of the Revision Control System. Described by a UNIX manual page. Part of the Revision Control System. Described by a UNIX manual page. Currently, this program must remotely execute the rd"1ff3 and merge programs of RCS on a UNIX host, since the latter have not been ported to V. res rcsdiff rcsmerge rename rlog rm 18 June 1986 Renames the object specified by the first argument to the name given as the second argument Will not move objects from one server to another: there are also restrictions on moving objects within one server (for example, from one file system to another under the Unix server). Part of the Revision Control System. Described by a UNIX manual page. Takes one or more filenames as arguments, and removes each file. The -f flag suppresses error messages if some of the files do not exist Note that in particular, rm may be used, as an alternative to the destroy command, to destroy one or more teams (by name). For example. rm [team/toto/[b1n]1nternetserver V-System 6.0 Rererence Manual 4-7 Workst:1tion Commands will 'remove' (i.e. destroy) the program "{bin]intemetserver' that was executing on host "toto". Unlike the des,troy command, the fhll program name must be given. sed Stream editor. Described by a UNIX manual page. serial This program provides a full-duplex conversation between its standard input and output, and a device connected to one of the serial ports of the workstation. The argument is a device name, specifying the line to be opened. It defaults to [device]seriaIO if omitted. Names of the form [device]serialn (with n a single digit) can be abbreviated by giving only the digit If the serial line, is connected to a modem or a terminal port on another computer. this program allows the workstation to act as a terminal. The flag -b b i trate can be used to specify the bit rate (baud rate) of the connection; it defaults to 9600 bps. show Displays a • dv1 file or a • press file. It creates a menu in the invoking window; commands are normally selected with the mouse. A new window is created for displaying a page from the • dv1 or • press file. You can invoke the program with show filename, or you can set the filename in the menu. More details are given by the "helptt command (type h o:r select [He 1p] with the mouse). TeX generated dv 1 files are handled pretty well, except for possibly missing fonts (and perhaps speed). The press support is pretty minimal. sleep Delays for a time, then exits. The delay time (in seconds) must be specified as an argument. sort This command has the same syntax and semantics as under Unix 4.2BSD. startexec Create an exec in a new AVT. The new exec will have the same context as the exec from which startexec was invoked, not the [home] context For most purposes the view manager's Create Executive commands are to be preferred over this one, as the view manager will not work on an executive created by startexec. startexec prints out the exec id and process id of the new exec. storagestats Obtains accesS statistics collected by the V storage server and disk driver. The -c flag causes the statistics to be cleared to zero. stuffboot A program that stuffs the file named in argument 2 into the boot block of the disk named as argument 1. The file to be stuffed normally will be Vload and is needed during autoboot when the boot program is read out of the boot block on the root disk device. Ifa third argument is present, it is taken as the name of a file to copy into block #0 of the root device (tbe disk label). tail This comrnand has the same syntax and semantics as under Unix 4.2BSD. talk Allows interworkstation communication among V hosts similar to talk under Unix. Invoked as ta'i k [person] Person is optional. If person is 'specified, it can either be in the form us 8 r 1d to specify a user on doe first host we find that user to be logged in, user1d8host to specify a particular user on a particular host, or 'host to get anyone on that host Once inside ta 1k, you can enter commands by first typing [ESq, and then another letter. The available commands are: invite a new user. You are prompted for, who you want to invite, and you can respond in any of the ways mentioned for person above. log in AVT. This allows you to,see in a temporal fashion who says whaL You are prompted for a new' AVT to write the log in. Giving this command again terminates logging. 18 June 1986 Command SUmJDarr 4·S q quit Only you quit; any other persons engaged in the conversation can continue to do so, even, if you were the one who initiated the conversation. r read from file. It reads the tile into the conversation such that it looks as though you typed it all. However, there is currently no pagenation. If what was read is very long it will quickly get overwritten. w write to tile. This is the same as "log in AIT' above, except logging is done to a file you specify. Giving this command again terminates writing. WIII'JIi",: tal k runs only under the VOTS. There is currently a compiled in maximum of six talkers in one conversation. tal k AVTs are fixed at 24 by SO. Due to om'ent VOTS restrictions. tal k is forced to initiate a conversation by writing to the VOTS AVT (the small one originally in the lower ri&ht hand comer) and then opening a new AYr. which gives the victim a PAD cursor. To accept the invitation the AYr is placed normally: to reject the invitation click all three mouse buttons. This is bad if the VOTS AVT is obscured- the victim win let a beep and a Avr prompt and not know why. tel net IPrfCP-based tel net implementation. It can run under the S1'S, or in a VGTS AVf. A destination host name or address may be given as a command argument; if none is given, telnel prompts for one. A host name is a string of non-white-space characters starting with a non-numeric character. A host address is a string of the form a.b.c.d, where a,b,c and d are decimal integers. Both names and addresses may be followed by a dot and a decimal port number (with no intervening spaces). If the -e flag is given when it is invoked, lelnet recognizes a set of commands prefixed by ctrl-t while connected to a remote host Ctrl-t? prints a list of all such commands. These functions are not available by default because they sometimes interfere with higher level protocols such as that used by the VGTS. After disconnecting from a remote hos~ lelnet prompts for another host To exit lelnet, enter ctrl-c or ctrl-z in response to the prompt If there is no internet server on your workstation when lelnet is loaded, it runs one in the background. The -I flag inhibits loading a local server instead looking for a public internet server running on another V host. The -d flag enables debug mode. In this mode, all transmitted and received telnet protocol commands are printed, and all received non-printable characters are printed in an escaped notation. Debug mode can be toggled on and off by typing ctrl-t d while connected to a remote host if the -e option is specified on the command line. 9 The -g flag enables logging mode, which implies the -d debug mode above. A file, "telnetloigfile" will be created in the current directory. This file will contain a complete transcript of bothe sides of the telnet session. Lines preceded by "(" originated from the host while those preceded by">" originated from the workstation. All non-printing characters are quoted and all tel net proteol commands are printed. Password input is automatically deleted. This mode is transparent to both sides of the connection. Logging mode can be toggled on and off by typing ctrl-t g while connected to a remote host if the -e option is specified on the command line. telne tse rver IPrfCP teinet listener. This program listens for incoming telnet connections on the local , intemetserver, spawning a remote terminal server (RTS) for each connection received. testexcept Simple interactive program for testing the exception server. timeipc Perfonns timing tests of the V interprocess communication primitives. See chapter 13. time kernel Program to measure the time for Send/Receive/Reply kernel p,rimitives. IS June 1986 V·Syslem 6.0 Rererence Manual Workstation Commands 4·9 tsart Topological sort. Identical to the UNIX program of the same name. type Type out one or more files on the tenninal. Types a page-full and then stops and waits for input. Pn~sing [SPACE] brings up another page, while [RETURN] brings up another line.. Hit q or tC to quit undefine Removes the definitions of one or more local context names (aliases). Built in to the exec. ved A text editor, somewhat similar to Emacs, that runs under the VGTS. Described in Chapter 14. vemacs A version of the Emacs text editor that can, among other things. make use of the window features of the VGTS. When vemacs is invoked without any arguments, it will display a help file d.~scribing how vemacs differs from standard Emacs. w Lists logged-in V users throughout the network. we Counts characters, words, and lines in a text file. documentation. wh Usts hosts on the network together with information such as logical host name, free memory, average processor usage, number of free process descriptors, host type, etc., sorted by host name. whi Lists curre:ntly executing teams for each host. If one or more 'host' arguments are givetly then only the teams on the specified host(s) are listed. Such arguments can take the following form: a hostname, a pid (Ox ••• ), or "0" (indicating the local host). See the UNIX manual for full 4.2. Commands on Non-V Hosts There are also several useful commands that can be invoked on non-V hosts (usually a Vax/Unix system). Use these commands once you have logged into a machine through a tel net connection. Most of these commands also have versions that run locally on the workstation under the VGTS, and the Unix versions can also be run remotely under the VGTS, using the exec's remote execution feature (section 3.4). dale A version of the Yale layout editor that runs under the VOTS. draw An interactive drawing program that runs under the VGTS. See Chapter 10. photo Reads and displays a .sun" format raster file. siledit A program which edits .SIL format files. SIL, a Simple Interactive Layout program, is a graphics editor for logic designs and illustrations. silpress A program which takes a .sil format me and produces a .press format file that can be printed on the Dover. . U 18 June 1986 5-1 -5- amaze: A Maze Game Amaze is a game for two to five players which runs under the STS on a workstation with a framebuffer. If you see the letters VGTS in a small window on your screen you are not running the STS. See section 2.2 for instructions on how to start up the STS. To run amaze, type the command amaze If no one else is playing•. it will type "New game starting" and then draw the maze. Otherwise it responds with "Joining game as player number x" and then draws the maze. Your player token. called a monster, will be sitting in the center of the screen just above a checkered flashing door. From this point, you control your monster through the keyboard. The commands are: i , j 1 k. a e e s f h v o 1 2 3 4 5 Move the monster up. Move the monster down. Move the monster lef~. Move the monster right. Hold the monster at its current position. Let the monster's moves be se 1elcted randomly. Fi re the monster's missile Fi re the monster's missile Fi re the monster's missile Fire the monster's missile (Note: the missile can be seconds.) up. down. left. righ·t. fired only once every six Hide the monster from other players -- no shooting allowed while hidden. Let the monster be seen again -- can shoot again, too. (Note: monsters stay hidden for ten seconds, but once they become visible, they remain visible for 16 seconds.) Set Set Set Set Se't Set monster monster monster monster monster monster velocity velocity velocity velocity velocity velocity to to to to to to o. 1. 2. 3 -- the starting velocity. 4. 5. q Quit the game. but continue to watch other players. Rejoin the game just above the door. r Rejoin the game at a random corner in the maze. Ctrl-C Terminate your involvement with the game. t R Redraw the maze and players. Notc that to leave thc game entirely you hold down the CfRL key and type 'c'. Using V 30 April 1986 amaze: A Maze Game To rejoin the game after being shot by another monster. usc either the t or the r command. The game currently docs not keep score of the number of hits you inflict or suffer. Problems and questions should be directed to Eric Berglund. 30 April 1986 V·Syslent 6.0 Rderrttcc Manual 6-1 -6- checkers checkers allows you to playa game of checkers against the computer. The default version of the program . executes entirely on the players workstation. On starting the program. the view manager will prompt you for the position of the checkerboard.. sovr representing the The player moves the 'red' (white) pieces; the progrclm's pieces are black. You are expected to make the first move. You can, however, force the program to move first by "passing". (Sec the paragraph describing the menu, to follow.) To make a move, move the mouse to the square containing the piece that you wish to move, and click either the left or the middle mouse button. If this piece can be legally moved. it will then be highlighted. Complete the move by moving the mouse to the destination square and once again clicking the left or the middle button. If the move that you have selected is legal, your piece will be moved, and the program will then make its move. Note that having selected a piece to move. you can abort this selection by clicking all illegal destination square (the source square itSi~lf, for example). If a capture of an opposing (ie. black) piece is possible, your next move must be a capture. A message indicating such "forced captures" will be displayed just below the board. In such a case, the program will not allow you to make a move that is not a capture. Multiple captures arc handled correctly - if you move a piece by making a capture, your mov.c will not be completed until all possible captures with this piece have been made. The standard rules of checkers apply. If a piece reaches the eighth rank of the board, it is promoted to a king; kings may move in any direction. A side wins either by capturing all of the opposing pieces, or if the opposing side can make no legal move. When it is your turn to move, you 'may also usc the right mouse button to select from a menu of options, which are described below: ' Redraw This caUS<:8 the VaTS to redraw the entire board. This command should rarely be necessary. Pass (skip turn) This command can be used if you want the program to make the first move. You can also use this to avoid any capturing obligations. . Change search depth By default, the program searches 4 half-moves ahead when choosing its next move. That is, . it considers its own move, your response to this move. its next move. and your response to that The "Change search depth" command ullows you to change the depth of lookahead to any value from 1 to 8. Don't select any of the higher depths unless you have a lot of putience, however. '111e program takes about 20s to respond to a typical opening move when the depth is 6, about 50s when the gepth is 7. and about) minutes when the depth is 8. (These times were taken on a 10 MHz SMI workstation - Cadlincs will be slightly slower.) Note that you may find out the current search depth by selecting "Change search depth", and then clicking outside the 'depth' menu. Edit board This command puts you into /;:dilmodc. which allows you to cheat by adding pieces to, or removing pieces from, the board. Edit mode is described below. Back up one moveThis allows you to retract (eg. to correct) your last movc. Resign Usin. V The quick and cowardly way to end the game. 1 May 1986 dlecken The program chooses it's move by performing a 'brute-force' search, using alpha-beta pruning. It evaluates the board positions at the 'leaves' of the search tree using a simple heuristic based on the number and position of pieces on each side. A 'value indicator' to the right of the board indicates the value of the current position; as seen by the program. (If the indicator is above the halfway mark, for example, then the program 'believeS' that you are winning.) There are also counters immediately above and below the value indicator, giving the number of pieces on eac~ side. 'lbe value indicator and the piece counters are updated whenever the program completes its move. '. :" You can malec 'changes to the board (between moves) in Edit mode. In this mode, a special menu is displayed to the right of the board. To add a piece to the board (or change an existing piece), click the square in the menu that contains that piece. You may place a copy of this piece on any (shaded) square of the board, by click ing that square. You may do this repeatedly; it is not necessary to select from the menu each time. Note that you use the 'empty square' to delete one or more pieces from the board. You may remove aU pieces from the board by clicking "Clear". When you have finished making changes to the board, click "Done" to leave Edit mode. It will still be your tum'to move next. - . ,-:.") A distributed version of the game may be started by specifying the r flag: checkers -r . The program. will then try to create up to NoOfSlaves slave processes on lightly loaded remote workstations, that help in the search of the alpha-beta search tree. As far as the player in concerned, the only two noticeable differences to the default sequential version of the game, arc the pos.'iible improved response times and that the computers moves may be nondeterministic. (Note: it is only worthwhile to play the distributed version of the game if the search depth is chosen greater than four.) Mail comments and/or gripes to stumrn@p~dero. I May 1986 V-System 6.0 Rderence Manual -7- bits: a bitmap and font editor: " b 1 t3 is a special-purpose editor for working with bitmaps and fonts. It makes intensive use of the VGTS. The virtual terminal Qf tll(~ executive under which b 1ts is started up, is used to display various status informatio~ as well as being the menu of commands to execute. When started. b 1ts will ask for you to create a new view (of a new virtual terminal) in which the actual editing is performed. If you request to view sample text, you will be asked to create a third virtual terminal (see below). These las~ two vinual terminals are SGVT's and can be zoomed. . . . . . . ; . . "'1 (Note: If you are using a Sun-120 framebuffer (including a model SO), you should read the Bugs section!) 7.1. Command Input In this chapter, when you are asked to do the command [xxx], it means that you should select and cUc( the mouse at the field [xxx] of the status/command virtual terminal. You get the same feedback as witt\. pop-up menus, with the field in inverse video. Some of these fields, when activated. expect you to type in .. some number or string. In those cases, you have the full power of the line editor, until you type a 10174 4880 • .1. Slack lrace dl I 9.3. Commands The debugger begins by displaying the line .of code at which execution has paused, and then gives a period ('.') as a prompt. The user can then enter commands using the keyboard. Most commands are terminated with a carriage return: exceptions will be noted in the command descriptions. The only characters that may be used to erase previously typed input are backspace (\b) and delete (DEL). The entire line may be erased by typing CfRL-u. When omitting optional arguments in commands which take more than one argument, be sure to include the correct number of commas for the command. In this way the debugger can detennine which argument is to be assumed. 9.3.1. Definitions Within the command descriptions below, an expression is some combination of numeric constants. register symbols. globally visible symbols from the program being debugged. and the operators +, -. and It representing 2's complement addition. subtraction, Hnd bitwise inclusive or, respectively. manks arc not significant except in strings. All operations are carried out using 32-bit arithmetic and ev~lluated strictly left to righL . . Register symbols are symbols which represent the various processor registers. The following symbols are recognized on the 68000: %dO - %d7 Data registers 0 - 7. %aO - %a7 %rp Address registers 0 -7. %sp %pc Slack pointer (synonym for %a7). Frame pointer (synonym for %a6). Program counter. %sr Status register. The following symbols are rccognizedon the MicroVAX: %rO - %rll General registers 0 -11. %up General register 12 (argument pointer). %rp 11\131 1986 General register 13 (fmme pointer). Y·Syslcm 6.0 Rcfcrcnrc Manual ColllllWlds %sp General register 14 (stack pointer).... %pc %psl' General r1egistcr 15 (program counter). Program status 10ngworcL .,.. - '.' Program status word. . In all commands except the replace-register (rr) command a register symbol represents the contents of the specified register. In the replace-register command it represents the address of the register specified. %psw , Globally visible program symbols are names of program routines or global program variables. Note that the VAX C compiler p'repends an underscore to the names of all global symbols. The debugger attempts to guess the correct symbol if no underscore is typed by the user, but it docs get confused sometimes. " :; q. ~ The single character '.' (dot) is treated as a symbol representing the last memory location examined. Its value upon entrance to the command level of the debugger is set to the current value of the program counter~. 9.3.2. Execution Control Commands: expression, number, b . ", Set breakpoint number (in the range 2-15 decimal) at expression. expression must be a legal instructioltl address. If number is omitted the first unused breakpoint number is used. If expression is 0 the named breakpoint is cleared. or if number is omitted then all breakpoints are cleared. If expression is omitted all breakpoints are printed. Note: if expression is , omitted then number must also be omitted or must be preceded by a comma in order distinguish it from being interpreted as the expression argument. VAX note (not applicable to the 68000): The VAX C compiler uses the calls instruction for all function cans: ' This instruction expects to find a 2-byte register mask at the address specified and ~tually transfers <:ontrol to that address plus 2. Therefore you have to add 2, to the address when setting breakpoints at functions in a C program on a VAX. This mayor may not apply to subroutin1c calls in assembly language or in code generated by other compilers, depending on which instruction is used. ,: 0 expression, g Go. Start. or resume execution at expression. If expression is omitted. then start execution at the current pc value. expression. gh Go past breakpoint. Like go with no argument. except that if we are presently stopped at a breakpoilllt. then expressioll counts the number of times to pass this breakpoint before breaking. If expression is omitted. then 1 is assumed. x Execute the next expressioll instructions. starting from the current pc and printing out all executed instnlctions. If expressioll is omitted. then 1 is assumed. Note: traps are executed as single instructions; i.e. the instructions executed in a trap routine arc not displayed or counted. ' expression. y Same as " except that subroutine calls are executed as single instnlctions; i.e. do not descend into the called subroutine. Note that breakpoints within the subroutines are ignured. xx xx is a synonym for y expressio~ A synonym for x. except that each instnlction executed is displayed on the same line as the command, providing a more compact display. No carriage return is needed to terminate this command; the semi-colon triggers execution. .. A synonym for y. except that each instruction executed is displayed on the same line as the command. providing' a more compact display. No carriage return is needed to tenninate this command; the colon triggers execution. Using V J 1\1:111986 debug: The V Debugger The typeout mode referred to in the command descriptions is described under the t command. sp Toggle the flag that determines whether the whole team stops at an exception or just the process that incurred the exception. The debugger's default behavior is to stop the whole team when an exception occurs, not allowing any of its processes to proceed until one of the above Execution Commands restarts the team. (Of course, at that point ANY of the processes could resume execution - i.e., single-stepping one process could allow ~other to· execute indefinitely.) If this command is typed, an exception in anyone process will not halt any of the other processes on the team. Typing sp again makes the debugger go back to its original behavior. q Quit Exits the debugger and kills both the debugger and the program being debugged. 9.3.3. Display Commands The following commands arc executed immediately without waiting for a carriage-return (CR) to be typed, and their output overwrites the current line. (This provides a more compact display format) expression! expression\ Display the contents of expression. The typeout mode used is determined from the program symbol table and the current typeout mode. The value of dot is set to expression. The \ command is not very useful in instruction-typeout mode on the VAX (i.e. after giving the "'i"tt" command) because the VAX uses variable length instnlctions and almost every byte value is a valid op-code. thus making it impossible to tell where the previous instruction really starts. Similar problems occur less frequently on the 68000. 1 Display the contents of dot after having respectively incremented (I) or decremented (\) it lbe typeout mode used is determined from the program symbol table and the current typeout mode. \ @ expression@ .1~ . = expression = Display the contents of the ·memory locations pointed to by the value of dot or expression, respectively. 'Inc typeout mode used is determined from the program symbol table and the current typeout mode. 'Inc v,llue of dot is set to the address of the memory location just displayed. Note that %pc will yield the contents of the memory 1(>Ciltion pointed to by the pc register (Le. the current instruction) and that %pcCW will attempt to place an additional indirection on that memory .. location. %pc@ is almost always an invalid reference. Display the value of dot or expression. respectively. The following display commands are exccuted when a carriage-return is typed. d I)isplay U1C contents uf all the registers. expression.s Print out a s~1ck trace describing the chain of subroutine calls and their parametcrs, to a maximum of expressioll calls. (express;ull defaulL~ to infinity.) Warning: the debugger's stack trace examines the values of parameters as they currently exist on Ule stack. not as they were when the routine was called. Routines which change the values of their parameters wiIJ similarly afTcctlhe stack trace output expression, numlines, n Display the next lIum/illes memory locations. 's~1rting at expression. If expression is omitted. then display st:.1rt'i at dot If numlines is omitted. then 24 lines are displayed. express;oll, IlUmlilleS, p 1 Ma11986 . V~Syslem 6.0 Rert'rence Manual Conunaods Display tthe previous numlines memory locations, starting at expression. If expression is omitted, then display starts at dot If numlines is omitted, then 24 lines are displayed. type, t Temporarily set typeout mode to type where type is one of: type out bytes as ascii characters. 'e' 'h' type out bytes in current output radix. 'w' type out words (2-bytes) in current output radix. 'I' type out longs (4-bytes) in current output radix. 'st, strLength type out strings. Set the maximum length of strings to be strLength. The maximum string length determines how far the debugger is willing to look for the end of a string, which is assumed to be a '\0' byte. For programming languages such as Pascal which don't tenninate their strings with a '\0' byte this limit is important to prevent endless string searches. The string maximum length is sticky (i.e. it need be set to the desired value only once). The default value is 80. 'r type out as symbolic assembler instructions. Note that the type characters must be surrounded by single quotes. If no argument is supplied then the default typeout mode is used. This mode tries to set the typeout mode based on the type of symbol(s) being displayed and uses 'I' fonnat when the mode is not obvious. lbe new typeout mode stays in effect until execution is resumed with one of the . Executio:n Control Commands. type, tt Permanently set typeout mode to type. The typeout mode is set to the default typeout mode if (ype is omitted. base, ir Set the illlPut radix 'to base. If base is illegal (less than 2 or greater than 2S, decimal) or omitted, then hexadecimal is assumed. (Illis is the default radix.) base, or Set the output radix to base. If base is illegal (Jess than 2 or greater than 2S, decimal) or omitted, then hexadecimal is assumed. (This is the default radix.) offset, or Set the maximum off.~et from a symbol to offset. If offset is illegal (less than 1) or omitted, then hex,adecimal 1000 is as.c;umed. Ollis is the default offset) 'Ibis command is useful when examining areas of the team, such as the stack, which arc more accurately labeled by hex addn:8S<.."S than by symbol + offset notation. charcount, sl Set the maximum number of characters in a symbol which will be displayed to charcount. If charcount is illegal (less than lor greater than 128) or omitted, then 16 is assumed. 9.3.4. Tracing Commands expression, W Watch tlhe memory .location at expression. When program execution resumes, the debugger regains control afier every instnlction and checks whether the contents of the locatiun have changed. If so, a mcs.liage is printed and the user gets cuntrol. Otherwise, the program cuntinues. This causes the program to run several hundred times slower than normal. If expression is 0, watching is turned off. expression, wb Watch the memory location at expressioll, but only at breakpoints. A breakpoint will not stop the program if the watched location is unchanged. " Print infi>nnation about watched location. Using V 1 May 1986 debug: ne V Debugger 9.3.5. Replacement and Search Commands expression I, expression2, type, r Replace the contents of the memory location specified by expressiolll with expressio;'2~· expression2 is interpreted to have type type. Note: It is not currently possible to replace strings with this command. and instnlctions should be specified in 16-bit quantities and replaced with type T. If expression2 is omitted. then the value 0 is used. register. expression, rr Replace the contents of the specified register with expression. If expression is omitted, then . the value 0 is used. expression is interpreted to be a 32-bit quantity. expression, /owlimit, highlimil, type. f ._.... : Search for (find) pattem in the range lowlimit (inclusive) to highlimit (exclusive). expression is interpreted as an object of type type. Objects are assumed to be aligned on word (2-byte) boundaries except for I-byte types and strings. which are aligned on byte boundaries. A mask (set with the mask command) determines how much of the expression is significant in the search. unless expression is a string constant. The first three arguments to the search command are sticky; thus if any of them are omitted then their previously specified value is used. r is the only debllgger command which al10ws the specification of a string constant as expression. A string constant is delimited by the character .. on either side; to usc " in the string itself, precede it with a \. An example of a string is: "'This is a string with \" in it". The typeout limit of strings detennines how much of the string is Significant in the search, not the search mask. . expression. m Set the search mask to expression. If expression is omitted then 0 is used. -l,m fortes a complete match, f.m (that's hex t) checks only the low order 4 bi~ O,m will make the search pattern match anything. 9.3.6. Help Commands h Print a brief description of each of the debugger's commandS. # Print a set of internal debugger statistics. This was implemented fbr the convenience of the designers and may change frequently in content and fhnnat It replaces the obsolete qq which, due to the debugger's unsophisticated command parsing will ~ehave exactly as docs q. ·9.4. Bugs The debugger as it is currently implemented has some Ufeaturcs" one must be a~.qf.: Currently, the version of the debugger that nms on the Vax can only debug Vax programs. and the version that runs on the 68000 can only debug 68000 programs. 'Illis limitation C41USCS little: difficultly since the debugger is ordinarily run on the same host as the program to be debugged. .__ I • 'Ille debugger as!mmcs thHt any trace trcsp exceptiuns I"lve been C4lllscd by its own single-stepping mechanism. Though it will recognize the first one, and print an error mC8.'Wlge, subsequent tmp exceptions can cause intolerable behavior. ' . •• ! I I: •• ~. The stackdump routines depend upon knowing the string names of the kernel routines to produce correct. stack traces which include those routines. Right now, this list is being kept up to date by hand. Putting breakpoints in code which is shared by two or more processes can be hazardous to your mental· health. . ·i: :1 I M1I11986 V-Sys.em 6.11 Rererence Manual 16-1 -10draw: A Drawing Editor The draw program is a document illustrator that can be used to add figures to documents created with programs such as Scribe. This program is loosely based on the Xerox Alto Draw and SIL programs, and the Apple Mac Draw program. Many of the same primitive objects are common to all four programs, but there are many features unique to V Draw. 10. 1. Conceptual Model Draw is an "object" oriented graphics editor as opposed to a "bitmap" oriented editor. This means that Draw allows you to freely manipulate the figures that you create after they have been placed on the screen at the expense of being able to do fine freehand sketching and other functions such as seed filling. The graphics model offered by Draw is very close to that provided by the underlying Virtual Graphics Tenninal System (VGTS). All graphic objects manipulated by Draw are variations on three general types: splines, text, and groups. Splines are b·splines of order 2. 3, or 5. Order 2 splines have straight edges and are thus referred to as polygons. Order 3 splines usc quadratic interpolation. and are thus referred to as cuncs. Circles usc order 5 splines which use quartic interpolation. Other shapes such as·ovals. rectangle~ and arro\Vhead~ arc special cases of the more general order 2 and 3 splines. Note that the tenn, spline, will be used to collectively denote all of these objects. . Splines can either be open or closed. Open splines have two ends. Closed splines do not have any endpoints. Any spline can have a border drawn with one of 15 pens or nibs. A closed spline may also be filled with any of 27 patterns. All splines must have either a border. a fill pattern. or both. Fill patterns can either be opaque or tr.msparent. Any parts of objects lying behind an opaque object will not be visible. On the other hand. if the object is transparent. then it will act as a screen where the objects underneath will show through in the are,lS where the upper object is not black. Text objects allow you to place any type of written message on the page. Text can be in one of various fonts . It can ;:tlso be either left center, or right justified. . Groups do not have any graphic shape of their own. but are used to keep various objects together. Any operation performed on a group is performed on all of its tnembers. Groups can be nested; that is. one group may be a member of another group. This nested relationship is strictly hierarchical. No recursive nesting is allowed. . 10.2. Screen Layouit When tile program is first invoked. it will create two new windows on the screen. The large empty one is the main drawing area (known as "drawing area" to the VaTS). and the smaller one is the commands window (known as "Draw menu" to the VGTS). The drawing area is zoomable. and the grid spacing available at nonnal magnitication is the same as that used by the program when the right m.ouse button is pressed. Since the program has no way of knowing what magnification you arc using. it aligns to the unzoomed grid values. The VGTS will place grid poinl'i at a const1nt separation •.regardless of magnitication. You may create additional views. move existing views. etc .. to your satisfaction. '1l1e derault drawing area is in the proportion of 8.S by 11, and centered. 1\ fmme is put an,und the actual size of a drawing page to provide some reference Uslne V 17 June 1986 draw: A DrawiDl Editor 10-2 points if you zoom the view or change its centering. The frame is normally not visible, as it lies entirely outside the de£:mlt view. It will not appear in any output While this rectangle defines the absolute bounds of the page, the default view defines the ~rea which is "safe" to draw on since printers canno~ in general, print in the extreme margins. The menu window is shown in figure 10-1. .·igure 10-1: The Draw menu The ~fenu window is divided into several sections. Near the top. there is a set of square icons known as nouns. These define the various primitive objccts which can be created with Draw. Along the left hand side are the elongated verb icons. These define the types of transformations which can be performed on already existing objccts. Below the nouns are the nib and p~'Uern sections, collectively known as the attribute section. These can be used to modify the appearance of all spline objectc;. Below these are various Draw comnmnds which are lIsed to perfonn various functions. Ilclow the commands is a rec~1ngle which displays the currently selected ront. '1l1is window displays the name of the font in its own typeface and is also used to set and displllY text justification. The Fontl and Fona "commands" as well as the font rectangle also fall under the 17 June 1986 V·System 6.0 Rererence Manual Screen Layout 16-3 heading of" Attributes" as t1hcsc are used to set text attributes like the nib and pattern sections are used to set attributes of spline objects. At the very bottom of the menu is another rectangle where various Draw messages and prompts are displayed. . I The original window which you used to run the Draw program will serve as an area where text will be input It is also used for printing unexpected error messages such as memory full errors. 10.3,. General style of interaction Almost all Draw interaction (except for text and filename input) is done with the mouse. To create an object. click on one of the noun icons in the menu and then click one or more times in the drawing area to set control points for that object. There are three types of objects: indefinite point objects, definite point objects, and text objects. Indefinite point objects, such as curves and polygons will accept input for an arbitrary number of points. To terminate one of these objects, click the Done command in the menu. Definite point objects. such as circles, rec1tangles, and arrowheads require a fixed number of control points. Each point displays a prompt in the mes.c;age box which indicates what this point will be used for. For example, a circle first asks for a center point, and then for a point along the edge. Text objects ask for a single control point to positiolll the text. and then prompt for the text string from the keyboard. Draw maintains a current object. l1tis objcct is indicated by framing it with a rectangle. A newly created object becomes the current one. To change the current object. simply click on another one with any single mouse button. Draw will find the object that is closest to. the point that you click on and select that object No object need always be current To un-select al1 objects, click in a blank section of the drawing area window. More than one object may be selected at a time by using the ToggleSclect or Range commands. 'Ibis is provided primarily in order Ito create groups. To manipulate an object. first select it. thus making it the current object, and then click on one of the verb or attribute icons. Depending on the operation involved, Draw will request zero or more data points required to perform the given operation. These wi11 be prompted for in the message rectangle. At any time, you can halt an operation with the 'Abort' command. [fmore than one object is selected, then the verb applies to all of the selected objects. 10.40 Control Pointu and Sticky Points When you create a spline object (remember, d1is also includes polygons), you will be asked to specify its Control Points. '111cse points are the places which you wish the curve to pass near. '111e more control points you put in one place, the nearer the curve will come to that place. Also, placing multiple control points at a single point will make the curve much sharper at that point Except for the end points of open curves. and multiple control points, the curve will not, in general. pass through any of the control points. Sticky points (similar to IKnotc;) are points which actually lie un the curve. They are calculated by the program to help you with the alignment of objects. There wi11 be d1e $elme number of control points and sticky points on curvcs. Polygons are a special case, in that since the control pointe; of a polygon actual1y lie on it. the program considers them to be sticky points too, This means thalthe slicky points on polygons lie at the corners and in the middle uf each edge. Circk'S also have a sticky point at their center. Sticky points ror text objccts arc on th.c lett. right. and center or the baseline (the line which most letters lie on top ot: but which letters such as small'p' descend below.) as well as the line just above the text. Groups don't have sticky points tor themselves but include nny sticky pointe; of objccts within the group. This, in essence. means. that when looking for sticky points, all objecte; are considered regardless of whether or not they are part of a group, no matter how deeply tlle groups are nested. Using V 17.June 1986 draw: A Drawing Editor 10·4 10.5. Mouse Buttons When the mouse is clicked inside the menu. it is unimportant which buttons you usc. (The debug command is a hack and is the only exception.) 'Within a popup menu (a list of choice which 'pops up' after you do something), you can abort by either clicking outside the menu or by pressing all three mouse buttons down and releac;ing them. In general. you don't have to release (or press) the buttons all at once, but the mouse position is based upon where the cursor is when you release the last button. Clicking the mouse inside the drawing area can cause one of several different commands (and mouse locations) to be used by the program. lbe use of mouse buttons within the drawing area is as follows: Buttons x - X - x XX X- X - XX XXX Effect ' Specifies a data point right where you are pOinting. Requests the program to find a sticky point. Requests the program to use the nearest grid point. The 'Again' command. (see below) The 'ToggleSelect' command. (see groups below) Equivalent to the 'Undo' command. Equivalent to the 'Abort' command. Sticky,points were explained above. When you request that the program select a sticky point, it will choose the nearest such point which is within a given radius (about 1 inch). Grid points arc spaced every 16 pixels (at no"nnal magnification). If you wish to sec these grid poin~ use the Toggle Grid command within the VGTS. For printed output, pixels arc assumed to be distributed at 72 per inch. The Again command allows the previous operation to be repeated. It is equivalent to issuing the Done command (if necessary) and then clicking in the icon for the previous operation. lbe mouse position where you issue the Again command is ignored as long as it is anywhere within the drawing area The easiest way to make fine adjustments to the position of an object is to first click on the Moye verb icon, and then click on a source and destination data point If you are not satisfied with the move, click Agairn and repeat the operation without having to go, all the way over to the menu. lbis command is also quite useful when drawing a series of objects of similar type. You can specify that you wish to draw a closed curve, place the control points for the curve. and then confirm with Again. 'Inc program will complete the curve you have outlined. and wait for you to specify another closed curve. just as if you had confirmed with Donc, and then selected Closed CU"C again. The Abort command is used to cancel the current operation without creating or manipulating any objects. Abort will never throw you completely out of Draw. Use Quit for that' Some commands. such as Raise and Lower. are executed immediately and thus cannot be aborted. Use U~do to back out of these. The Undo and TogglcSclcct functions are described more fully in the sections on Undo and Groups below. 10.6. Verbs There are cleven verbs in Draw. rl ney arc indicated by the set of elongated icons along the left-hand side of the menu. Each is useful for manipulating one or more objects. All verbs require mat an object be selected befhre they arc executed. Here they arc described as they appear from top to bottom. Move This verb will pennit you to specify a pair of points which define a displacement vector. This vector tells the program how far and in which direction to move the object. By using this command, you can move existing object about on the screen. Copy 111is verb is similar to Move. except that it leaves behind an image of the object. Er.lSC This command allows you to delete (crase) the selected object This requires no extra data 17 JUlie 1986 V'System 6.0 Rererence Manual 10-5 Verbs points. If you make a mistake, you can always issue the Undo command. Alter This verb is useful for changing the characteristics of an existing object It will permit you to move the control points on splines, change aspects of text objects, etc. (Not yet implemented) Rotate This verb will permit you to specify a fixed point about which the rotation is to take place. and two points which will define tlle angle of rotation. Text is rotated about its positioning point Only the position of the text is changed; the orientation of individual letters is always horizontal from left to right Scale This verb will permit you to specify a fixed point for the scaling. and two points which define the scaling factor. This command is useful for expanding and contracting objects. X and Y dinlensions are scaled equally. Scaling text will "not change its size or font It will change the location of the string based upon its positioning point Stretch This verb is similar to the Scale command except that X and Y scaling is independent Thus an object may be made taller or shorter but not wider and vice versa. Group lbis verb binds a collection of objects into a group. If a single group is selected. it will un-bind that group back into a collection, Collections are created with the ToggleSclect mouse sequence to allow more than one object to be selected at one time. rill is, in a sense, creates a t.emporary group. The Group verb makes this permanent, or makes a permanent group temporary. Ra.ise This verb will place the selected object on top of all of the other objects. Note that you can still point to objects you can't see; the program will find sticky points on completely obscured objects with no difficulty. " Lower This verb will place the seiected objcct behind all of the other objecl~. This is useful when you use opaque ink to fill something, and it winds up obscuring an object you want to sec. Opaque This verb will toggle between upaque and transparent filled objects. Opaque objects completely obscure anything they overlap. Transpurent objects act like a screen in that they allow Wh do { msg->timingCode - typeOfrest; Send( msg. receiverPid ): 1f( msg->ti~ingCode I- OK ) } wh11e( msgCounter-- ); TIle Receiver process executes different code depending on the type of message transaction being tested. For Send-Rece1ve-Reply tests. the Receiver ex\..,<: utcs: msgCounter - msgsPerTr1al: do { senderP1d • Recl1ve( msg ): ir( msg->t1mingCode I- typeOrTest ) msg->tim1ngCode - OK; Reply( msg. senderPid ): } whi1e( msgCounter-- ); Usilll V 1 M:l11986 timeipc: A V Performance Measurement Tool For Se nd- Rece 1ve - Rep 1yW 1t hSe gme nt tests, the Receiver executes: . msgCounter - msgsPerTrtal; do .. . (. senderP1d - Rece1ve( msg ); 1f( msg->tim1ngCode I- typeOfTest ) msg->timingCode - OK; ReplyWithSegment( msg, senderPid, localSegPtr, msg->segPtr. msg->segS1ze ); NOTE: lost reply segments are not detected I } '* *' wh1le( msgCounter-- ); For Send-Rece1veW1 thSegment-Rep 1y tests, the Receiver executes: msgCounter - msgsPerTr1al; do ( senderP1d - Rece1veWithSegment( msg. localSegPtr. "ocalSegS1ze ); 1f( msg->t1~ingCode ,- typeOfTest II msg->segSize ,- localSegSize ) msg->t1mingCode - OK; Reply( mig. lenderPid ); } while( msgCounter-- ): For Send-Rece1ve-MoveTo-Rep 1y tests, the Receiver executes: msgCounter - msg_PerTr1al; do ( senderP1d - Receive( msg ); if( msg->timingCode ,- typeOfTest ) MoveTo( senderPid. msg->segPtr. localSegPtr. msg->legSizl ); msg->ti~ingCode - OK; Reply( ~sg. senderPid ); } while( msgCounter-- ); For Send-Receive-MoveFrom-Rep1y test. the Receiver executes: msgCounter - msgsPerTr1al; do ( senderPid - Receive( msg ): if( msg->timingCode I- typeOfTest ) MoveFro_( senderPid. localSegPtr, msg->segPtr, msg~>segS1ze ); msg->tim1ngCode • OK; Reply( msg. senderPid ); } wh11e( msgCounter-- ); V'System 6.0 ncrerl'ncc Manuol Types ofTesls 13-3 13.2. Process Configu rations Each type of test can be perfonned in any of the following three process configurations: (1) IPC between two processes on the same team. timei~c I I I team ---->Root----(4) •••• > indicates Sending of test messages ----> indicates Sending of control messages (n) indicates process priority I I v Sender······>Receiver (1) (0/1/2) (2) !PC between two processes on different teams on the same host. timeipc team I I I t1me1pcserver team ---->Root-------------------------------- I I (4) v Sender·················~···············>Rece1ver (1) (0/1/2) (3) IPC between two processes on different teams on different hosts. t1meipc team ·· time1pcserver team , ---->Root-----------~-------------------- I I I (4) :' I I v Sender·································>Rece1ver (0/1/2) (1) Looper (254 ). ·.' 'Looper (254) Both limeipc and limeipcserver execute at REAL-"nMEI team priority. giving their processes precedence over an other processes excc:pt the Kernel Process (or other teams executing at REAL_TIME1). For tests within a singlc host. the Sender and Receiver consume all processor cycles outside of the kernel. for the duration of a trial. For teste; between hoste;. each testing team nllls an additional I.ooper proces.~ which loops forever. consuming and mensuring all cycles not used by the Sender or Receivcr. Thus. during a trial. the testing worksUltion(s) will appc;'lr to frecze -- thc cursur will nol track mouse movement and keyboard input wilt be queued in the kernel. It is also possible that concurrently-running. time-dependent applications may suffer (c.g. TCP connections 'via the internet server may time out during a trial). Using V I May 1986 timeipc:: A V Perfol'llWlc:e Measurement Tool 13.3. Input to timeipc Before each test, you must answer a series of prompts to specify the type of test and the process configuration for the test. For each prompt. you may enter a null reply to request the default value specified in brackets, or enter tz to terminate the program. tc is ignored d':1ring prompting. .. "" receiver host name, 'local', 'sameteam', or 'quit'? [sameteam] Reply with the name of a workstation on which to execute the Receiver team. or enter one of the thr~. keywords. (The Sender team always executes on the workstation where the limeipc program was executed.l. local requests that the test be performed between two teams on the local workstation. sameteam requests that only one team be used.. qu it terminates the timeipc program. Any of the keywords may be abbreviated to a single letter. '.!. receiver at higher, same, or lower priority than sender? [lower] - "I ......... This prompt occurs if the test is to be performed within a single host. Reply h1ghe r or h to run the Receiver at process priority 0, same or s for priority 1, or lower or 1 for priority 2. . segment s1z1 in bytes, K bytes. or M· bytes? [0] I Specify the si7.e of segment to be moved in the tcst message transaction. Don't leave any space between the' number and the optional Kor Msuffix. A size of zero requests a simple Send-Receive-Reply test. . read or write? [read] ' •. f. •i r .( This prompt occurs if a non-zero segment size was requested. read or r requests a Send-Receive-ReplyW1thSegment tcst (if segment size <= MAX_APPENDED_SEGMENU or a Send-Receive-MoveTo-Repl'Y test (if segment size> MAX_APPENDED_SEGMENlj. write or ,i requests a Send-Rece1veW1thSegment-Reply tcst (if segment size <= MAX_APPENDED_SEGMENT) or a Send-Receive-MoveFroll-Reply test (if segment size.~~· MAX_APPENDED_SEGMENT). number ot messages per trial? [10000] \ ~i . Enter the number of times the message tranS&1ction is to be repeated within a single trial. Note that MoveTo/MoveFroll operations arc not counted as separate transactions. number ot trials? [10] . .. (~ Enter the number of trials to be performed. Enter lero to start the prompting all over again. 1 May 1986 V·System 6.0 Hcr~rcnce Manual Input to Ilmtipc 13-5 13.4. Output from timeipc The results of the tests Clre written to stdout. All prompts and error messages arc Here is an example oftcst output: writt~n ~ stderr. Send-Reeeive-MoveTo-Reply test with 4098 byte segments between sender host tnanaimo' and receiver host 'lubbock' 600 messages per trial, 6 trials Wed Nov 8 18:60:16 1985 trial number sender receiver overhead overhead usee/msg . usee/msg sender idle CPU usee/msg receiver idle CPU usee/mIg seg rate bits/sec 5 5 5 5 16022 15818 15889 18387 14925 14859 15253 15784 18255 14888 1257408 1230030 1214529 1107027 1258372 5 5 15988 15783 1213473 elapsed seconds elapsed usee/msg 1 2 3 4 5 13.030 13.320 13.490 14.800 13.020 28080 28840 28980 29800 28040 5 5 5 5 avg. 13.532 27084 5 5 Not aRl columns are printed for all tests, and the "avg." row is only printed when there is more than one trial per test The meanings of the various statistics are described here: elapsed secondl is the total elapsed time taken for the specified number of message transactions. It is determined by calling the kernel's GetTime funlction before and after the sequence of messages, and thus is only as accurate as GetT'tme. Although it is printed to three decimal places. the current version of the kernel only keeps time to ,hundredths of a second. so the low-order digit should always be zero. elapsed usee/mig is the elapsed seconds divided by the number of message transactions, printed in microseconds. sender overhead usee/msg receiver overhead usec/msg are the number of microseconds of "overhead" instructions expended for each mcs.~ge tran~1Ction. in the Sender pruccs." and the Receiver process. They are computed by calling GetTime before and after 50,000 itcnatiuns of the tran~lcti()n loop with the IPC primitives removed. and dividing by 50.000. These overhead values shu'uld be subtracted! from the elapsed usee/lllsg to obtain the bare m~lge transaction time. sender idle CPU ~sec/msg receiver idle CPU usec/msg are only printed thr tests between two hosts, and indicate for each host how many microseconds of the el apsed usee/msg are spent waiting for the other host or the network. They are measured by having a luwer priurity process on eatch machine that loops continuously, incrementing a counter. At the start of a trial. the counter is set to zero. I\t the end of a trial. the counter value is saved. Then, the louper is allowed to run alone for I second to determine how many times per second it can increment the counter. Th'lt mte is divided into the Sllved count to "rrive at the printed v~lIue. seg rate bits/sec is only printed for tests with a non-zero segment'sile. 'It is the number of bits of segment da~1 moved during the trial divided by ~e elapsed time of the trial. Using V I M:ayl986 Umeipc: A V PerFormaace Measurement Tool 13-6 13.5. Warnings and Precautions • Despite having exclusive access to process-level cycles on the testing workstation(s), the progam can yield different results for repetitions of the same test due to varying kernel overhead and network load. For this reason, a test should consist of more than one trial, in order to observe the variance in the results. A number of steps can be taken to minimize these perturbations, depending on your need for accuracy: o Run the test at a time of low network load. even if you are only testing within one workstation the kernel expends cycles receiving and handling arriving network. packets. 'Ibe mon program is very helpful for discovering the current network load (but not while a test is running!). . Alternatively. isolate your workstation(s) from the network during the tests. For tests within one workstation, you can unplug the transceiver cable after you have started up the limeipc program. For tests between two workstations. you can connect them both to a DELNI which can be isolated from the network at the flick of a switch. (This is also a polite thing to do to avoid loading the network with your test messages.) Note that you will not be able to redirect your test output to a file if you have disconnected from the network. o Don't touch your keyboard or your mouse while a test is running - they cause interrupts that the kernel must handle. o Kill off any extraneous process that are running on your workstation(s), such as mont leinet, internetsener, etc. I haven't figured out why their presence effccts the results of the tests, but it . does. o Be sure that you are logged-in in order to prevent others from remotely executing programs on your workstation(s). o Make sure no other REAL_TIMEl teams are running on your workstation(s), such as other instances of limeipc or limeipcserver. o It is possible to run timeipc on top of a bare kernel, i.e. without any other teams prescnt. Only tests within a single team can be performed because the services of the team server are not available to set up a separate receiver team. An example boot command to load timeipc onto a Sun2 workstation with 3eom Ethernet interface is: b V lusr/V/b1n/t1me1pc.m68k Vkernel/sun2+8c When running in this mode. answers to prompts must be entered using LINE"""EED rather than RETURN. You may safely ignore warnings about inability to set the team priority. (Currently, a simple Send-Rece1ve-Reply transaction on a Sun2 workstation is 6 microseconds faster when performed on top of a bare kernel, compared to running on top of a freshly-booted standard first team and VaTS. Surprisingly, using the STS instead of the VaTS makes the simple message exchange slo·wer by 2 microscconds.) • Rc aware that your workstation will appear to frcc1.e up during a trial. You may enter tc to abort the test and return to the first prompt but the interrupt will not take effect until the end of the current trial. If you don't know how long a pnrticular triul will luke. try it first with a sm.lll number of mcs. EndOfF11e Esc-g GotoRequestedLine tx-t RequestTagSearch ts RequestStringSearch Esc-s RepeatStringSearch pf3 RepeatStr1ngSearch sm1-pf3 RepeatStr1ngSearch tr RequestReverseStr1ngSearch Esc-r RepeatReverseStr1ngSearch pf4 RepeatReverseStr1ngSearch sm1-pf4 RepeatReverseStringSearch Esc-q QueryReplace th DeletePreviousCharacter del DeletePrev10usCharacter td DeleteNextCharacter Esc-d DeleteNextWord Esc-h DeletePrev1ousWo~d tt TransposeCharacters to New11neAndBackup tk KillToEndOfL1ne ty YankK111BufferAfterCursor Esc-y YankKillBufferBeforeCursor tx-tv V1s1tF11e tx-ts SaveCurrentBuffer tx-tw WriteNamedF11e Esc-tm Wr1teModif1edF11es Esc-} MarkUnmod1f1ed tx-b ToggleBackup tx-v ToggleVer1fyWr1te tx-l ToggleAutoLineFeed tx-c ChangeContext tx-ti InsertF11e I M311986 V'System 6.0 Rcrcrence Manuol 14·11 Vcd Illitialization Esc-{ OpenBrace1 Esc-} CloseBracel Esc- IndentFour Esc-rarrow IndentFour Esc-Ansi-c IndentFour Esc-~h OutdentFour Esc-larrow OutdentFour Esc-Ansi-d OutdentFour t SetMark tx-tm SetMark set-up SetMark tx-tx ExchangeOotAndMark Esc-1 IndentRegion tx-tr Wr1teRegion tX-fk DeleteToKillBuffer tw DeleteToKillBuffer tx-g VisitF11eNewBuffer tx-G V1s1tF11eNewBuffer tx-d OeleteW1ndow tx-y YankToNewW1ndow tx-a Reg1onToNewW1ndow tx-m MergeWindows tx-l GoToBuffer tx-2 GoToButfer tx-3 GoToBuffer t)(-4 GoToBuffer tx-5 GoToBuffer tx-6 GoToBuffer tx-7 GoToBuffer tx-3 GoToBuffer tx-9 GoToBuffer tx-o OrderBuffers Several editor functions exist that are not bound to any key by the default definitions. 11lcsc are the following: OrderBu fferHackwards Order the buffers in the opposite order of that used by OrderBuffers. Depending on whether a user prefers to stack their windows from lower left to upper right. or from lower right to upper left. one or the other ofthcsc ordering functions should be used. - OpenR....clCC C-program editing command. Generates three new lines, with the first and third line containing matching { and} braces indented two spaces from the original cursor position. The middl<: line is blank and indented four spaces from the original cursor position. Closcllrace C-program editing commnnd. 'Ille same as CloseBrace 1. except that the second. blank line is not genclI'atcd. 'Ille cursor is left after the } character. llackwardHackingTabs Same as DeletePreviousCharacter except that tabs arc expanded first if they are' encountered. Thus. this command will convert a tab into 7 spaces instead of deleting the equivalent of8 spaces worth of white space. llsing V 1 MaJ 1986 yeel: A Text F..ditor 14-12 14.16.2. Specifying Options and Checkpoint Intervals Various options and the check pointing frequency (in number of editing actions) can be specified in the initialization file. lbese include: (checkpoint number) (defaul trows number) (autolinefeed on/off) (backup on/off) (verifywrite on/off) The checkpoint specification expects an integer number between 1 and 232_1. To tum off chcc1cpointing specify some large number. The default is 500, which corresponds roughly to ·typing 10 lines of text The defaullrows specification sets the default AVT size. The other specifications expect either an on or an ott, indicating that the option should either be turned on or turn~d off. The case of the keywords used is unimportant - everything gets converted to lower case before parsing anyway. However. the parser is unforgiving of extraneous blanks in the specification. No blanks are allowed between the parentheses and the keywords. (I know, this is easy to fix. It just hasn't been done yet) 14.17. Crash Recovery In an ideal world. this program would never crash. But in fact it sometimes does- but it is so dcsigned that it has to crash in two stages to lose your text Nonnally a crash only breaks the first stage. in which case YQU will generally drop into the debugger. At this point. the debugger command Su 1c ide. g will destroy the process that got the exception. This will u~ually activate ved's crash recovery facility, signalled by the message: Editor crashl Shall I try to save this buffer? If you have any changes. and you value them. and the crash did not come during a save. it is probably a good idea to answer "y", 1\ .BI\K file will be made if the backup option has not been turned ott. so the danger of total loss is small. If this succeeds you will be asked Try to continue? I('you answer "y", the inner editor will be recreated with the buffers just as they were. For some displayrelated errors, a tl. at this point will set everything right However. you arc on shaky ground, and the best thing to do first is save any mudified butTers in other windows. Remember that if the checkpointing feature was on when ved crashed, that there may be good copics of your files checkpointed in your directory. Take a look at them before y.ou panic, you may end up only losing a few lines of text Ved tries to detect the cases in which it runs out of memory. In some activities. such as reading in a file. it will simply refuse. In others, such as a kill or an insertion, you will get the message Out of memoryl Please do one of the following: Pick a window to delete c - continue (after you free something) q - save and quit tC - quit without saving Ved cannot proceed without more memory, and cannot exit gracefully from this activity, so you have to help it out To pick a window. select it with one mouse click and signal it with a second click. It will be saved if modified. then deleted to· reclaim its storage. If you have anything else going on on your Sun. you can delete a view or terminate a program or delete an exec to frcc some storage. After doing so, type c to continue. If this won't work, type q to try to save everything and quit gracefully. It will save the current butTer last. trying to "void the dangers of saving a half-modified text tc is a last resort. "quick and dirty quit 1 May 1986 V·Syslem 6.0 Rererellce Mallual Crash Recover, 14·13 14.18. Some Hints Ion Usage If you get into a weird state. try tl, it often restores sanity. If that fails, a save may work anyway- it uses only the textual data structures. and it is the display structures that usually foul up. Esc followed by a numb(~r key invokes one of the debugging routines. Avoid them, especially number 9, which is suicide. Usilll V II\I:1Y 1986 15-1 -15xlisp: An Experimental Object Oriented Language This chapter is adapted from the document XL/SP.· An Experimental Object Oriented Language, Version 1.4, January 1, 1985, by. David Bctt, 114 Davenport Ave., Manchester, NH 03103. 15.1. Introduction XLISP is an experimental lProgramming language combining some of the features of LISP with an object oriented extension capability. It was implemented to allow experimentation with object oriented programming on small computers. There are currently implementations running on the PDP-II under UNIX V7. on the VAX-II under VAX/VMS and Berkeley VAX/UNIX, and on the 8088/8086 under CP/M-86 or MS-DOS. A version is currently being developed for the 68000 under CP/M-68K and for the Apple Macintosh. It is completely written in the programming language 'C' and is easily extended with user written built-in functions and classes. It is available in source form frcc of charge to non-commercial users. Prospective commercial users should contact the author for permission to use XLISP. Many traditional LISP functions are built into XLISP. In additio~ XLISP defines the objccts 'Object' and 'Class' as primitives. 'Object' is the only class that has no superclass and hence is the root of the class heirarchy tree. 'Class' is the dass of which all classes arc instances (it is the only object that is an instance of ~~ . This document is intended to be a brief description of XLISP. It assumes some knowledge of LISP and some understanding of the concepts of objcct oriented programming. Version 1.2 ofXLISP diffelrS from version 1.1 in several ways. It supports many more Lisp functions. Also, many version 1.1 functions have been re~amed and/or changed slightly to follow traditional Lisp usage. One of the most frequently report,~d problems in version 1.1 resulted from many functions being mlmed after their equivilent functions in the C language. This turned out to be confusing for people who were trying to learn XI.ISP using traditionall.lSP texts as references. Version 1.2 renames these functions to be compatible with more traditional dialects of I.lSP. Version 1.3 introduces many new LISP functions and moves closer to the goal of being compatible with the Common l.isp standard. Version 1.4 introduces user error handling and . breakpoint support as well as more Common Lisp compatible functions. A recommended text for learning LISP programming is the book "LISP" by Winston and Horn and published by Addison Wesley. The first edition of this book is based on MacLisp and the second edition is based on Common Lisp. Future versions of XI JSP will continue to migrate towards compatibility with Common Lisp. 15.2. A Note From the Author If you have any problems with XLISP. feel free to contact me for help or advice. Please remember that since XLISP is available in source fonn in a high level language, many users have been making versions available on a variety ofmachincs. If you call to report a problem with a specific version, I may not be able to help you if that version runs on a machine to which I don't have access. Please have the version number of the version that you are running readily accessible before calling me. If you find a bug in XLISP. first try to fix the bug yourself using the source code provided. If you are successful in fixing the bug. send the bug report along with the fix to me. If you don't have access to a C Usi.. V 30 April 1986 xlisp: AD Experimental Object Oriented Language 15-1 compiler or are unable to fix a bug. please send the bug report to me and I'll try to fix it Any suggcstions for improvements will be v!clcomed. Feel free to extend the language in whatever way suits your needs. However, PLEASE DO NOT RELEASE ENHANCED VERSIONS WITHOUT CHECKING WITH ME FIRST!! I would like to be the clearing house for new features added to XLISP. If you want to add featurcs for your own personal usc, go ahead. But, if you want to distribute your enhanced version, contact me first Please remember that the goal of XLISP is to provide a .language to learn and . experiment with LISP and object oriented programming on small computers. 15.3. XLISP Command Loop When XLISP is startecL it first tries to load "initlsp" from the default directory. It then loads any files named as parameters on the command line (after appending ".Isp" to their names). It then issues the following prompt: . > This indicates that XLISP is waiting for an expression to be typed. When an incomplete expression has been typed (one where the left and right parens don't match) XLISP changes its prompt to: .. n> where n is an integer indicating how many Icvels of len parens remain unclosed. When a complete cxpression has bcen cnterccL XLISP attempts to evaluate that expression. If the expression cvaluates succcssfully, XLISP prints the result of the evaluation and thcn returns to the initial prompt waiting for another expression to be typed. Input can be aborted at any time by typing the CONTROL-G key (it may be necessary to follow CONTROL-G by REf URN). . 15.4. Break Command Loop When XLISP cncountcrs an crror while cvaluating an expression, it attempts to handlc the error in the following way: If thc symbol '*brcakcnablc*' is truc, thc messagc corresponding to the error is printed. If thc error is correctable, the correction me5.'iage is printed. If Lhe symbol '*tracenable*' is true, a trace back is printed. 111e number of entries printed dcpend~ on Lhe value of thc symbol ·*tracelimit*'. If this symbol is set to something other than a numbcr, thc cntire trace back stuck is printed. XLISP then enters a read/eval/print loop to allow thc user to exam inc the state of the interpreter in the context of the error. This loop differs from the normal top-leva) readleval/print luop in that if thc user types the symbol 'continuc' XLISP will continue from a correctable error. If the user types the symbol 'quit' XLlSP will abort the break loop and return to the . top level or the next lower numbered break loop. When in a break loop, XLISP prefixes thc break level to the normal prompt If thc symbol '*breakenablc*' is nil. XI.lSP looks for a surrounding errsct function. If one is fhund, XI.lSP examincs the value of the print nag. If lhis nag is lrue, the error me5.'klge is printed. In any case, XLISP causes the crrsct function can to return nil. If there is no surrounding errset function, XLISP p~nts thc error messagc and rcturns to the top level. 15.5. Data Types There arc several different data types available to XLISP programmers. • lists 30 April 1986 V'Syst('m 6.0 RdC'rencc Manual Data Type! 15-3 • symbols • strings • integers .objccts • tile poin.ters • subrs/fsubrs (built-in functions) ., Another data type is the strrcam. A stream is a list node whose car points to the head of a list of integers and whose cdr points to the last list node of the list. An empty stream is a list node whose car and cdr are nil. Each of the integers in the list represents a character in the stream. When a character is read from a stream, the first integer from the head of the list is removed and returned. When a character is written to a stream, the integer representing the character code of the character is appended to the end of the list. When a function indicates that it takes an input source as a parameter, this parameter can either be an input file pointer or a stream. Similarly, when a function indicates that it takes an output sink as a parameter, this parameter can either be an output file pointer or a stream. 15.6. The Evaluator The process of evaluation in XLISP: • Integers, strings, objcct.c;. file pointers, and subrs evaluate to themselves • Symbols evaluate to thc~ value associated with their current binding • Lists Jre evaluated by evaluating the first clement of the list o If it evaluates to at subr, the remaining list elements are evaluated and the subr is called with these .evaluated expressions ~ arguments. o If it evaluates to an fsubr, the fsubr is called Illsing the remaining list clements as arguments (they arc evaluated by the subr itself if necessary) c· Ifit evaluates to a list and the car of tile list is 'lambda', the remaining list clements arc evaluated and the resulting expressions arc bound to the formal arguments of the lambda expression. '(ne body of the functlion is executed within this new binding environment. .:> If it evaluates to a list and the car of the list is 'macro', the remaining Jist clemente; arc bound to the formal arguments of the macro expression. The body of the function is executed within this new binding environment The result of this evaluation is considered the macro expansion. lnis result is then evaluated in place of the original expression. o (f it evaluates to an object. the second list clement is evaluated and used as a message selector. The message formed by combining the selector with the values of the remaining list clements is sent to the object, 15.7. Lexical Conventions . . . ~ I . The following conventions are followed when entering XLISP programs: Comments in XLISP code begin with a semi-colon character and continue to the end of the line. Symbol names in XLI.SP can consist of any sequence of non-blank printable characters except the fol1owing: ()","; Usina V 30 April 1986 xllsp: AD Experimental Object Oriented Language Upper and lower case characters are distinct. The symbols 'CAR' and 'car' are not the same. The names of . all built-in functions are in lower case. The names of all built-in objects are lower case with an initial capital. Symbol names must not begin with a digit. . Integer literals consist of a sequence of digits optionally beginning with a '+' or '.'. The range of values an integer can represent is limited by the size of a C 'int' on the machine that XLISP is running on. Literal strings are sequences of characters surrounded by double Quotes. Within Quoted strings t;he '~ character is used to allow non-printable characters to be included. The codes recognized are: . . . . . means the character tV \\ \n means newline \t means tab \r means return \e means escape \onn means the character whose octal code is nnn XLISP defines several useful read macros: ' (Quote (function = = (backQuote (comma = = (comma-at evaluator evaluates a list the value of whose first clement is an object. it interprets the value of the second clement of dle list (which must be a symbol) ns the message selector. The evaluator detcnnines the claliS of the receiving object and attempts to find a method corresponding to the message selector in the set of messages defined for dlat class. If the message is not found in the objcct's class and the class has a supcr-clas~ the search continues by looking at the messages defined for the super-class. This process continues from one supcr-class to the next until a method thr the message is found. If no method is fou nd, an error occurs. When a mcdlod is fhund, the evalualor hinds the receiving objl'Ct to the symbol 'self, binds dle clas.~ in which the method was round to the symbol 'msgchls.'i'. and evaluates the method using the remaining elements or the original list a'i arguments to dle method. '111ese arguments are always evaluated prior to being bound to their corresponding fonnal arguments. The result of evaluating the method becomes the result of the expression. Qasscs: 30 April 1986 V·Systl'1II6.0 Rl'fl'rl'ncc Mnnual 15-5 Objects Object THE TOP OF THE CLASS HEIRARCHY . Messages: show SHOW AN OBJECT'S INSTANCE VARIABLES returns the object class RETURN THE CLASS OF AN OBJECT returns the class of the object isnew THE DEFAULT OBJECT INITIALIZATION ROUTINE returns the object sendsuper esel> [eargs> .•. ] SEND SUPERCLASS A MESSAGE ese1> the ~essage selector eargs> . the message arguments returns the result of sending the message Class THE CLASS OF ALL OBJECT CLASSES (including itself) Messages: new CREATE A NEW INSTANCE OF A CLASS returns the new class object isnew [escls>] INITIALIZE A NEW CLASS escls>" the superc1ass the new class object returns answer emsg> efargs> ecode> ADD A MESSAGE TO A CLASS the message symbol emsg> the formal argument list efargs> this list is of the form: (efarg> ... [&optional eoarg> ••. ] [&rest erarg>] [&aux eaux> .•• ]) where cfarg> a formal argument an optional argument coarg> . (default is nil) crarg> bound to the rest of the arguments , a auxiliary variable (set to' nil) a list of executable expressions ecode> returns the object DEFINE THE LIST OF INSTANCE VARIABLES ivars evars> "the list of instance variable symbols evars> returns the object DEFINE THE LIST OF CLASS VARIABLES cvars evars> the list of class variable symbols evars> the object returns When a new instance of a class is created by sending the message t new• to an existing classt the Usinl V m~1gc 30 Aprill9ft6 xlisp: An Experimcntal Object Oriented Language 15-6 'isnew' followed by whatever parameters were passed to the 'new' message is sent to the newly created object. When a new class is created by sending the 'new' message to the object 'Class" an optional parameter may be specified indicating the superclass of the new class. If this parameter is omitted, the new class will be a subclass of 'Object'. A class inherits all instance variables, class variables, and methods from its super-class. 15.9. Symbols self the current object (within a message context) msgclass *oblist* IiIkeylist* the class in which the current method was found the object list the keyword list *standard-input* the standard input file *standard-output* the standard output tile *brcakenable* flag controlling entering the break loop on errors *traccnable* *tracelimit* flag controlling trace back printout on errors and breaks maximum number of levels of trace back information printed on errors and breaks *evalhook* *applyhook* user substitute for the evaluator function (not yet implemented) *unbound* indicator for unbound sy~bols 15.10. Evaluation Functions (eval returns EVALUATE AN XLISP EXPRESSION the expression to be evaluated the result of evaluating the expression (apply the function to apply (or function symbol) the argument list returns the result of applying the function to the argument list (funcall ... ) CALL A FUNCTION WITH ARGUMENTS the function to call (or function symbol) arguments to pass to the function returns the result of calling the function with the arguments (quote returns JO April 1986 RETURN AN EXPRESSION UN EVALUATED the expression to be quoted (quoted) unevaluated V·System 6.0 Rcrcrcncc Manual Evaluation Functions 15-7 (function the function to be quoted (quoted) returns unevaluated FILL IN A TEMPLATE (backquota the template returns a copy of the template with comma and comma-at expressions expanded (see the Common Lisp reference manual) 15.11. Sym bol Fun(~tions (set the the returns the SET THE VALUE OF A SYMBOL symbol being set new value new value (setq [ ] ... ) SET THE VALUE OF A SYMBOL the symbol being set (quoted) the new value returns the·new value (setf [
] ... ) SET THE VALUE OF A FIELD specifies the field to. set (quoted):
the value of a symbol (car the new value returns the new value (defun ... ) Using V DEFINE A FUNCTION 30 :\prilI9R6 "lisp: An Experimental Object Oriented I.anguage 15-8 (defmacro ... ). DEFINE A MACRO symbol being defined (quoted) list of formal arguments (quoted) . t his 1i s tis oft he form: .: «farg> .•• [&optiona1 ••• ] [&rest ] [&aux ••• ]) where <~arg> is a formal argument is an optional argument (default nil) bound to the rest of the arguments is an auxiliari variable (set to nil) expressions conltituting the body of the function (quoted) returns the function symbol (gensym [ ]) GENERATE A SYMBOL string or number returns the new symbol (intern the symbol's print name string returns the ne~ symbol (make-symbol the symbol's print name string returns the new symbol (symbol-name the symbol returns the symbol's print name (symbol-value the symbol returns the symbol's value (symbol-plist the symbol returns the symbol's property list 15.12. Property List Functions (get the the returns the 341 April 1986 GET THE' VALUE OF A PROPERTY symbol property symbol property value or nil V·System 6.0 Rcrercn('c Munual PrOpertl List Functions 15-9 (remprop returns returns RETURN THE CAR OF A LIST NODE the list node the car of the list node (cdr returns RETURN· THE CDR OF A LIST NODE the list node the cdr of the list node (caar the car the cdr returns the new ... ) CREATE A LIST OF VALUES expressions to be combined into a list returns the new list (append ... ) APPEND LISTS lists whose elements are to be appended returns the new list (reverse cexpr» REVERSE A LIST the list to reverse returns a new list in the reverse order (last returns Using V RETURN THE LAST LIST NODE OF A LIST the list the last list node in the list 311 April 1986 15-10 xllsp: An Experimental Object Oriented Language (member
[
])
returns (assoc <~xpr> returns FINO AN EXPRESSION IN A LIST the expression to find the list to search the keyword :test or :test-not the test function (defaults to eql) the remainder of the list starting with the expression [ ]) the the the the the FINO AN EXPRESSION IN AN A-LIST expression to find association list keyword :test or :test-not test function (defaults to eql) alist entry or nil (remove [
])
returns (length returns the the the the the REMOVE AN EXPRESSION FROM A LIST expression to delete list keyword :test or :test-not test function (defaults to eql) list with the matchirig expressions deleted FINO THE LENGTH OF A LIST the list the length of the list (nth the number of the element to return (zero origin)
the list returns the nth element or nil if the list isn't that long (nthcdr
the number of the element to return (zero origin)
the list returns the nth cdr or nil if the list isn't that long (mapc
<11st1> ... <11stn» <11st1 .. n> returns 30 April 19R6 APPLY FUNCTION TO SUCCESSIVE CARS the function or function name a list for each argument of the function the first list of arguments V·System 6.0 Udcrl'nre Manual List FunctioDS 15-11 (mapcar .•• returns APPLY FUNCTION TO SUCCESSIVE CARS the function or function name a list for each argument of the function the list of values returned by each function invocation (mapl ... the function or function name a'list for each argument of the function returns the first list of arguments (maplist .•. returns APPLY FUNCTION TO SUCCESSIVE CDRS the function or function name a list for each argument of the function the list of values returned by each function invocation (subst [ ])· SUBSTITUTE EXPRESSIONS the new expression the old expression the expression in which to do the substitutions the keyword :test or :test-not the test function (defaults to eql) returns the expression with substitutions (sublis [ ]) returns ·the the the the the SUBSTITUTE USING AN A-LIST association list expression in which to substitute keyword :test or :test-not test function (defaults to eql) expression with substitutions 15.14. Destructive List Functions (rplaca
the list node the new value for the car of the list node returns the list node after updating the car (rplacd
the list node the new' value for the cdr of the list node .returns the list node after updating the cdr (nconc ... ) DESTRUCTIVELY CONCATENATE LISTS
lists to concatenate returns the result of concatenating the lists Using V 30 April 1986 15-11 xlisp: An Experimental Object Oriented LanglWlae (delete
[
])
returns the the the the the DELETE AN EXPRESSION FROM A LIST expression to delete list keyword :test or :test-not test function (defaults to eq1) list with the matching expressions deleted 15.15. Predicate Functions (atom returns IS THIS AN ATOM? the expression to check t if the value is an atom, nil otherwise (symbolp the expression to check returns t if the expression is a symbol, nil otherwise (numberp the expression to check returns t if the expression is a symbol, nil otherwise (null returns (not return 30 April 1986 IS THIS· AN EMPTY LIST? the list to check t if the list is empty, nil otherwise IS THIS FALSE? the expression to check t if the expression is nil, nil otherwise (listp returns IS THIS A LIST? the expression to check t if the value is a list node or nil, nil otherwise (consp returns IS THIS A NON-EMPTY LIST? the expression to check t if the value is a list node, nil otherwise (boundp returns IS THIS A BOUND SYMBOL? the symbol t if a value is bound to the symbol, nil otherwise (minusp returns IS THIS NUMBER NEGATIVE? the number to test t if the number is negative, nil otherwise V'System 6.0 Rdrrencc Manual 15-13 Predicate FunctiollS (zerop · returns IS THIS NUMBER ZERO? the number to test t if the number is zero. nil otherwise (plusp · returns IS THIS NUMBER POSITIVE? the number to test t if the number is positive. nil (evenp · returns IS THIS NUMBER EVEN? the number to test t if the number is even, nil otherwise (oddp returns otherw~se . IS THIS NUMBER ODD? the number to test t if the number is odd, nil otherwise (eq the first expression the second expression returns t if they are equal, nil otherwise (eql returns ARE THE EXPRESSIONS IDENTICAL? (WORKS WITH NUMBERS AND STRINGS) the first expression the second expression t if they are equal, nil otherwise (equal the first expression the second expression returns t if they are equal. nil otherwise 15.16. Control Functions (cond ... ) EVALUATE CONDITIONALLY pair consisting of: «pred> •.• ) where is a predicate expression evaluated if the predicate is not nil the value of the first expression whose predicate returns is not nil llsingV 30 April 1986 xllsp: An Experimental Object Oriented Language 15-14 (and ... ) THE LOGICAL AND OF A LIST OF EXPRESSIONS the expressions tQ be ANDed .. . nil if any expression evaluates to nil, returns otherwise the value of the last expression (evaluation of expressions stops after the first expression that evaluates to nil) (or ... ) THE LOGICAL OR OF A LIST OF EXPRESSIONS the expressions to be ORed .. . nil if all expressions evaluate to nil, retur.ns else the value of the first non-nil expression (evaluation of expressions stops after the first expression that does not evaluate to nil) (if [ ]) EXECUTE EXPRESSIONS CONDITIONALLY the test expression the expression to be evaluated if texpr is non-nil the expression to be evaluated if texpr is nil returns the value of the selected expression (let «binding> ... ) ... ) BIND SYMBOLS AND EVALUATE EXPRESSIONS (let- «binding> ... ) ... ) LET WITH ,SEQUENTIAL BINDING the Yariab1e bindings each of which is either: 1) a symbol (which is initialized to nil) 2) a list whose car is a symbol and whose cadr is an inttia1ization expression ... the expressions to be evaluated returns the value of the last expression (catch [ ] ... ) EVALUATE EXPRESSIONS AND CATCH THROWS the catch tag ... expressions to evaluate returns the value of the last expression or the throw expression (throw [ ]) THROW TO 'A CATCH the catch tag the value for the catch to return (default nil) returns never'returns 15.17. Looping Functions 30 April 1986 V·System 6.0 Reference Manual looping FunctioHlS 15-1S (do ([ ] ... ) «texpr> [ ] ..• ) [ ] ••• ) (do* ([ ] ... ) «texpr> [ ] ... ) [ ] ... ) the variable bindings each of which is either: · 1) a symbol (which is initialized to nil) 2) a list of t~e form: «sym> [ ]) where: is the symbol to bind ts the initial value of the symbol is a step expression t~e ter~ination test expression .. . result expressions (the default is nil) the body of the loop (treated like a prog) .. . returns the value of the last result expression (dolist «sym> [ ]) [ ] ... ) LOOP THRU A LIST , the symbol to bind to each list element the list expression the result expression (the default is nil) the body of the loop (treated like a prog) ... (dotimes «sym> [ ]) [ ] ..• ) ... the the the the LOOP FROM ZERO TO N-1 symbol to bind to each value from 0 to n-1 number of times to loop result expression (the default is nil) body of the loop (treated like a prog) 15.18. The Program Featu re (prog «binding> ... ) [ ] ... ) THE PROGRAM FEATURE (prog* «binding> ... ) [ ] ... ) PROG WITH SEQUENTIAL BINDING the variable bindings each of which is either: 1) a symbol (which is initialized to nil) 2) a list whose car is a symbol and whose cadr is an initialization expression expressions to evaluate or tags (symbols) returns nil or the argumen1 passed to the return function (go the tag (quoted) returns never returns (return [ ]) CAUSE A PROG CONSTRUCT TO RETURN A VALUE the value (defaults to nil) returns never returns Using V 30 :\ pril 19R6 xlisp: An Experimental Object Oriented Language 15-16 (progl [