• Tidak ada hasil yang ditemukan

Systems Programming (3-0-3)

APPROACH

This course is intended to bring the s t u d e n t to grips with the actual problems encountered in systems programming. T o accom- plish this it may be necessary to devote most of the course to the study of a single system chosen on the basis of availability of com- puters, systems programs, and documentation.

The course should begin with a thorough review of " b a t c h "

processing systems programming, emphasizing loading and subrou- tine linkage. The limitations of these systems should be used to motivate the more complex concepts and details of multiprogram- ming and multiprocessor systems. The theoretical concepts and

practical techniques prescribed in Course 11 should be used to focus on the d a t a bases, their design for the support of the func- tions of the key system components (hardware and software), and the effective interrelation of these components. Problem assign- ments should involve the design and implementation of systems program modules; the design of files, tables or lists for use by such modules; or the critical use and evaluation of existing system pro- grams. Other problems might involve the a t t a c h i n g or accessing of procedure or d a t a segments of different "ownership" t h a t are resi- d e n t in a single file system or the development of restricted access- ing methods (i.e. privacy schemes) and other such techniques.

CONTENT

This description has been written with M U L T I C S in mind as the system chosen for central study, b u t the description can be modi- fied to fit any reasonably comprehensive system. There is con- siderably more material listed here than can normally be covered in one semester, so t h a t careful selection of topics should be made or the course should be extended to two semesters.

1. Review of Batch Process Systems Programs. Translation, loading, and execution. Loader languages. Communication between independent program units. Limitations imposed by binding a t pre- execution times. Incremental linkage.

2. Multiprogramming and Multiprocessor Systems. General in- troduction to the structure of these systems, the techniques in- volved in their construction and some of the problems involved in their implementation.

3. Addressing Techniques. Review of indexing and indirect ad- dressing. Relocation and base registers. Two-dimensional address- ing (segmentation). Segmented processes. Concepts of virtual mem- ory. Effective address computation. Modes of access control.

Privileged forms of accessing. Paging. Physical register (address) computation, including use of associative memories.

4. Process and Data Modules. Concept of a process as a col- lection of procedure and d a t a components (segments). Process data bases. Controlled sharing of segments among two or more processes.

Intersegment linking and segment m a n a g e m e n t . Interprocedure communication. Process stacks. Levels of isolation within a process (rings of protection).

5. File System Organization and Management. File data bases a n d their storage structures. Accessing, protection and maintenance of files. Storage and retrieval of segments and/or pages from files in secondary storage (segment and page control, directory control, and core management). Search strategies.

6. Traffic Control. S t a t e words. Running, ready, blocked, and in- active processes. Process switching. Priority control of waiting processes. Scheduling algorithms. Pseudo processes. System tables for process m a n a g e m e n t .

7. Explicit Input-Output References. Auxiliary (secondary) memory references. Communication with peripheral devices. Man- agement of i n p u t - o u t p u t and other request queues. Effects of data rates on queue m a n a g e m e n t .

8. Public and Private Files. On line and off line memory. Au- tomatic shifting of d a t a among devices in the storage hierarchy and

"flushing" of online memory, i.e. multilevel storage management.

File b a c k u p schemes and recovery from system failures.

9. Other Topics. Some of the following topics may be studied if time permits. They might also be covered in subsequent semi- nars.

a. System accounting for facilities employed by the user. Spe- cial hardware features for metering different uses. Accounting for system overhead. Factors which determine system overhead.

b. Characteristics of large systems. Overall discussion of large system m a n a g e m e n t including effect of binding times for system and user process variables. Other selected topics on large systems such as the effect of new hardware components (e.g. mass mem- ories) on the overall system design.

c. Foreground and background processes. Foreground-initiated 29

b a c k g r o u n d processes. R e m o t e job control. Hierarchical job con- trol. Broadcasting.

d. M i c r o p r o g r a m m i n g as a n equivalent of various hardware a n d / o r software c o m p o n e n t s u b p r o g r a m s in a c o m p u t i n g system.

e. C o m m a n d languages. C o m m a n d s of a m u l t i p r o g r a m m i n g sys- t e m . C o m m a n d language interpreters.

f. Provisions for d y n a m i c u p d a t i n g of t h e operating system without s h u t d o w n .

g. O p e r a t i n g behavior, e.g. system s t a r t u p , (graceful) degrada- tion, a n d s h u t d o w n .

ANNOTATED BIBLIOGRAPHY

In addition to t h e following sources of information, there are m a n y m a n u a l s available from m a n u f a c t u r e r s which describe spe- cific systems programs for a wide range of c o m p u t e r s .

1. CHOROFAS, D. N. Programming Systems for Electronic Com- puters. Butterworths, London, 1962, 188 p p . CR-6566-8553.

C h a p t e r s 14, 15, a n d 16 contain a general discourse on t h e con- trol a n d diagnostic f u n c t i o n s of operating systems.

2 . CLARK, W . A . , MEALY, G . H . , AND W I T T , B . I . T h e f u n c t i o n a l s t r u c t u r e of OS/360. IBM Syst.J. 5, 1 (1966), 3-51.

A general description in three p a r t s of t h e operating system for t h e IBM System/360. P a r t I (Mealy), Introductory Survey;

P a r t II (Witt), J o b a n d T a s k M a n a g e m e n t ; a n d P a r t III (Clark), D a t a M a n a g e m e n t .

3. DESMONDE, W. H . Real-Time Data Processing Systems. Intro- ductory Concepts. Prentice-Hall, Englewood Cliffs, N . J., 1964, 192 pp. CR-6562-7236.

An e l e m e n t a r y survey of t h e design a n d p r o g r a m m i n g of real- t i m e d a t a processing systems based on three IBM systems:

Sabre, Mercury, a n d Gemini.

4. ERDWINN, J . D. (Ch.) Executive control programs—Session 8.

Proc. A F I P S 1967 Fall J o i n t C o m p u t . Conf., Vol. 31, T h o m p s o n Book Co., W a s h i n g t o n , D. C., p p . 201-254.

Five p a p e r s on control p r o g r a m s for a variety of circumstances.

5 . FISCHER, F . P . , AND SWINDLE, G . F . Computer Programming Systems. Holt, R i n e h a r t a n d Winston, New York, 1964, 643 p p . CR-6455-6299.

S e t s out to "discuss t h e entire field of c o m p u t e r p r o g r a m m i n g s y s t e m s , " b u t in reality considers primarily t h e systems pro- g r a m s for t h e IBM 1401; " o t h e r c o m p u t e r systems are men- tioned only where a p a r t i c u l a r characteristic of a p r o g r a m m i n g system, found on t h a t c o m p u t e r , w a r r a n t s discussion." Only IBM c o m p u t e r s y s t e m s a n d (with a very few exceptions) only IBM literature are referenced.

6. FLORES, I. Computer Software. Prentice-Hall, Englewood Cliffs, N. J . , 1965, 464 p p . CR-6671-8995.

E l e m e n t a r y a n d conversational t e x t primarily concerned with assembly systems using F L A P (Flores Assembly Program) a s its e x a m p l e . Some m a t e r i a l on service programs, supervisors a n d loaders.

7. GLASER, E. (Ch.) A new r e m o t e accessed m a n - m a c h i n e sys- tem—Session 6. Proc. A F I P S 1965 Fall J o i n t C o m p u t . Conf., Vol. 27, P t . 1, S p a r t a n Books, New York, p p . 185-241. (Re- p r i n t s available from t h e General Electric Company.)

Six p a p e r s on t h e M U L T I C S system.

8. HEISTAND, R. E. An executive system i m p l e m e n t e d as a finite- s t a t e a u t o m a t o n . Comm. ACM 7, 11 (Nov. 1964), 669-677. CR- 6562-7282.

Describes t h e executive system for t h e 473L c o m m a n d a n d control system. T h e system was considered as a finite a u t o m - aton a n d t h e a u t h o r claims this a p p r o a c h forced a m o d u l a r i t y on t h e resulting p r o g r a m .

9 . LEONARD, G . F . , AND GOODROE, J . R . A n e n v i r o n m e n t f o r a n operating s y s t e m . Proc. ACM 19th N a t . Conf., 1964, Associa- tion for C o m p u t i n g M a c h i n e r y , New York, p p . E2.3-1 t o E2.3-11.

• CR-6561-6546.

An a p p r o a c h to c o m p u t e r utilization involving t h e extension

of t h e operations of a c o m p u t e r with software so a s to provide a proper e n v i r o n m e n t for a n operating s y s t e m .

10. MARTIN, J . Design of Real-Time Computer Systems. Prentice- Hall, Englewood Cliffs, N . J . , 1967, 629 p p .

A general t e x t covering m a n y a s p e c t s of real-time d a t a proc- essing systems including design, applications, m a n a g e m e n t , a n d operation.

11. MARTIN, J . Programming Real-Time Computer Systems. Pren- tice-Hall, Englewood Cliffs, N. J., 1965, 386 p p .

Based on some of t h e early systems such as Sage, Project Mer- cury, Sabre, a n d P a n a m a c . A general coverage designed for managers, s y s t e m s analysts, p r o g r a m m e r s , salesmen, s t u d e n t s . 12. MILLER, A. E. (Ch.) Analysis of t i m e - s h a r e d c o m p u t e r system

performance—Session 5. Proc. ACM 22nd N a t . Conf., 1967, T h o m p s o n Book Co., W a s h i n g t o n , D. C., pp. 85-109.

T h r e e p a p e r s on m e a s u r e m e n t of t i m e - s h a r e d system perform- ance.

13. M . I . T . C o m p u t a t i o n Center. Compatible Time-Sharing Sys- tem: A Programmer's Guide, 2nd ed. M . I . T . Press, C a m b r i d g e . Mass., 1965.

A handbook on t h e use of C T S S which c o n t a i n s valuable in- f o r m a t i o n a n d guidelines on t h e i m p l e m e n t a t i o n of such sys- t e m s .

14. Project M A C . MULTICS S'ystem Programmer's Manual.

Project M A C , M.I.T., C a m b r i d g e , Mass., 1967, (limited distrib- ution).

A description of a n t j guide to systems p r o g r a m m i n g for M U L - T I C S .

15. ROSEN, S. (Ed.) Programming Systems and Languages. Mc- Graw-Hill, New York, 1967, 734 pp.

Collection of i m p o r t a n t p a p e r s in t h e area of which P a r t 5 ( O p e r a t i n g Systems) is particularly relevant to this course.

16. ROSENBERG, A. M . (Ch.) Program s t r u c t u r e s for t h e multipro- g r a m m i n g environment—Session 6A. Proc. ACM 21st N a t . Conf., 1966, T h o m p s o n Book Co., W a s h i n g t o n , D. C., p p . 223- 239.

Two p a p e r s : one on program behavior u n d e r paging; t h e other on a n a l y t i c design of look-ahead a n d program segmenting sys- t e m s .

17. ROSENBERG, A. M . (Ch.) T i m e - s h a r i n g a n d on-line systems—, Session 7. Proc. A C M 22nd N a t . Conf., 1967, T h o m p s o n Book Co., W a s h i n g t o n , D. C., pp. 135-175.

T h r e e p a p e r s on various topics related t o t h e subject.

18. SALTZER, J . H. Traffic control in a multiplexed c o m p u t e r , system. M . I . T . P h . D . Thesis, J u n e 1966. (Also available as Project M A C publication MAC-TR-30.)

On traffic control in t h e M U L T I C S system.

19. SMITH, J . W. (Ch.) T i m e - s h a r e d scheduling—Session 5A. Proc.

ACM 21st N a t . Conf., 1966, T h o m p s o n Book Co., Washington, D. C „ p p . 139-177.

Four p a p e r s on time-sharing which are more general t h a n t h e session title indicates.

20. THOMPSON, R. N., AND WILKINSON, J . A. T h e D825 a u t o m a t i c operating and scheduling program. Proc. A F I P S 1963 Spring J o i n t C o m p u t . Conf., Vol. 23, S p a r t a n Books, New York. pp.

41-49. CR-6453-5699.

A general description of an executive system program for han- dling a m u l t i p l e c o m p u t e r system tied to a n a u t o m a t i c input- o u t p u t exchange containing a n u m b e r of i n p u t - o u t p u t control modules. Discusses m a n y of t h e problems encountered in such systems a n d t h e general plan of a t t a c k in solving these prob- lems.

21. WEGNER, P . (Ed.) Introduction to System Programming. Aca- d e m i c Press, New York, 1965, 316 pp. CR-6455-6300.

C o n t a i n s a collection of p a p e r s of which t h e following are of special interest for this course: Gill, pp. 214-226; Howarth, p p . 227-238; and N a s h , p p . 239-249.

30

Course IS. Compiler Construction (3-0-3)

APPROACH

This course is to emphasize the techniques involved in the analysis of source language and the generation of efficient object code. Although some theoretical topics m u s t be covered, the course should have the practical objective of teaching the s t u d e n t how compilers may be constructed. P r o g r a m m i n g assignments should consist of i m p l e m e n t a t i o n s of components of a compiler and possi- bly the design of a simple b u t complete compiler as a group project.

CONTENT

There is probably more material listed here t h a n can reasonably be covered, so some selection will be necessary.

1. Review of assembly techniques, symbol table techniques, and macros. Review of syntactic analysis and other forms of program recognition. Review of compilation, loading, a n d execution with e m p h a s i s on t h e representation of programs in the loader language.

2. One-pass compilation techniques. T r a n s l a t i o n of a r i t h m e t i c expressions from postfix form to machine language. Efficient use of registers a n d temporary storage.

3. Storage allocation for constants, simple variables, arrays, tem- porary storage. Function and s t a t e m e n t procedures, independent block structure, nested block structure, and d y n a m i c storage allo- cation.

4. Object code for subscripted variables, storage m a p p i n g func- tions, and dope vectors. Compilation of sequencing s t a t e m e n t s .

5. Detailed organization of a simple complete compiler. Symbol tables. Lexical scan on i n p u t (recognizer), syntax scan (analyzer), object code generators, operator a n d operand stacks, o u t p u t sub- routines, and error diagnostics.

6. Data types, transfer functions, mixed mode expressions and s t a t e m e n t s .

7. S u b r o u t i n e and function compilation. P a r a m e t e r s called by address, by n a m e and by value. Subroutines with side effects. Re- strictions required for one pass execution. Object code for trans- mission of p a r a m e t e r s . Object code for subroutine body.

8. Languages designed for writing compilers: T M G (McClure), C O G E N T (Reynolds), G A R G O Y L E (Garwick), M E T A II (Schorre), and TGS-II ( C h e a t h a m ) .

9. Bootstrapping techniques. Discussion of a meta-compiler in its own language.

10. Optimization techniques. Frequency analysis of use of pro- gram s t r u c t u r e s to d e t e r m i n e most i m p o r t a n t features for optimiza- tion.

11. Local optimization to take a d v a n t a g e of special instructions.

Loading registers with constants, storing zeros, changing sign, a d d i n g to memory, multiplication or division by two, replacement of division with multiplication by a constant, squaring, raising to integer powers, and comparing to zero. Subscript optimization.

12. Expression optimization. Identities involving minus signs, common subexpression evaluation and other techniques. Minimiza- tion of temporary storage and the n u m b e r of a r i t h m e t i c registers in multiple register machines.

13. Optimization of loops. Typical loops coded several ways. In- dex register optimization in the innermost loop. Classification of loops for optimization purposes.

14. Problems of global optimization. D e t e r m i n a t i o n of flowchart graph of program. Analysis of program graphs. R e a r r a n g e m e n t of c o m p u t a t i o n to do as little as possible in innermost loop. Factoring of invariant subexpressions. Object code for interfaces between flow blocks.

ANNOTATED BIBLIOGRAPHY *

1. ACM Compiler Symposium. Papers presented a t the ACM Compiler Symposium, November 17-18, 1960, Washington, D. C., Comm. ACM 4, 1 (Jan. 1961), 3-84.

Contains a n u m b e r of relevant papers including one by R. W.

Floyd entitled "An Algorithm for Coding Efficient Arithmetic Operations" and one by P. Z. Ingerman on " T h u n k s . "

2 . ARDEN, B . W . , GALLER, B . A . , AND GRAHAM, R . M . A n a l g o - rithm for translating Boolean expressions. J. ACM 9, 2 (Apr.

1962), 222-239. CR-6341-3567.

Description of code generation in the MAD Compiler.

3 . BRINCH-HANSEN, P . , AND HOUSE, R . T h e C O B O L c o m p i l e r f o r the Siemens 3003. BIT6, 1 (1966), 1-23.

Describes the design of a ten-pass compiler with extensive error detection.

4. CHEATHAM, T . E., JR. T h e TGS-II translator generator sys- tem. Proc. IFIP Congress, New York, 1965, Vol. 2, S p a r t a n Books, New York, pp. 592-593.

A report on the " c u r r e n t position" of C o m p u t e r Associates

" t r a n s l a t o r generator s y s t e m . "

5. CHEATHAM, T . E., JR. The Theory and Construction of Com- pilers. D o c u m e n t CA-6606-0111, Compi ,er Associates, Inc., Wakefield, Mass., J u n e 2, 1966, limited distribution.

Notes for course AM 295 a t H a r v a r d , fall 1967.

6 . CHEATHAM, T . E . , J R . , AND SATTLEY, K . S y n t a x - d i r e c t e d c o m - piling. Proc. A F I P S 1964 Spring J o i n t C o m p u t . Conf., Vol. 25, S p a r t a n Books, New York, pp. 31-57. CR-6455-6304.

An introduction to top-down syntax directed compilers.

7. CONWAY, M. E. Design of a separable transition-diagram compiler. C o m m . ACM 6, 7 (July 1963), 396-408. CR-6451-5024.

Describes the organization of a COBOL compiler. T h e methods are largely applicable to construction of compilers for other languages such as ALGOL.

8 . CONWAY, R . W . , AND MAXWELL, W . L . C O R C — t h e C o r n e l l computing language. Comm. ACM 6, 6 ( J u n e 1963), 317-321.

Description of a language and compiler which are designed to provide extensive error diagnostics a n d other aids to the pro- grammer.

9. ERSHOV, A. P. ALPHA—an a u t o m a t i c p r o g r a m m i n g system of high efficiency. J. ACM 13, 1 ( J a n . 1966), 17-24. CR-6673-9720.

Describes a compiler for a language which includes most of ALGOL as a subset. Several techniques for optimizing both t h e compiler and the object code are presented.

10. ERSHOV, A. P. Programming Programme for the BESM com- puter, transl. by M. Nadler. Pergamon Press, New York, 1959, 158 pp. CR-6235-2595.

One of t h e earliest works on compilers. Introduced the use of stacks a n d the removal of common subexpressions.

11. ERSHOV, A. P. On programming of a r i t h m e t i c operations.

Comm. ACM 1, 8 (Aug. 1958), 3 - 6 and 9 (Sept. 1958), 16.

Gives an algorithm for creating rough machine language in- structions in pseudoform and then altering t h e m into a more efficient form.

12. FREEMAN, D. N. Error correction in CORC. Proc. AFIPS 1964 Fall Joint C o m p u t e r Conf., Vol. 26, P a r t I, S p a r t a n Books, New York, pp. 15-34.

Discusses techniques of correcting errors in programs written in the Cornell computing language.

1 3 . GARWICK, J . V . G A R G O Y L E , a l a n g u a g e f o r c o m p i l e r w r i t i n g . Comm. ACM 7, 1 ( J a n . 1964), 16-20. CR-6453-5675.

Describes an ALGOL-like, language which uses syntax-directed methods.

14. GEAR, C. W. High speed compilation of efficient object code.

Comm. ACM8, 8 (Aug. 1965), 483-488. CR-6671-9000.

Describes a three-pass compiler which represents a compro- mise between compilation speed and object code efficiency.

P r i m a r y a t t e n t i o n is given to the optimization performed by the compiler.

15. GRIES, D . , PAUL, M . , AND WIEHLE, H . R . S o m e t e c h n i q u e s u s e d in the ALCOR I L L I N O I S 7090. Comm. ACM 8, 8 (Aug. 1965), 496-500. CR-6566-8556.

Describes portions of an ALGOL compiler for the IBM 7090.

16. HAWKINS, E . N . , AND HUXTABLE, D . H . R . A m u l t i p a s s t r a n s - lation scheme for ALGOL 60. In R. Goodman (Ed.), Annual Re- view in Automatic Programming, Vol. 3, Pergamon Press, New York, 1963, pp. 163-206.

Discusses local and global optimization techniques.

17. HORWITZ, L . P . , KARP, R . M . , MILLER, R . E . , AND WINOCRAD, S . Index register allocation. J. ACM 13, 1 ( J a n . 1966), 43-61. CR- 6 6 7 4 - 1 0 , 0 6 8 .

A m a t h e m a t i c a l t r e a t m e n t of the problem. Useful in compiler writing.

18. International C o m p u t a t i o n Centre (Eds.) Symbolic Languages in Data Processing, Proceedings of t h e Symposium in Rome, M a r c h 26-31, 1962. Gordon and Breach, New York, 1962, 849 pp.

T h e twelve papers listed under "Construction of Processors for Syntactically Highly S t r u c t u r e d L a n g u a g e s " in this volume are particularly of interest for this course.

19. KNUTH, D. E. A history of writing compilers. Comput. Autom.

11, 12 (Dec. 1962), 8-18.

Describes some of the early techniques used in writing Ameri- can compilers.

20. MCCLURE, R. M. TMG—A syntax directed compiler. Proc.

ACM 20th N a t . Conf., 1965, Association for C o m p u t i n g Ma- chinery, New York, pp. 262-274.

T h e compiler writing system described in this paper was de- signed to facilitate t h e construction of simple one-pass trans- lators for some specialized languages. It has features which simplify t h e handling of declarative information and errors.

21. NAUR, P . T h e design of the G I E R ALGOL compiler. In R.

Goodman (Ed.), Annual Review in Automatic Programming, Vol. 4, Pergamon Press, New York, 1964, pp. 49-85. CR-6564- 7904.

Describes a m u l t i p a s s compiler written for a computer with a small high-speed memory.

2 2 . RANDELL, B . , AND RUSSELL, L . J . ALGOL 60 Implementation.

Academic Press, New York, 1964, 418 pp. CR-6565-8246.

Contains a survey of ALGOL i m p l e m e n t a t i o n techniques and a description of an error-checking and debugging compiler for t h e K D F 9 computer.

23. REYNOLDS, J . C. An introduction to the C O G E N T program- ming system. Proc. ACM 20th N a t . Conf., 1965, Association for C o m p u t i n g Machinery, New York, pp. 422-436.

Describes the s t r u c t u r e and major facilities of a compiler- compiler system which couples t h e notion of syntax-directed compiling with t h a t of recursive list processing.

24. ROSEN, S. (Ed.) Programming Systems and Languages. Mc- Graw-Hill, New York, 1967, 734 pp.

A collection of papers of which the following are of special in- terest for this course: Backus, et al., p p . 29-47; Bauer and Samelson, pp. 206-220; D i j k s t r a , ' p p . 221-227; K a n n e r , Kosin- ski, and Robinson, pp. 228-252; Rosen, Spurgeon, and Don- nelly, pp. 264-297; a n d Rosen, pp. 306-331.

25. SCHORRE, D. V. M E T A II, a syntax-oriented compiler writing language. Proc. ACM 19th N a t . Conf., 1964, Association for C o m p u t i n g Machinery, New York, pp. Dl.3-1 to Dl.3-11. CR- 6561-6943.

Describes a compiler writing language in which its own com- piler can be written.

26. WEGNER, P . (Ed.) Introduction to System Programming. Aca- demic Press, New York, 1965, 316 pp. CR-6455-6300.

Contains a collection of papers of which the following are of special interest for t h i s course: Pyle, pp. 86-100; Wegner, pp.

101-121; Randell, pp. 122-136; Huxtable, pp. 137-155; Hoare, pp. 156-165; and d'Agapeyeff, pp. 199-214.