include problem
[unix-history] / .ref-BSD-3 / usr / doc / vmunix / newstuff.t
CommitLineData
bdf8e557
OB
1.LG
2.B
3.ce
4Getting started with...
5.sp
6.ce
7Berkeley Software for UNIX\(dg on the VAX\(dd
8.br
9.ce
10\s-4(The third Berkeley Software Distribution)\s0
11.R
12.NL
13.sp .75i
14.PP
15.FS
16\(dg\s-2UNIX\s0 is a trademark of Bell Laboratories.
17.FE
18.FS
19\(dd\s-2VAX\s0 is a trademark of Digital Equipment Corporation.
20.FE
21A package of software for \s-2UNIX\s0 developed at the Computer
22Science Division of the University of California at Berkeley is
23installed on our system. This package includes a new version of the
24operating system kernel which supports a virtual memory, demand-paged
25environment. While the kernel change should be transparent to most
26programs, there are some things you should know if you plan to run
27large programs to optimize their performance in a virtual memory
28environment. There are also a number of other new programs which are
29now installed on our machine; the more important of these
30are described below.
31.SH
32Documentation
33.PP
34The new software is described in two new volumes of documentation. The first
35is a new version of volume 1 of the \s-2UNIX\s0 programmers manual
36which has integrated manual pages for the distributed software and
37incorporates changes to the system made while introducing the virtual
38memory facility. The second volume of documentation is numbered volume
392c, of which this paper is a section.
40This volume contains papers about programs which are in the distribution
41package.
42.SH
43Where are the programs?
44.PP
45Most new programs from Berkeley reside in the directory
46.B /usr/ucb.
47A major exception is the C shell,
48.I csh,
49which lives in
50.B /bin.
51We will later describe how you can arrange for the programs
52in the distribution to be part of your normal working environment.
53.SH
54Making use of the Virtual Memory
55.PP
56With a virtual memory system, it is no longer necessary for running programs to
57be fully resident in memory. Programs need have only a subset
58of their address space resident in memory, and pages which are not
59resident in memory will be
60.I faulted
61into memory if they are needed.
62This allows programs larger than memory to run, but also places a penalty
63on programs which do not exhibit
64.I locality.
65It is important to structure large programs so that at any one time
66they are referring to as small a number of pages as possible.
67.PP
68If you are going to create very large programs, then you should know about
69a new demand load format. This format causes large programs to begin execution
70more rapidly, without loading in all the pages of the program before execution
71begins. It is most suitable for programs which are large (say > 50K bytes
72of program and initialized data),
73and especially when a program has a large number of facilities,
74not all of which are used in any one run.
75To create an executable file with this format, you use the
76.B \-z
77loader directive; thus you can say ``cc \-z ...'' or ``f77 \-z ...''.
78The
79.I file
80command will show such files to be ``demand paged pure executable''
81files.
82See the manual page for
83.I ld
84in section 1 and
85.I a.out
86in section 5 of volume 1 of the manual for more information.
87.PP
88If you have or are writing
89a large program which creates new processes as children,
90then you should know about
91.B vfork
92system call.
93The
94.B fork
95system call creates a new process by copying the data space of
96the parent process to create a child process. In a virtual environment
97this is very expensive.
98.B Vfork
99allows creation of a new process without copying the parent's address
100space by letting the parent execute in the child's system context.
101The parent can set up the input/output for the child and then return
102to its own context after a call to
103.B exec
104or
105.B _exit.
106If you use the standard I/O routine
107.B system()
108to execute commands from within your programs, then
109.B vfork
110will be used automatically.
111If you have been calling
112.B fork
113yourself,
114you should read the manual page for
115.B vfork
116and use it when you can.
117.PP
118In order that efficient random access be permitted in a portable way to
119large data files, a pair of new system calls has been added:
120.B vread
121and
122.B vwrite.
123These calls resemble the normal \s-2UNIX\s0
124.B read
125and
126.B write
127calls, but are potentially much more efficient for sparse and random
128access to large data files.
129.B Vread
130does not cause all the data which is virtually read to be immediately
131transferred to your address space. Rather, the data can be fetched
132as required by references, at the systems discretion. At the point of the
133.B vread,
134the system merely computes the disk block numbers of the corresponding
135pages and stores these in the page tables. Faulting in a page from
136the file system is thus no more expensive than faulting in a page from
137the paging device. In both cases all the mapping information is immediately
138available or can be easily computed from incore information.
139.B Vwrite
140works with
141.B vread
142to allow efficient updating of large data which is only partially
143accessed, by rewriting to the file only those pages which have been modified.
144.PP
145Downward compatibility to non-virtual systems is achieved by the
146fact that
147.B read
148and
149.B write
150calls have the same semantics as
151.B vread
152and
153.B vwrite
154calls; only the efficiency is different.
155If you have programs which access large files, and do so sparsely,
156read the manual pages for
157.B vread
158and
159.B vwrite
160in section 2 of volume 1 of the manual.
161.SH
162File System blocksize changes
163.PP
164The size of blocks in the file system has been changed to improve the
165throughput of the disks. The constant ``512'' is not the ``best'' size
166to use when reading/writing the disk; rather you should use ``BUFSIZ''
167blocks as defined in the include file <stdio.h>.
168Because this constant has been changed
169.B
170all old \&.o files must be removed and then recreated.
171.R
172They will not load successfully, since the distributed
173library routines assume that BUFSIZ is 1024 (its current value at
174our installation).
175Old executable images may be preserved by running the command
176.DS
1771kfix file
178.DE
179on each such file.
180Note that this only works for ``a.out'' type files, not ``.o's.''
181It is recommended that all old programs be recompiled to take
182advantage of the larger disk block size.
183.SH
184New Languages for the VAX
185.PP
186There are now available interpreters for \s-2APL\s0 and Pascal
187for the \s-2VAX\s0, and a \s-2LISP\s0 system supporting a dialect of
188\s-2LISP\s0 compatible with a large subset of \s-2MACLISP\s0.
189The \s-2APL\s0 interpreter is the \s-211\s0 version, moved to the \s-2VAX\s0,
190and now has a large workspace capability (but
191has not been extensively used.)
192The Pascal system has been used extensively for instruction and research
193and is the same system which was available on the PDP-11. The only
194limitations of the Pascal system are a maximum of 32K bytes per stack
195frame (due to the implementation of the interpreter), and 64K bytes per
196variable allocated with
197.I new.
198Essentially arbitrary sized programs can be run with the system,
199which supports a very standard Pascal with no language extensions.
200The Pascal system features very good error diagnostics, and
201includes a source level execution profiling facility.\(dg
202.FS
203\(dg A compiler for Pascal based on this system is currently being developed,
204but is not part of this distribution.
205.FE
206.PP
207The \s-2LISP\s0 system, ``Franz Lisp'', was developed at Berkeley as part
208of a project to move the \s-2MIT\s0 \s-2MACSYMA\s0 system from
209the \s-2PDP-10\s0 to the \s-2VAX\s0. A compiler
210.I liszt
211for Franz Lisp, written at Bell Laboratories, is also included with the system.
212.PP
213For more information about
214\s-2APL\s0 refer to its manual page in volume 1 of the manual.
215The Pascal system consists of the programs
216.B pi,
217.B px,
218.B pix,
219.B pxp,
220.B pxref,
221and
222.B pic,
223all of which are documented in section 1 of volume 1 of the manual.
224There is also a paper introducing the system in volume 2c.
225The \s-2LISP\s0 system is described in
226.I "The Franz Lisp Manual"
227in volume 2c of the manual.
228.SH
229A display editor \- \fIvi\fR
230.PP
231The system includes the latest version of the display editor
232.I vi
233which runs on a large number of intelligent and unintelligent display terminals.
234This editor runs using a terminal description data base and a library
235of routines for writing terminal independent programs which is also supplied.
236The editor has a mnemonic command set which is easy to learn and remember,
237and deals with the hierarchical structure of documents in a natural way.
238Editor users are protected against loss of work if the system crashes,
239and against casual mistakes by a general
240.I undo
241facility as well as visual feedback.
242The editor is quite usable even on low speed lines and dumb terminals.
243.PP
244For users who prefer line oriented editing, the
245.I ex
246command enters the same editor, but in a line oriented editing mode.
247For beginners who have never used a line editor before,
248there is a version of the editor known as
249.I edit
250which has a well-written tutorial introducing it.
251.PP
252For more information about
253.I edit
254see
255.I "Edit: a Tutorial"
256in volume 2c of the manual.
257The line editor features are described in the
258.I "Ex Reference Manual"
259which is in volume 2c of the manual.
260Also in volume 2c are
261.I "An Introduction to Display Editing with Vi"
262and a
263.I vi
264reference card.
265.SH
266Command and mail processing programs
267.PP
268There is also a new command processor
269.I csh
270which caters to interactive users by providing a history list of
271recent commands, which can be easily repeated. The shell also
272has a powerful macro-like aliasing facility which can be used to
273tailor a friendly command environment.
274.I Csh
275is implemented so that both it and the standard shell
276.B /bin/sh
277can be run on the same system.
278.PP
279The
280.I "Introduction to the C shell"
281introduces the shell. If you have used the standard shell, then
282you should especially read about the
283.I history
284and
285.I alias
286mechanisms of the shell.
287.PP
288In order that the manual distributed with the tape correspond to the
289commands which are available to you, the default execution search
290path is
291.DS
292PATH=:/usr/ucb:/bin:/usr/bin
293.DE
294in the language of
295.B /bin/sh
296or
297.DS
298setenv PATH :/usr/ucb:/bin:/usr/bin:
299set path=(. /usr/ucb /bin /usr/bin)
300.DE
301in the language of
302.B /bin/csh.
303.PP
304For sending and receiving mail,
305a new interactive mail processing command provides a hospitable environment,
306supporting items such as subject and carbon copy fields, and allowing creation
307of distribution lists. This command also has a mail reading mode which
308makes it convenient to deal with
309large volumes of mail.
310See the manual page for
311.I mail
312in section 1, volume 1 of the manual, and the
313.I "Mail reference Manual"
314in volume 2c of the manual for more details.
315.SH
316Better debugger support
317.PP
318A version of the symbolic debugger
319.I sdb
320is provided which now can debug
321FORTRAN 77 programs. The assembler has been rewritten and the C compiler
322modified to reduce greatly the overhead of using the symbolic debugger,
323making it much more feasible for heavy use.
324If you are interested, then you should read the new document for
325.I sdb,
326provided in volume 2c.
327.SH
328Other software
329.PP
330Other new programs include
331programs to simulate the phototypesetter on 200 bpi plotters,
332a common system messages facility, routines for data compression,
333a modified version of the standard I/O library permitting
334simultaneous reads and writes, a network for connecting heterogeneous
335UNIX systems at low cost (1 tty port per connection per machine and
336no system changes), and a new, flexible macro package for n/troff
337.I \-me.
338New command
339.B whatis
340and
341.B apropos
342can be used to identify programs and to locate commands based on keywords.
343Try
344.DS
345cd /usr/ucb
346whatis *
347.DE
348and to find out about Pascal:
349.DS
350apropos pascal
351.DE
352.SH
353Monitoring the new system
354.PP
355If you want to see what is happening in the new system, you can use the
356new
357.B vmstat
358command, described in section 1 of the manual, which shows the current
359virtual load on the system. The system recomputes the information printed
360by
361.B vmstat
362every five seconds, so a ``vmstat 5'' is a good command to try.
363.PP
364To see what processes are active virtual processes, you can do
365.DS
366ps av
367.DE
368The command
369.DS
370ps v
371.DE
372will print only the active processes which you are running.