Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Source for RT-11 TECO V36
@ 2011-06-10 13:09 Jerome H. Fine
  2011-06-11  8:00 ` Johnny Billquist
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Jerome H. Fine @ 2011-06-10 13:09 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]

I have used TECO on and off for 30 years (mostly
off for the past 15 years).  The latest version that I
can find which was released for RT-11 is TECO
V36.  This version was released with V04.00 of
RT-11 in 1980.  The TECO command "EO="
confirms that the version is V36.

About a year ago, I found some source code for
TECO V36 which assembles to V36 when asked
via "EO=", but the TECO.SAV file is significantly
different from the version released with V04.00 of
RT-11 in 1980.  The version based on the source
code that I found is 51 blocks long and it uses more
memory.  The version from RT-11 V04.00 is just
50 blocks long and has a much smaller root section.
Probably most of the code is the same, just that
some of the code that is in the root of the version
for which I have the source has been moved to an
overlay.

Does anyone have or know where I might find the
actual source code for TECO V36 that was released
with V04.00 of RT-11 in 1980?  If it is just almost
identical, that would be sufficient since it is usually
possible to easily make a few modifications to obtain
the identical TECO.SAV when the differences are
minor.  Often, the differences seem major since they
can be the result of a single extra word (plus or minus)
which shifts the rest of the code and makes an exact
comparison impossible.  But those changes are easy
to find and correct if the knowledge and experience
of what to do is available.

Since the TECO V36 released with V04.00 of RT-11
is now 31 years old and I have not heard of any bugs,
I have much more confidence in its reliability as opposed
to the version for which I have the source code.

Jerome Fine

[-- Attachment #2: Type: text/html, Size: 2287 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-10 13:09 Source for RT-11 TECO V36 Jerome H. Fine
@ 2011-06-11  8:00 ` Johnny Billquist
  2011-06-11 10:20 ` glen herrmannsfeldt
  2011-06-12  2:11 ` billy
  2 siblings, 0 replies; 17+ messages in thread
From: Johnny Billquist @ 2011-06-11  8:00 UTC (permalink / raw)


On 2011-06-10 15.09, Jerome H. Fine wrote:
> I have used TECO on and off for 30 years (mostly
> off for the past 15 years). The latest version that I
> can find which was released for RT-11 is TECO
> V36. This version was released with V04.00 of
> RT-11 in 1980. The TECO command "EO="
> confirms that the version is V36.
>
> About a year ago, I found some source code for
> TECO V36 which assembles to V36 when asked
> via "EO=", but the TECO.SAV file is significantly
> different from the version released with V04.00 of
> RT-11 in 1980. The version based on the source
> code that I found is 51 blocks long and it uses more
> memory. The version from RT-11 V04.00 is just
> 50 blocks long and has a much smaller root section.
> Probably most of the code is the same, just that
> some of the code that is in the root of the version
> for which I have the source has been moved to an
> overlay.
>
> Does anyone have or know where I might find the
> actual source code for TECO V36 that was released
> with V04.00 of RT-11 in 1980? If it is just almost
> identical, that would be sufficient since it is usually
> possible to easily make a few modifications to obtain
> the identical TECO.SAV when the differences are
> minor. Often, the differences seem major since they
> can be the result of a single extra word (plus or minus)
> which shifts the rest of the code and makes an exact
> comparison impossible. But those changes are easy
> to find and correct if the knowledge and experience
> of what to do is available.
>
> Since the TECO V36 released with V04.00 of RT-11
> is now 31 years old and I have not heard of any bugs,
> I have much more confidence in its reliability as opposed
> to the version for which I have the source code.

If it reports itself as V36 then I would expect it to be V36, and be 
identical to another compiled executable saying that it is V36.

Btw, I have the sources for V40 as well. They should compile for RT-11 
too, I would think. But I have not tried. I found them for RSTS/E, and 
fixed it up for using in RSX.

	Johnny



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-10 13:09 Source for RT-11 TECO V36 Jerome H. Fine
  2011-06-11  8:00 ` Johnny Billquist
@ 2011-06-11 10:20 ` glen herrmannsfeldt
  2011-06-12 10:54   ` John Wallace
  2011-06-12  2:11 ` billy
  2 siblings, 1 reply; 17+ messages in thread
From: glen herrmannsfeldt @ 2011-06-11 10:20 UTC (permalink / raw)


In vmsnet.pdp-11 Jerome H. Fine <everyone@nospam.com> wrote:
> [-- text/plain, encoding 7bit, charset: us-ascii, 40 lines --]
 
(snip)
> About a year ago, I found some source code for
> TECO V36 which assembles to V36 when asked
> via "EO=", but the TECO.SAV file is significantly
> different from the version released with V04.00 of
> RT-11 in 1980.  The version based on the source
> code that I found is 51 blocks long and it uses more
> memory.  The version from RT-11 V04.00 is just
> 50 blocks long and has a much smaller root section.
> Probably most of the code is the same, just that
> some of the code that is in the root of the version
> for which I have the source has been moved to an
> overlay.

I haven't thought about this for a while, but for an
overlay isn't the source the same, but changes to the
LINK command change the overlay, and so the SAV file?

Or by source do you also mean the LINK command needed?

-- glen


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-10 13:09 Source for RT-11 TECO V36 Jerome H. Fine
  2011-06-11  8:00 ` Johnny Billquist
  2011-06-11 10:20 ` glen herrmannsfeldt
@ 2011-06-12  2:11 ` billy
  2011-06-13  2:06   ` Jerome H. Fine
  2 siblings, 1 reply; 17+ messages in thread
From: billy @ 2011-06-12  2:11 UTC (permalink / raw)


In vmsnet.pdp-11 Jerome H. Fine <everyone@nospam.com> wrote:

> About a year ago, I found some source code for
> TECO V36 which assembles to V36 when asked
> via "EO=", but the TECO.SAV file is significantly
> different from the version released with V04.00 of
> RT-11 in 1980.

The obvious question is are you building it with
RT-11 V4.0, or something else?

Billy Y..
-- 
        sub     #'9+1   ,r0             ; convert ascii byte
	add     #9.+1   ,r0             ; to an integer
	bcc     20$                     ; not a number


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-11 10:20 ` glen herrmannsfeldt
@ 2011-06-12 10:54   ` John Wallace
  2011-06-12 14:46     ` Johnny Billquist
  2011-06-13  2:07     ` Jerome H. Fine
  0 siblings, 2 replies; 17+ messages in thread
From: John Wallace @ 2011-06-12 10:54 UTC (permalink / raw)


On Jun 11, 11:20 am, glen herrmannsfeldt <g...@ugcs.caltech.edu>
wrote:
> In vmsnet.pdp-11 Jerome H. Fine <every...@nospam.com> wrote:
>
> > [-- text/plain, encoding 7bit, charset: us-ascii, 40 lines --]
>
> (snip)
>
> > About a year ago, I found some source code for
> > TECO V36 which assembles to V36 when asked
> > via "EO=", but the TECO.SAV file is significantly
> > different from the version released with V04.00 of
> > RT-11 in 1980.  The version based on the source
> > code that I found is 51 blocks long and it uses more
> > memory.  The version from RT-11 V04.00 is just
> > 50 blocks long and has a much smaller root section.
> > Probably most of the code is the same, just that
> > some of the code that is in the root of the version
> > for which I have the source has been moved to an
> > overlay.
>
> I haven't thought about this for a while, but for an
> overlay isn't the source the same, but changes to the
> LINK command change the overlay, and so the SAV file?
>
> Or by source do you also mean the LINK command needed?
>
> -- glen

Sounds plausible to me.

In principle a suitable comparison tool comparing the two executables
could show up areas of common content (blocks of common code/data?) as
well as areas where the files are different. Afaik the standard DEC
file comparison tools aren't usable this way, because they like to
compare lines of text not binary files such as executables. Same for
the standard UNIX file comparison tools.

That doesn't mean there isn't a binary file comparison tool that uses
something like the well documented "longest common subsequence"
algorithm on words (or even bytes) though. In fact for reasons I won't
go into here I had to write something along those lines to compare
text files while ignoring line boundaries - I don't own the code, my
employer does, so I couldn't post it here even if it was directly
relevant, but the comparison core wasn't that difficult, someone with
sufficient motivation and expertise (and time) could do something
similar.

Interesting challenge.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-12 10:54   ` John Wallace
@ 2011-06-12 14:46     ` Johnny Billquist
  2011-06-12 22:24       ` John Wallace
  2011-06-13  2:08       ` Jerome H. Fine
  2011-06-13  2:07     ` Jerome H. Fine
  1 sibling, 2 replies; 17+ messages in thread
From: Johnny Billquist @ 2011-06-12 14:46 UTC (permalink / raw)


On 2011-06-12 12.54, John Wallace wrote:
> On Jun 11, 11:20 am, glen herrmannsfeldt<g...@ugcs.caltech.edu>
> wrote:
>> In vmsnet.pdp-11 Jerome H. Fine<every...@nospam.com>  wrote:
>>
>>> [-- text/plain, encoding 7bit, charset: us-ascii, 40 lines --]
>>
>> (snip)
>>
>>> About a year ago, I found some source code for
>>> TECO V36 which assembles to V36 when asked
>>> via "EO=", but the TECO.SAV file is significantly
>>> different from the version released with V04.00 of
>>> RT-11 in 1980.  The version based on the source
>>> code that I found is 51 blocks long and it uses more
>>> memory.  The version from RT-11 V04.00 is just
>>> 50 blocks long and has a much smaller root section.
>>> Probably most of the code is the same, just that
>>> some of the code that is in the root of the version
>>> for which I have the source has been moved to an
>>> overlay.
>>
>> I haven't thought about this for a while, but for an
>> overlay isn't the source the same, but changes to the
>> LINK command change the overlay, and so the SAV file?
>>
>> Or by source do you also mean the LINK command needed?
>>
>> -- glen
>
> Sounds plausible to me.
>
> In principle a suitable comparison tool comparing the two executables
> could show up areas of common content (blocks of common code/data?) as
> well as areas where the files are different. Afaik the standard DEC
> file comparison tools aren't usable this way, because they like to
> compare lines of text not binary files such as executables. Same for
> the standard UNIX file comparison tools.
>
> That doesn't mean there isn't a binary file comparison tool that uses
> something like the well documented "longest common subsequence"
> algorithm on words (or even bytes) though. In fact for reasons I won't
> go into here I had to write something along those lines to compare
> text files while ignoring line boundaries - I don't own the code, my
> employer does, so I couldn't post it here even if it was directly
> relevant, but the comparison core wasn't that difficult, someone with
> sufficient motivation and expertise (and time) could do something
> similar.
>
> Interesting challenge.

Another potential problem is that the same source might yield different 
executables because they are linked with system libraries, and those 
libraries might have changed.

Comparing binary files is difficult because of the fact that binary 
files might be so many different things. For an executable for example, 
it might make more sense to report differences as related to load 
locations, and not file locations. But that requires understanding both 
the binary load format, and also understand overlay structures. And what 
if a difference is merely that the data is the same, but loaded at a 
slightly different address? That would mean all data are different, if 
you just look at the address, but in fact it's all the same except for 
the location.

And you can easily come of with a whole number of different 
problems/schemes/issues with other binary files. So there is no general 
meaningful binary file comparison. You need one tool for each type of 
file and type of comparison you want to do.
Text file comparison is actually just another special case of binary 
file comparison, for one specific type of binary files, and one specific 
type of comparisons.

	Johnny



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-12 14:46     ` Johnny Billquist
@ 2011-06-12 22:24       ` John Wallace
  2011-06-12 23:04         ` Johnny Billquist
  2011-06-13  2:46         ` Jerome H. Fine
  2011-06-13  2:08       ` Jerome H. Fine
  1 sibling, 2 replies; 17+ messages in thread
From: John Wallace @ 2011-06-12 22:24 UTC (permalink / raw)


On Jun 12, 3:46 pm, Johnny Billquist <b...@softjar.se> wrote:
> On 2011-06-12 12.54, John Wallace wrote:
>
>
>
> > On Jun 11, 11:20 am, glen herrmannsfeldt<g...@ugcs.caltech.edu>
> > wrote:
> >> In vmsnet.pdp-11 Jerome H. Fine<every...@nospam.com>  wrote:
>
> >>> [-- text/plain, encoding 7bit, charset: us-ascii, 40 lines --]
>
> >> (snip)
>
> >>> About a year ago, I found some source code for
> >>> TECO V36 which assembles to V36 when asked
> >>> via "EO=", but the TECO.SAV file is significantly
> >>> different from the version released with V04.00 of
> >>> RT-11 in 1980.  The version based on the source
> >>> code that I found is 51 blocks long and it uses more
> >>> memory.  The version from RT-11 V04.00 is just
> >>> 50 blocks long and has a much smaller root section.
> >>> Probably most of the code is the same, just that
> >>> some of the code that is in the root of the version
> >>> for which I have the source has been moved to an
> >>> overlay.
>
> >> I haven't thought about this for a while, but for an
> >> overlay isn't the source the same, but changes to the
> >> LINK command change the overlay, and so the SAV file?
>
> >> Or by source do you also mean the LINK command needed?
>
> >> -- glen
>
> > Sounds plausible to me.
>
> > In principle a suitable comparison tool comparing the two executables
> > could show up areas of common content (blocks of common code/data?) as
> > well as areas where the files are different. Afaik the standard DEC
> > file comparison tools aren't usable this way, because they like to
> > compare lines of text not binary files such as executables. Same for
> > the standard UNIX file comparison tools.
>
> > That doesn't mean there isn't a binary file comparison tool that uses
> > something like the well documented "longest common subsequence"
> > algorithm on words (or even bytes) though. In fact for reasons I won't
> > go into here I had to write something along those lines to compare
> > text files while ignoring line boundaries - I don't own the code, my
> > employer does, so I couldn't post it here even if it was directly
> > relevant, but the comparison core wasn't that difficult, someone with
> > sufficient motivation and expertise (and time) could do something
> > similar.
>
> > Interesting challenge.
>
> Another potential problem is that the same source might yield different
> executables because they are linked with system libraries, and those
> libraries might have changed.
>
> Comparing binary files is difficult because of the fact that binary
> files might be so many different things. For an executable for example,
> it might make more sense to report differences as related to load
> locations, and not file locations. But that requires understanding both
> the binary load format, and also understand overlay structures. And what
> if a difference is merely that the data is the same, but loaded at a
> slightly different address? That would mean all data are different, if
> you just look at the address, but in fact it's all the same except for
> the location.
>
> And you can easily come of with a whole number of different
> problems/schemes/issues with other binary files. So there is no general
> meaningful binary file comparison. You need one tool for each type of
> file and type of comparison you want to do.
> Text file comparison is actually just another special case of binary
> file comparison, for one specific type of binary files, and one specific
> type of comparisons.
>
>         Johnny

Quite possibly true in general, but when considering the particular
case of RT11 executables, as we were here, I believe matters are a bit
simpler than the general case. My recollection of RT11 executables
(not that I've checked recently, though it is documented) is that the
format is *very* very simple, which makes the comparison simpler and
potentially more meaningful. My recollection says there is an image
code/data area and a relocation bitmap and not a great deal else; I
may well have the detail wrong, but the general principle of "it's
very simple" applied to much of RT11. And what is an overlay but some
subroutines and some IO?

Whether it's worth writing such a comparison tool is a different
question, especially when you add the possibility of disassembling the
RT11 executable using one of the various disassemblers on DECUS tapes
and the like. Disassessembling overlay calls might be "interesting".

[Background: I have spent far too much time at work writing and
understanding assemblers and linkers and object and executable related
things; not for PDP11 as target, but sometimes using PDP11 or VMS as
host, and/or PDP11 or VMS file formats].


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-12 22:24       ` John Wallace
@ 2011-06-12 23:04         ` Johnny Billquist
  2011-06-13  3:01           ` Jerome H. Fine
  2011-06-13  2:46         ` Jerome H. Fine
  1 sibling, 1 reply; 17+ messages in thread
From: Johnny Billquist @ 2011-06-12 23:04 UTC (permalink / raw)


On 2011-06-13 00.24, John Wallace wrote:
> On Jun 12, 3:46 pm, Johnny Billquist<b...@softjar.se>  wrote:
>> On 2011-06-12 12.54, John Wallace wrote:
>>
>>
>>
>>> On Jun 11, 11:20 am, glen herrmannsfeldt<g...@ugcs.caltech.edu>
>>> wrote:
>>>> In vmsnet.pdp-11 Jerome H. Fine<every...@nospam.com>    wrote:
>>
>>>>> [-- text/plain, encoding 7bit, charset: us-ascii, 40 lines --]
>>
>>>> (snip)
>>
>>>>> About a year ago, I found some source code for
>>>>> TECO V36 which assembles to V36 when asked
>>>>> via "EO=", but the TECO.SAV file is significantly
>>>>> different from the version released with V04.00 of
>>>>> RT-11 in 1980.  The version based on the source
>>>>> code that I found is 51 blocks long and it uses more
>>>>> memory.  The version from RT-11 V04.00 is just
>>>>> 50 blocks long and has a much smaller root section.
>>>>> Probably most of the code is the same, just that
>>>>> some of the code that is in the root of the version
>>>>> for which I have the source has been moved to an
>>>>> overlay.
>>
>>>> I haven't thought about this for a while, but for an
>>>> overlay isn't the source the same, but changes to the
>>>> LINK command change the overlay, and so the SAV file?
>>
>>>> Or by source do you also mean the LINK command needed?
>>
>>>> -- glen
>>
>>> Sounds plausible to me.
>>
>>> In principle a suitable comparison tool comparing the two executables
>>> could show up areas of common content (blocks of common code/data?) as
>>> well as areas where the files are different. Afaik the standard DEC
>>> file comparison tools aren't usable this way, because they like to
>>> compare lines of text not binary files such as executables. Same for
>>> the standard UNIX file comparison tools.
>>
>>> That doesn't mean there isn't a binary file comparison tool that uses
>>> something like the well documented "longest common subsequence"
>>> algorithm on words (or even bytes) though. In fact for reasons I won't
>>> go into here I had to write something along those lines to compare
>>> text files while ignoring line boundaries - I don't own the code, my
>>> employer does, so I couldn't post it here even if it was directly
>>> relevant, but the comparison core wasn't that difficult, someone with
>>> sufficient motivation and expertise (and time) could do something
>>> similar.
>>
>>> Interesting challenge.
>>
>> Another potential problem is that the same source might yield different
>> executables because they are linked with system libraries, and those
>> libraries might have changed.
>>
>> Comparing binary files is difficult because of the fact that binary
>> files might be so many different things. For an executable for example,
>> it might make more sense to report differences as related to load
>> locations, and not file locations. But that requires understanding both
>> the binary load format, and also understand overlay structures. And what
>> if a difference is merely that the data is the same, but loaded at a
>> slightly different address? That would mean all data are different, if
>> you just look at the address, but in fact it's all the same except for
>> the location.
>>
>> And you can easily come of with a whole number of different
>> problems/schemes/issues with other binary files. So there is no general
>> meaningful binary file comparison. You need one tool for each type of
>> file and type of comparison you want to do.
>> Text file comparison is actually just another special case of binary
>> file comparison, for one specific type of binary files, and one specific
>> type of comparisons.
>>
>>          Johnny
>
> Quite possibly true in general, but when considering the particular
> case of RT11 executables, as we were here, I believe matters are a bit
> simpler than the general case. My recollection of RT11 executables
> (not that I've checked recently, though it is documented) is that the
> format is *very* very simple, which makes the comparison simpler and
> potentially more meaningful. My recollection says there is an image
> code/data area and a relocation bitmap and not a great deal else; I
> may well have the detail wrong, but the general principle of "it's
> very simple" applied to much of RT11. And what is an overlay but some
> subroutines and some IO?
>
> Whether it's worth writing such a comparison tool is a different
> question, especially when you add the possibility of disassembling the
> RT11 executable using one of the various disassemblers on DECUS tapes
> and the like. Disassessembling overlay calls might be "interesting".
>
> [Background: I have spent far too much time at work writing and
> understanding assemblers and linkers and object and executable related
> things; not for PDP11 as target, but sometimes using PDP11 or VMS as
> host, and/or PDP11 or VMS file formats].

Well, the same source, compiled with different overlay structures - is 
that the same image? After all, all the binary executable as well as 
data, is the same, but loaded in different places, and with calls to the 
overlay loader sprinkled differently...

I don't know how overlaid binaries looks on RT-11, but I bet there must 
be some kind of information in the binary header telling which parts to 
load at image activation, and which ones that should be untouched at 
that point. And the overlay loader must have a mapping table to help it 
read the proper parts from disk at a later point, and know where to 
write those parts to in memory.
While the latter part can be placed in the image itself, the original 
loading must exclude (possibly a large) part of the file from actually 
loading at activation.

	Johnny



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-12  2:11 ` billy
@ 2011-06-13  2:06   ` Jerome H. Fine
  2011-06-14  0:09     ` billy
  0 siblings, 1 reply; 17+ messages in thread
From: Jerome H. Fine @ 2011-06-13  2:06 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 2438 bytes --]

 >billy@MIX.COM wrote:

>>In vmsnet.pdp-11 Jerome H. Fine <everyone@nospam.com> wrote:
>
>>About a year ago, I found some source code for
>>TECO V36 which assembles to V36 when asked
>>via "EO=", but the TECO.SAV file is significantly
>>different from the version released with V04.00 of
>>RT-11 in 1980.
>>
>The obvious question is are you building it with
>RT-11 V4.0, or something else?
>
>Billy Y..
>
I assume that you are suggesting that the overlay
code for low memory overlays is the possible
cause.  Yes, it has changed a bit as well as the
length (by one word).

However, that is definitely NOT the problem.
First, I have a version of "ohandl.mac" which
produces the old code, so the overlay handler
portion of the code is the same as before.

Second, the root segments are different by 12 words::
(a)  TECO.SAV from V04.00 is smaller
(b)  TECO.SAV from the source code is larger but
      overlay segments 1 and 2 are smaller (by one
       word each) although overlay segment 4 is 73
       words longer.

Overlay segments 3, 5 and 6 are identical in size.

What is also apparent is that there are the same number
of entry points into each overlay segment:
(a)  7 entries for overlay segment 1
(b)  1 each for the other 5 overlay segments.

The above results were identified via a DUMP of each
TECO.SAV which also identified why (a) is 50 blocks
and (b) is 51 blocks.  Since overlay segment 4 required
1019 for (a) which is just 5 words less than 3 blocks
and 1092 words for (b) which is 68 words over 3 blocks,
it was overlay segment 4 which required the extra block.

Overall, there is much less difference between (a) and
(b) than I first assumed.  It may not take nearly as long
as I first estimated to change the source code for (b) to
arrive at the source code needed for (a).  The only
really unusual aspect is that location 50 for (a) is
MUCH larger than (b) or 43??? vs 33???.  Something
interesting is definitely increasing the initial size of
memory required to begin execution of TECO.SAV
in this case.  Also, my initial reaction is that (b) is a
version of TECO.SAV which is somewhat later than
(a) with maybe a bug or two corrected since in my
experience code usually grows rather than contracts.
But that can only be judged after the changes are made.

I am not sure if I have provided enough information for
Billy to be sure that I understand the problems.  If there
are any questions, please ask.

Jerome Fine

[-- Attachment #2: Type: text/html, Size: 3592 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-12 10:54   ` John Wallace
  2011-06-12 14:46     ` Johnny Billquist
@ 2011-06-13  2:07     ` Jerome H. Fine
  1 sibling, 0 replies; 17+ messages in thread
From: Jerome H. Fine @ 2011-06-13  2:07 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 4819 bytes --]

 >John Wallace wrote:

>>On Jun 11, 11:20 am, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
>  
>
>>>In vmsnet.pdp-11 Jerome H. Fine <every...@nospam.com> wrote:
>>
>>>About a year ago, I found some source code for
>>>TECO V36 which assembles to V36 when asked
>>>via "EO=", but the TECO.SAV file is significantly
>>>different from the version released with V04.00 of
>>>RT-11 in 1980.  The version based on the source
>>>code that I found is 51 blocks long and it uses more
>>>memory.  The version from RT-11 V04.00 is just
>>>50 blocks long and has a much smaller root section.
>>>Probably most of the code is the same, just that
>>>some of the code that is in the root of the version
>>>for which I have the source has been moved to an
>>>overlay.
>>>      
>>>
>>I haven't thought about this for a while, but for an
>>overlay isn't the source the same, but changes to the
>>LINK command change the overlay, and so the SAV file?
>>
>>Or by source do you also mean the LINK command needed?
>>
By source code, I mean the MACRO-11 code commented source
files which are first assembled using MACRO.SAV, then linked using
LINK.SAV to produce the TECO.SAV file.

LINK.SAV does have a command file as well which specifies which
OBJ file is used for the root and which overlay segment.  Except for
the OBJ file for OHANDL.OBJ which is used for the overlay code,
it seems very unlikely based on the PSect list that any subroutines
from SYSLIB.OBJ were used.

>Sounds plausible to me.
>
>In principle a suitable comparison tool comparing the two executables
>could show up areas of common content (blocks of common code/data?) as
>well as areas where the files are different. Afaik the standard DEC
>file comparison tools aren't usable this way, because they like to
>compare lines of text not binary files such as executables. Same for
>the standard UNIX file comparison tools.
>
>That doesn't mean there isn't a binary file comparison tool that uses
>something like the well documented "longest common subsequence"
>algorithm on words (or even bytes) though. In fact for reasons I won't
>go into here I had to write something along those lines to compare
>text files while ignoring line boundaries - I don't own the code, my
>employer does, so I couldn't post it here even if it was directly
>relevant, but the comparison core wasn't that difficult, someone with
>sufficient motivation and expertise (and time) could do something
>similar.
>
>Interesting challenge.
>
VERY!!!!!!!!!!!!!!!!!!!!!!!!!!!!

While ASCII text files that have changes made to a small
number of lines can very easily be compared, I suspect that
it would be necessary to disassemble an executable program
to achieve something close to the same result.  Out of interest,
I did this about 10 years ago to a very short program of about
1000 words of code and data.  There were 6 versions for the
program which by then had seen many previous versions and
had become reasonably stable.  I added additional conditional
assembly code which allowed me to use one source file to
produce all six SAV files depending on which version I wanted.
Unfortunately, the original comments were still not available,
so some of the details are not clearly understood.

The key difficulty for RT-11 (and maybe for the other PDP-11
operating systems) is that most of the time the code and the data
are often mixed.  Thus data areas which differ by even one word
will pose an immense problem without a disassembly.  Even with
a disassembly, location labels which are not GLOBALs will no
longer be the same name.

My solution for making changes to the SAV files in RT-11 which
have a small number of changes is to first modify the source code
so that the mismatches in the number of words are eliminated.
This condition is easy to locate since prior to any such mismatch,
only offsets to locations higher than the mismatch appear in
isolated locations.  After the mismatch, almost every word in the
two SAV files differ.  Once the mismatches due to the incorrect
number of words have been fixed, the actual differences in the
code and date can be fixed.  However, this is a very labour
intensive manual procedure and can sometimes take more than
an hour per size mismatch plus additional time at the end to
correct any remaining differences, especially is the code was
written in a high level language.  Consequently, I would undertake
such a project only when it is absolutely required.

I know that I have not really answered your question.  My conclusion
is that such a comparison is reasonable only for ASCII text files
OR executables where a few isolated changes have been made and
the source code is available to be modified, i.e. the source code is
available (or can be provided) for one version and a second close
version also needs the source code.

Jerome Fine

[-- Attachment #2: Type: text/html, Size: 6033 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-12 14:46     ` Johnny Billquist
  2011-06-12 22:24       ` John Wallace
@ 2011-06-13  2:08       ` Jerome H. Fine
  1 sibling, 0 replies; 17+ messages in thread
From: Jerome H. Fine @ 2011-06-13  2:08 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 3280 bytes --]

 >Johnny Billquist wrote:

>> Sounds plausible to me.
>>
>> In principle a suitable comparison tool comparing the two executables
>> could show up areas of common content (blocks of common code/data?) as
>> well as areas where the files are different. Afaik the standard DEC
>> file comparison tools aren't usable this way, because they like to
>> compare lines of text not binary files such as executables. Same for
>> the standard UNIX file comparison tools.
>>
>> That doesn't mean there isn't a binary file comparison tool that uses
>> something like the well documented "longest common subsequence"
>> algorithm on words (or even bytes) though. In fact for reasons I won't
>> go into here I had to write something along those lines to compare
>> text files while ignoring line boundaries - I don't own the code, my
>> employer does, so I couldn't post it here even if it was directly
>> relevant, but the comparison core wasn't that difficult, someone with
>> sufficient motivation and expertise (and time) could do something
>> similar.
>>
>> Interesting challenge.
>
>
> Another potential problem is that the same source might yield 
> different executables because they are linked with system libraries, 
> and those libraries might have changed.

I doubt that this is a problem in this case.  TECO.SAV does
not seem to use any subroutines from the SYSLIB.OBJ file.

> Comparing binary files is difficult because of the fact that binary 
> files might be so many different things. For an executable for 
> example, it might make more sense to report differences as related to 
> load locations, and not file locations. But that requires 
> understanding both the binary load format, and also understand overlay 
> structures. And what if a difference is merely that the data is the 
> same, but loaded at a slightly different address? That would mean all 
> data are different, if you just look at the address, but in fact it's 
> all the same except for the location.

A big problem.

> And you can easily come of with a whole number of different 
> problems/schemes/issues with other binary files. So there is no 
> general meaningful binary file comparison. You need one tool for each 
> type of file and type of comparison you want to do.
> Text file comparison is actually just another special case of binary 
> file comparison, for one specific type of binary files, and one 
> specific type of comparisons.

While binary (or executable) files usually have references
to other locations in the file either as an absolute address
or as a difference (between the current location and the
other location), the most I have ever seen a text file reference
is a label (by name) in another part of the file.  For purposes
of comparison, this would probably never matter.  In addition,
text files are usually compared line by line.  Since the line
delimiter is always (at least in my experience) non-ASCII
text, it is rather simple for a program to isolate each separate
line independently of content and length.  So while a text
file may be a special case, the restrictions on the individual
characters which may be used allow individual lines of text
to be isolated - which can not be done for a binary file which
has no restrictions on the date information.

Jerome Fine

[-- Attachment #2: Type: text/html, Size: 4093 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-12 22:24       ` John Wallace
  2011-06-12 23:04         ` Johnny Billquist
@ 2011-06-13  2:46         ` Jerome H. Fine
  2011-06-14  0:16           ` billy
  1 sibling, 1 reply; 17+ messages in thread
From: Jerome H. Fine @ 2011-06-13  2:46 UTC (permalink / raw)


 >John Wallace wrote:

>Quite possibly true in general, but when considering the particular
>case of RT11 executables, as we were here, I believe matters are a bit
>simpler than the general case. My recollection of RT11 executables
>(not that I've checked recently, though it is documented) is that the
>format is *very* very simple, which makes the comparison simpler and
>potentially more meaningful. My recollection says there is an image
>code/data area and a relocation bitmap and not a great deal else; I
>may well have the detail wrong, but the general principle of "it's
>very simple" applied to much of RT11. And what is an overlay but some
>subroutines and some IO?
>  
>
In my experience, I don't really see that the mixed code and data in
an RT-11 SAV file will be easier to compare than separate
code (an execute ONLY area) and data (read / write ONLY)
areas in a VMS environment.  In fact, it might actually be easier.

>Whether it's worth writing such a comparison tool is a different
>question, especially when you add the possibility of disassembling the
>RT11 executable using one of the various disassemblers on DECUS tapes
>and the like. Disassessembling overlay calls might be "interesting".
>  
>
A disassembly is not trivial, even with an OBJ file
as UnMAC is an example.  The original version in
DECUS could not even UnMac itself.  It took a
reasonable effort to enhance UnMac to do so.
Of course, since the code / data was generated
by FORTRAN, it looked quite different from
MACRO-11 type programs.

As for SAV => MAC files, the only one I have
that handles an odd address .Ascii directive is
the enhanced version that I have for myself.  Even
then, it usually takes a few passes before I sort
out the code and data areas.

As for disassembling overlays, I started on the code,
but never finished it.  Too many other interesting
things to do.

>[Background: I have spent far too much time at work writing and
>understanding assemblers and linkers and object and executable related
>things; not for PDP11 as target, but sometimes using PDP11 or VMS as
>host, and/or PDP11 or VMS file formats].
>
I am still working on RT-11 systems as well.  Recently,
I wanted to reduce the size of low memory that the editor
program uses as a system job under a Mapped Monitor
(RT11XM) which has multi-terminal support.  Normally,
I use 4 DL ports to run 4 system jobs which are the KEX
editor as in:
SRUN  KEX.SAV/LEVEL:n/TERMINAL:n/NAME:Kn

The 801 words needed for each system job was causing
problems when I also used SDX.SYS to debug programs.
I found that as a system job, one of the data structures in
low memory was never needed.  The one time initialization
code in low memory was abandoned as well.  The solution
was to reduce the initial size of the stack, then modify the
stack address after initialization to also include the now
(about to be)  abandoned initialization code.  So I lowered
the base address to 600 and linked the overlay handler
into the addresses between 600 and 1000 ("/B:1000"),
then changed the stack address to 1000 before I called
the only overlay at virtual 20002 (well, the overlay
handler called the overlay.

At that point, the root section was one block less (1 instead
of 2 blocks).  Comparing the two SAV files required making
the comparison starting at block 2 on the original SAV file
and block 1 on the revised SAV file.  Fortunately, I have
a enhanced version of BINCOM which allows:
RUN  DU0:BINCOM
*DU0:FOOBAR.SAV/S:1.,DU0:FOOBAR.OLD/S:2.

There were only about 6 differences which pertained to
the size of the root - which no longer mattered.

So there is another problem when two different binary files
are compared.  If the start of one portion begins at a different
block, the files may compare, but there must be some easy
way of telling the program.  DEC did this for DUP via:
COPY/DEVICE   VM0:/START:25./END:34.  DU0:/START:155.
but not BINCOM.

I often do this when I want to copy a changed file over
the original location.  It requires being extremely careful!!

Jerome Fine

Jerome Fine


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-12 23:04         ` Johnny Billquist
@ 2011-06-13  3:01           ` Jerome H. Fine
  0 siblings, 0 replies; 17+ messages in thread
From: Jerome H. Fine @ 2011-06-13  3:01 UTC (permalink / raw)


 >Johnny Billquist wrote:

> I don't know how overlaid binaries looks on RT-11, but I bet there 
> must be some kind of information in the binary header telling which 
> parts to load at image activation, and which ones that should be 
> untouched at that point. And the overlay loader must have a mapping 
> table to help it read the proper parts from disk at a later point, and 
> know where to write those parts to in memory.
> While the latter part can be placed in the image itself, the original 
> loading must exclude (possibly a large) part of the file from actually 
> loading at activation.

For low memory overlays, RT-11 uses
OHANDL.MAC which has a 3 word data
area for each overlay segment:
(a)  Start Address
(b)  Block Number
(c)  Number of words to READ

Each entry point into an overlay segment
from outside the overlay segment has a
4 word subroutine which calls the overlay
handler:
   CALL OHANDL
   .Word   <segment number>*6
   .Word   overlay handler entry address

RT-11 uses location 360 to specify which
blocks to read into memory at first load,
one bit for each block.

If you have any additional questions, please
ask.

All of the RT-11 manuals are available at
bitsavers.

Jerome Fine


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-13  2:06   ` Jerome H. Fine
@ 2011-06-14  0:09     ` billy
  0 siblings, 0 replies; 17+ messages in thread
From: billy @ 2011-06-14  0:09 UTC (permalink / raw)


In vmsnet.pdp-11 Jerome H. Fine <everyone@nospam.com> wrote,
quoting me:

> This is a multi-part message in MIME format.
> Content-Type: text/html; charset=us-ascii

By the way, html content isn't necessary here...

> >> About a year ago, I found some source code for
> >> TECO V36 which assembles to V36 when asked
> >> via "EO=", but the TECO.SAV file is significantly
> >> different from the version released with V04.00 of
> >> RT-11 in 1980.
> >
> > The obvious question is are you building it with
> > RT-11 V4.0, or something else?
>
> I assume that you are suggesting that the overlay
> code for low memory overlays is the possible cause.

No, I'm suggesting that if you want to test for a bit-
for-bit match, building with the same OS version would
be a good place to start.

As well, booting V4, building your copy of TECO with it,
and then comparing the results seems to me a lot easier
first step than hacking the copy until it matches the
distributed image.

> Also, my initial reaction is that (b) is a version of
> TECO.SAV which is somewhat later than (a) with maybe a
> bug or two corrected

One would hope such stuff is documented in the file...

Billy Y..
-- 
        sub     #'9+1   ,r0             ; convert ascii byte
	add     #9.+1   ,r0             ; to an integer
	bcc     20$                     ; not a number


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-13  2:46         ` Jerome H. Fine
@ 2011-06-14  0:16           ` billy
  2011-06-15  2:49             ` paramucho
  0 siblings, 1 reply; 17+ messages in thread
From: billy @ 2011-06-14  0:16 UTC (permalink / raw)


In vmsnet.pdp-11 Jerome H. Fine <everyone@nospam.com> wrote:

> A disassembly is not trivial, even with an OBJ file
> as UnMAC is an example.  The original version in
> DECUS could not even UnMac itself.

DECODE V3 is reasonably decent.

Billy Y..
-- 
        sub     #'9+1   ,r0             ; convert ascii byte
	add     #9.+1   ,r0             ; to an integer
	bcc     20$                     ; not a number


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-14  0:16           ` billy
@ 2011-06-15  2:49             ` paramucho
  2011-06-15 10:52               ` Jerome H. Fine
  0 siblings, 1 reply; 17+ messages in thread
From: paramucho @ 2011-06-15  2:49 UTC (permalink / raw)


On Tue, 14 Jun 2011 00:16:35 +0000 (UTC), billy@MIX.COM wrote:

>In vmsnet.pdp-11 Jerome H. Fine <everyone@nospam.com> wrote:
>
>> A disassembly is not trivial, even with an OBJ file
>> as UnMAC is an example.  The original version in
>> DECUS could not even UnMac itself.
>
>DECODE V3 is reasonably decent.

It's not bad at all, but a DIFFER/BINARY shows some problems.
The main one I found is that it creates symbols with up to seven
significant characters. For example, the octal literal 177777 is
mapped to the 7-character symbol L177777. Clearly the final "7" is
dropped by the assembler. A solution would be to encode these using
decimal, although that further obsfucates the code.


Ian


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Source for RT-11 TECO V36
  2011-06-15  2:49             ` paramucho
@ 2011-06-15 10:52               ` Jerome H. Fine
  0 siblings, 0 replies; 17+ messages in thread
From: Jerome H. Fine @ 2011-06-15 10:52 UTC (permalink / raw)


 >paramucho wrote:

>>On Tue, 14 Jun 2011 00:16:35 +0000 (UTC), billy@MIX.COM wrote:
>
>>In vmsnet.pdp-11 Jerome H. Fine <everyone@nospam.com> wrote:
>>
>>>A disassembly is not trivial, even with an OBJ file
>>>as UnMAC is an example.  The original version in
>>>DECUS could not even UnMac itself.
>>>      
>>>
>>DECODE V3 is reasonably decent.
>>
>It's not bad at all, but a DIFFER/BINARY shows some problems.
>The main one I found is that it creates symbols with up to seven
>significant characters. For example, the octal literal 177777 is
>mapped to the 7-character symbol L177777. Clearly the final "7" is
>dropped by the assembler. A solution would be to encode these using
>decimal, although that further obsfucates the code.
>
>Ian
>
When I used DECODE, I seem to remember that there was an
additional problem.  If there was an .ASCII reference which
started at an ODD address, it was unable to resolve the location.

I think that I added the ASCII directive which was able to support
ODD addresses.  I think that I also added an additional set of
symbols to use when BIT values were being used with the three
instructions (BIT, BIC, BIS) in order to distinguish those symbols
which started with a "V" used for immediate instructions - obviously
started those symbols with a "B".

To solve the SEVEN character symbol problem when the high
order bit was set, I just incremented the value of the symbol.
That produced SIX sets of symbols:
(a)  L00000 to L77776 and  M00000 to M77776
(b)  V00000 to V77777 and W00000 to W77777
(c)  B00000 to B77777 and C00000 to C77777

If anyone is interested, I will look around for the program.

Jerome Fine


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-06-15 10:52 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10 13:09 Source for RT-11 TECO V36 Jerome H. Fine
2011-06-11  8:00 ` Johnny Billquist
2011-06-11 10:20 ` glen herrmannsfeldt
2011-06-12 10:54   ` John Wallace
2011-06-12 14:46     ` Johnny Billquist
2011-06-12 22:24       ` John Wallace
2011-06-12 23:04         ` Johnny Billquist
2011-06-13  3:01           ` Jerome H. Fine
2011-06-13  2:46         ` Jerome H. Fine
2011-06-14  0:16           ` billy
2011-06-15  2:49             ` paramucho
2011-06-15 10:52               ` Jerome H. Fine
2011-06-13  2:08       ` Jerome H. Fine
2011-06-13  2:07     ` Jerome H. Fine
2011-06-12  2:11 ` billy
2011-06-13  2:06   ` Jerome H. Fine
2011-06-14  0:09     ` billy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox