🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by Tim Rentsch Tue, 04 Nov 1986 04:19
Smalltalk Notes
#363
Author: Tim Rentsch
Date: Tue, 04 Nov 1986 04:19
158 lines
6715 bytes
Copyright(c) 1986, by Tim Rentsch

Copyright Notice:  This memo is Copyright(c) 1986, by Tim Rentsch.
Copies may be made and distributed provided all of the following
conditions are met:  one, the copyright notice be included in its
entirety; two, the memo be copied (or distributed) in its entirety;
three, the memo be copied (or distributed) individually, i.e., not in
collection with other material; four, copies be made and distributed
one at a time, i.e., copies cannot be made or distributed in batches
of more than one; five, copies may not be sold -- distributing copies
is to be done at no cost to the recipients of the copies.  (End of
conditions, and end of copyright notice.)  




Note # 1:  Administrative Details
=================================

When you unpack your Smalltalk interpreter, you might find more
files than you expect.  Standard Smalltalk interpreters require four
(4) files just to start running.  For PS running on a sun-2 these
are:

	PS/PS.Sun2
	image/ST80-LV2.PS4
	image/ST80-LV2.sources
	image/ST80-LV2.changes

We will discuss momentarily the whys and wherefores of these files.
For now, however, you want to try out your smalltalk, and make it
easy for other people to try it too (but you also want to be careful
to leave the original files intact).  Here is how to do that.

First, create a directory, such as /usr/local/PS, to hold the
interpreter and related stuff.  That directory should look like this:

% ls /usr/local/PS
PS/	goodies/	image/

i.e., those are the directories on the tar tape.  [You might want to
make all the files gotten off the tar tape read-only.  You can do
this safely, but be warned:  if you do make the files read-only, you
may find that Smalltalk complains when you try to examine methods in
the browser.  Fear not -- merely hold down the left shift key when
bringing up the method.  A memo with a fix to this problem is in the
works.] 

Add a /usr/local/PS/bin/ directory, and put the following files in it
(suitably modified to reflect local directory names, obviously).  


file '/usr/local/PS/bin/setup'
--------------- CUT HERE ----------------------
#! /bin/csh -f
ln -s /usr/local/PS/image/ST80-LV2.PS4      .
ln -s /usr/local/PS/image/ST80-LV2.sources  .
ln -s /usr/local/PS/bin/st                  .
cp    /usr/local/PS/image/ST80-LV2.changes  .
chmod +w ST80-LV2.changes
--------------- CUT HERE ----------------------



file '/usr/local/PS/bin/st'
--------------- CUT HERE ----------------------
#! /bin/csh -f
if(  foo$1 == foo  )then
    set Image = ST80-LV2
    cp /usr/local/PS/image/ST80-LV2.changes .
else
    set Image = $1
endif
sun2
if( $status == 0 )then
    echo "(Unix  machine: SUN-TWO  image: $Image) runSmalltalk"
    /usr/local/PS/PS/PS.Sun2 $Image.PS4
else
    echo "(Unix  machine: SUN-THREE  image: $Image) runSmalltalk"
    /usr/local/PS/PS/PS.Sun3 $Image.PS4
endif
--------------- CUT HERE ----------------------


You (and your users) can now prepare to and actually run Smalltalk
easily, as for example the following:

% mkdir mysmalltalk
% cd mysmalltalk
% /usr/local/PS/bin/setup
% st


Discussion:
-----------

The intention of 'setup' is to make the installing of essential files
as painless and foolproof as possible.  After 'setup' is run, the
user merely has to be in his smalltalk directory and type 'st' to
run Smalltalk.  You might be tempted, by the way, to use hard rather
than soft links, or to use ~user rather than rooted file names.
Avoid these temptations.  The reasons for this have nothing to do
with Smalltalk, but with the "features" of SMI's network file system.

Also, 'setup' should definitely LINK the files and not COPY them.
Besides saving disk space, you as an administrator gain the ability
to change the scripts later on.  This has already been valuable to
us once when the Smalltalk directory had to be moved.

The intention of 'st' is, of course, to run Smalltalk.  The
particular 'st' given facilitates this in three ways:

(1) If no image file is named 'st' uses a default.  (You might note
also that in this case the '.changes' file is copied from the
original.  The reason for this is so that naive users don't have
'.changes' files which grow infinitely, which left to themselves they
will.  This will be discussed more in the next memo, where the
various files are described.)

(2) The extension .PS4 need not (must not) be typed by the user.
This may seem trivial, but it means the image name is the same as
the one typed when 'saving' an image in Smalltalk.  (I hate having
confused users.)

(3) 'st' does checking to see which machine it is on (sun-2 or
sun-3) and runs the particular interpreter appropriate for that
machine.  (The alternative is to have two scripts 'st2' and 'st3',
which we tried for a while.  You might want to make those scripts
available as well.)


Editorial
---------

You may wonder about the mysterious 'echo's in the 'st' script.
This is a kind of joke on the operating system, giving the command
to run Smalltalk in a Smalltalk-like syntax.  If it bothers you,
take it out;  I kinda like it myself.

More seriously, you might consider having 'setup' do more work.  One
obvious extension is to link a pointer to the 'goodies' directory in
along with all the other links.  Another is to add a link to a
common directory which is group writeable, to encourage sharing of
goodies in your local Smalltalk community.  Go ahead and add these
if you see fit, but don't worry about what decisions to make (or not
make) now;  remember that such things can all be changed after the
fact, by modifying 'st' to execute a new 'setup' (one side effect of
which will be to change the 'st' so that the new 'setup' gets
executed only once).  Clear?

Again, the 'st' script which runs Smalltalk is changeable by you
after the fact (and the changes will be felt everywhere instantly).
This will be useful when you prepare new "standard images" for your
local Smalltalk community.  They then can run the new image, complete
with bug fixes and enhancements, without doing anything special.  


(End of Note # 1)
Smalltalk Notes 2: Read-only files fix
#365
Author: Tim Rentsch
Date: Tue, 04 Nov 1986 05:42
123 lines
5142 bytes
Copyright(c) 1986, by Tim Rentsch

Copyright Notice:  This memo is Copyright(c) 1986, by Tim Rentsch.
Copies may be made and distributed provided all of the following
conditions are met:  one, the copyright notice be included in its
entirety; two, the memo be copied (or distributed) in its entirety;
three, the memo be copied (or distributed) individually, i.e., not in
collection with other material; four, copies be made and distributed
one at a time, i.e., copies cannot be made or distributed in batches
of more than one; five, copies may not be sold -- distributing copies
is to be done at no cost to the recipients of the copies.  (End of
conditions, and end of copyright notice.)  



Note # 2:  Read-Only Files
==========================

By now you have probably run smalltalk, and you may have noticed a
glaring deficiency.  Our version of PS had the property that it did
not correctly handle files which were read-only.  As near as I can
figure out this is due to a bug in the file opening primitive (I
don't have PS interpreter source code so who can say?).  While I
don't have a fix to the interpreter, I do have a work around.  The
filed out code follows.

(For those interested, the problem is that files when being opened
all have the "create if non-existant" mode bit turned on.  For some
reason trying to open read-only files using the smalltalk system call
primitive with this bit turned on fails.  The work around is to not
turn on the "create if non-existant" bit for files that already
exist.)  

You could try to read this in using a "file list";  if you do, don't
forget to choose "swap cr-lfs", as PS is confused about what a new
line is.  Rather than filing the code in, you could just put the
fixes in by hand, using the browser.  The main change is in 

   UnixFileStream | reopen

with one ancillary added method

  UnixFileStream class | createIfNonExistantMode

Of course if you are typing the code in by hand you could just put
the constant "in-line" as it were.  (Don't forget to use the
left-shift key when selecting methods if your '.sources' file is
read-only.)  

[Hopeful note -- we also have code which makes files understand
about unix new lines (and it produced this code here).  A future
note will contain this as a goodie.]

Note that the following has had tabs turned into 3 spaces to
accomodate the N x 80 format, as well as various other formatting
crocks.  Life is hard.  

The code follows after the ....

(End of Note # 2)


--------------------------------CUT HERE--------------------------------
'From UNC Smalltalk-80, version 2.1A, of November 1, 1986 on 3 November
 1986 at 11:33:33 pm'!



!UnixFileStream methodsFor: 'file status'!

reopen
   "Set the receiver to stream over an open file, setting the
   position to the preveous position."

   "fixed to work around file creation mode bit bug in system call primitives.
      october 11, 1986  -txr"

   | name fileExists canRead canWrite unixMode |
   collection == nil ifFalse: [^nil].
   name _ self fullName.
   fileExists _ UnixFileDirectory includesKey: name.
   canRead _ UnixFileDirectory canReadFile: name.
   canWrite _ UnixFileDirectory canWriteFile: name.
   canRead
      ifTrue:
         [canWrite
            ifTrue:
               [openMode _ #readWrite.
               unixMode _ self class readWriteMode]
            ifFalse:
               [openMode _ #readOnly.
               unixMode _ self class readOnlyMode]]
      ifFalse:
         [canWrite
            ifTrue:
               [openMode _ #writeOnly.
               unixMode _ self class writeOnlyMode]
            ifFalse:
               [^self error: name ,
                  ': permission denied, file can not be opened.']].
   fileExists ifTrue: [ unixMode _ unixMode bitAnd:
                          self class createIfNonExistantMode bitInvert ].
   collection _ (UnixSystemCall open: name for: unixMode mode: 8r644) value.

   openMode = #readOnly
      ifTrue:
         [readMode _ #readOnly].
   openMode = #writeOnly
      ifTrue:
         [(#(writeOnly writeShorten) includes: readMode)
            ifFalse:
               [readMode _ #writeOnly]].

   aFileBuffer _ UnixFileBuffer openForFileDescriptor: collection.
   FileDirectory addExternalReference: self! !


!UnixFileStream class methodsFor: 'read mode constants'!

createIfNonExistantMode
   "Answer the value for creating non-existant files on open mode."

   ^8r1000! !
Smalltalk Notes 3: Producing a "Release" Image
#366
Author: Tim Rentsch
Date: Tue, 04 Nov 1986 06:26
94 lines
4496 bytes
Copyright(c) 1986, by Tim Rentsch

Copyright Notice:  This memo is Copyright(c) 1986, by Tim Rentsch.
Copies may be made and distributed provided all of the following
conditions are met:  one, the copyright notice be included in its
entirety; two, the memo be copied (or distributed) in its entirety;
three, the memo be copied (or distributed) individually, i.e., not in
collection with other material; four, copies be made and distributed
one at a time, i.e., copies cannot be made or distributed in batches
of more than one; five, copies may not be sold -- distributing copies
is to be done at no cost to the recipients of the copies.  (End of
conditions, and end of copyright notice.)  



Note # 3:  Preparing a 'Release' Image and Sources File
=======================================================

This is just a quick note, and some code to allow you to prepare a
"release" image complete with its own '.sources' file.  PS as
distributed (to us anyway) had a fairly long '.changes' file, and
some other things which made me think that a new image with a "clean
slate", so to speak, would be a good idea.  I came up with the
method enclosed, to do just that;  we use it now for preparing our
internal releases of new "standard images".

(For those of you with BS, this code was originally written for BS,
but had to be modified to run on PS.  I have installed from memory
the single extra line of code which we used when running BS, as a
comment.  This line may be wrong, and may not even be necessary.
But, what the heck, it's close, and the price is right.)

A word to the cognescenti:  the code given here does *not* clone an
image or use the system tracer.  (I have heard that there are
problems with this approach for some interpreters, but that is
another matter.)  Be that as it may, this is the code we use.  If
someone experiments with cloning images and comes up with another
method using the system tracer, please post it.  We are interested,
and I am sure others are as well.

The code given here is mildly entertaining to watch, for a while,
but it runs a long time (about one and a half hours on a sun2
running PS).  After it is done, you have a new image, '.sources'
file, and a tiny new '.changes' file.

Note that after it is done, you probably want to save the image
again, using the save command.  The reasons for doing this are: (1)
to clean up the display of the saved image (do this before using the
'save' command), and (2) otherwise the tail of this method will run
everytime the new image is started up.  I guess the best thing to do
would be to try running the new image as is a few times, and if you
don't like it, just use 'save' to produce the release image.

Running the code can be done, e.g., by using the comment contained
in the method given.

As usual, code follows the ....

(End of Note # 3)

--------------------------------CUT HERE--------------------------------
'From UNC Smalltalk-80, version 2.1, of October 26, 1986
 on 31 October 1986 at 3:13:27 pm'!

!SystemDictionary methodsFor: 'system backup/out'!

saveVersion: name
	"Save the whole shebang as name.im, name.sources, name.changes.
		This takes a long time, so be warned.  
		January 11, 1986,  by Tim Rentsch"

	"Smalltalk saveVersion: 'unc2-1'."

	| beginning end |
	beginning _ Date dateAndTimeNow.
	Transcript
		clear;
		show: 'Preparing new release version ', name;
		cr.
	self
		forgetDoIts;
		newSourceFile: name  without: (Array new);
		noChanges "; reorganize".   "BS code is in comment"
	Transcript clear.
	self  snapshotAs: name  thenQuit: false.
	end _ Date dateAndTimeNow.
	Transcript clear;
		show: 'Started at ',
			(beginning at: 1) printString, ' ',
			(beginning at: 2) printString;
		cr;
		show: 'Ended at ',
			(end at: 1) printString, ' ',
			(end at: 2) printString; cr.! !
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads