Am 02/04/2022 06:35 PM, David Schultz schrieb:
On 2/2/22 8:20 PM, Martin wrote:
The odd filesizes were first alarm signals,Looks like a dumb EOF mark (^Z, 0x1A) scrubber was used on binary files.
further examination shows, that every 01AH byte is missing
from the trisoft files.
A smart one would look only in the final record. An even smarter one
would check for binary files first.
It should be possible, if tedious, to undo some of the damage.
Load the binary (this only works if it is executable) using DDT. Then
starting from the beginning, scan the code. Deletion of a byte should
cause significant weirdness in the following code. Insert a 0x1A in what
looks like the appropriate spot. Reload with DDT and repeat.
You would have to be pretty motivated.
And patient.
This was also my first idea.
Thanks for confirming that.
Or Create a simple automatic tool to quickly detect the first illegal position in a binary. Then hand fix it directly or insert a dummy byte
and continue. At the end return to all the unclear points and retry.
The 68k has a word oriented architecture, a shift by one quickly leads
to illegal opcodes. But data areas will require some disassembly.
For plain binary files, this could work.
Is there somewhere a documentation of all the object formats
(standard or not?) used by the compilers?
Success !!!
1a39934a39936
1adiff FORTRAN0.REL.xxd FORTRAN.REL.xxd
1adiff FTNLIB0.OBJ.xxd FTNLIB.OBJ.xxd
1adiff PASLIB0.OBJ.xxd PASLIB.OBJ.xxd
1adiff ULINKER0.REL.xxd ULINKER.REL.xxd
1a13822a13824
1a
AUTOST.SUBDo you really want to init disk M ?
INIT.REL M
a:A: EXAMPLE FOR : F SUB
dir
type f.subc:fortran.rel $1.for
f exampleMC68000 Fortran77 Compiler V2.1 01-Dec-83
C:FORTRAN.REL EXAMPLE.FOR
C:CODE.REL EXAMPLE.IMC68000 Code Generator V2.1 01-Dec-83
C:ULINKER.REL -L EXAMPLE.O EXAMPLE.OBJ C:FTNLIB.OBJ C:PASLIB.OBJMC68000 CPM Object Code Formatter V2.1 01-Dec-83
ERA EXAMPLE.OBJ[...]
C:LO68 -S -O EXAMPLE.68K -T10100 C:S.O EXAMPLE.O C:CLIB
example
c:bbyeCP/M-68K terminating normally
Am 02/06/2022 08:40 PM, Martin schrieb:
Am 02/04/2022 06:35 PM, David Schultz schrieb:
On 2/2/22 8:20 PM, Martin wrote:
The odd filesizes were first alarm signals,Looks like a dumb EOF mark (^Z, 0x1A) scrubber was used on binary files. >>
further examination shows, that every 01AH byte is missing
from the trisoft files.
A smart one would look only in the final record. An even smarter one
would check for binary files first.
It should be possible, if tedious, to undo some of the damage.
Load the binary (this only works if it is executable) using DDT. Then
starting from the beginning, scan the code. Deletion of a byte should
cause significant weirdness in the following code. Insert a 0x1A in what >> looks like the appropriate spot. Reload with DDT and repeat.
You would have to be pretty motivated.
And patient.
This was also my first idea.
Thanks for confirming that.
Or Create a simple automatic tool to quickly detect the first illegal position in a binary. Then hand fix it directly or insert a dummy byte
and continue. At the end return to all the unclear points and retry.
The 68k has a word oriented architecture, a shift by one quickly leads
to illegal opcodes. But data areas will require some disassembly.
For plain binary files, this could work.
Is there somewhere a documentation of all the object formats
(standard or not?) used by the compilers?
I was motivated enough :-)
Success !!!
I realized how easy it would be to fix the corruption.
while studying the CP/M-68K executable format in the hope
to find a quick way to automate the process.
1) Only 01ah bytes were deleted
2) Only the last position in an 128 byte block was affected
Finding the positions was relatively easy by converting every file
into a single byte per line form with "xxd -c1", then using the
byte pattern 4eh as a guide
68000 is big endian, 4e75h is the opcode for "RTS", and
the first byte of it is found often enough in binaries.
If the pattern appeares on an odd address, then a deletion
must have happend on one of the few block boundaries before.
I started with the files in "ERG_68K_Fortran_2p1a" with very
few deletions, and a few hours later ...
I made the following diffs by converting every file with
"xxd -p -c1", the line numbers also are byte offsets.
As noted above, every 1ah is inserted as the last
byte of an 128 byte block.
diff CODE0.REL.xxd CODE.REL.xxd
10879a10880
1a39934a39936
1adiff FORTRAN0.REL.xxd FORTRAN.REL.xxd
57471a57472
1adiff FTNLIB0.OBJ.xxd FTNLIB.OBJ.xxd
47103a47104
1adiff PASLIB0.OBJ.xxd PASLIB.OBJ.xxd
45311a45312
1adiff ULINKER0.REL.xxd ULINKER.REL.xxd
6143a6144
1a13822a13824
1a
Here is a session compiling and running "example.for".
$ ./cpmsim -a transfer.img
Read 32768 bytes from boot track
CP/M-68K(tm) Version 1.2 03/20/84
Copyright (c) 1984 Digital Research, Inc.
CP/M-68K BIOS Version 1.0
Simulated system of April 2014
TPA =16251 K
AUTOST.SUB
INIT.REL MDo you really want to init disk M ?
a:
dirA: EXAMPLE FOR : F SUB
type f.subc:fortran.rel $1.for
c:code.rel $1.i
c:ulinker.rel -l $1.o $1.obj c:ftnlib.obj c:paslib.obj
era $1.obj
c:lo68 -s -o $1.68k -t10100 c:s.o $1.o c:clib
f example
C:FORTRAN.REL EXAMPLE.FORMC68000 Fortran77 Compiler V2.1 01-Dec-83
(C) Copyright 1983 Silicon Valley Software, Inc.
EXAMPL [16522260 bytes]
{16521484 bytes}
0 errors. 25 lines. File example.for
Smallest available space: 16522260 bytes.
C:CODE.REL EXAMPLE.IMC68000 Code Generator V2.1 01-Dec-83
(C) Copyright 1983 Silicon Valley Software, Inc.
EXAMPL - EXAMPL Code size = 570
Total code size = 570
C:ULINKER.REL -L EXAMPLE.O EXAMPLE.OBJ C:FTNLIB.OBJ C:PASLIB.OBJMC68000 CPM Object Code Formatter V2.1 01-Dec-83
(C) Copyright 1983 Silicon Valley Software, Inc.
ERA EXAMPLE.OBJ
C:LO68 -S -O EXAMPLE.68K -T10100 C:S.O EXAMPLE.O C:CLIB
example[...]
*********************************************** ***********************************************
** **
** FORTRAN-77 is correctly installed !! **
** **
*********************************************** ***********************************************
[...]
c:bbyeCP/M-68K terminating normally
Extremely well done! I have tried a few things, but I failed :-/
Is there any way you can share the corrected files?
Or an even more detailed description of how to do the fix; I am not sure I know how to follow your "recipe" to fix the files?
Regards,
MogensB
Am 03/09/2022 07:55 PM, MogensB schrieb:
Extremely well done! I have tried a few things, but I failed :-/
Is there any way you can share the corrected files?
Or an even more detailed description of how to do the fix; I am not sure I know how to follow your "recipe" to fix the files?
Regards,
MogensB
I take CODE.REL, one of the two obviously more complicated files
as an example, and try to describe the procedure.
You need "xxd" to convert the file to/from text format and
the "patch" utility to apply the diff below,
or alternatively, a text editor with "goto line".
Variante A with "xxd" and "patch" or an editor:
1) Convert all files into an ascii byte stream with.
xxd -p -c1 CODE.REL >CODE.REL.xxd
xxd -p -c1 FORTRAN.REL >FORTRAN.REL.xxd
xxd -p -c1 FTNLIB.OBJ >FTNLIB.OBJ.xxd
xxd -p -c1 PASLIB.OBJ >PASLIB.OBJ.xxd
xxd -p -c1 ULINKER.REL >ULINKER.REL.xxd
2a) Apply the following patch "xxd.diff" with
$ patch -p0 <xxd.diff
patching file CODE.REL.xxd
patching file FORTRAN.REL.xxd
patching file FTNLIB.OBJ.xxd
patching file PASLIB.OBJ.xxd
patching file ULINKER.REL.xxd
2b) Edit every file and insert the two bytes
To illustrate it, I describe CODE.REL.xxx in detail.
Edit from bottom to top, so you have not to compensate the
increased line numbers further down caused by your own inserts.
Goto line 39934 and insert the 1a after it:
ff
1a
66
Goto line 10879 and insert the 1a after it:
60
1a
20
3) Convert all files back to binary with.
xxd -r -p -c1 CODE.REL.xxd >CODE.REL.fixed
xxd -r -p -c1 FORTRAN.REL.xxd >FORTRAN.REL.fixed
xxd -r -p -c1 FTNLIB.OBJ.xxd >FTNLIB.OBJ.fixed
xxd -r -p -c1 PASLIB.OBJ.xxd >PASLIB.OBJ.fixed
xxd -r -p -c1 ULINKER.REL.xxd >ULINKER.REL.fixed
Here is the "unified diff", I call it "xxd.diff".
NOTE: There is a "space" at the beginning of the lines
before and after the one beginning with "+".
xxx.diff:
==== 8< ====
--- CODE.REL.xxd
+++ CODE.REL.xxd
@@ -10879,2 +10879,3 @@
60
+1a
20
@@ -39934,2 +39935,3 @@
ff
+1a
66
--- FORTRAN.REL.xxd
+++ FORTRAN.REL.xxd
@@ -57471,2 +57471,3 @@
66
+1a
3f
--- FTNLIB.OBJ.xxd
+++ FTNLIB.OBJ.xxd
@@ -47103,2 +47103,3 @@
00
+1a
48
--- PASLIB.OBJ.xxd
+++ PASLIB.OBJ.xxd
@@ -45311,2 +45311,3 @@
60
+1a
2f
--- ULINKER.REL.xxd
+++ ULINKER.REL.xxd
@@ -6143,2 +6143,3 @@
60
+1a
41
@@ -13822,2 +13823,3 @@
ff
+1a
2a
==== 8< ====
Variante B with an hexeditor:
If nothing works, you can modify the binary files directly
using a binary editor with *insert* capability.
HTH
Martin
C:LO68 -S -O EXAMPLE.68K -T10100 C:S.O EXAMPLE.O C:CLIB: Undefined symbol(s)
onsdag den 9. marts 2022 kl. 23.01.51 UTC+1 skrev Martin:
Am 03/09/2022 07:55 PM, MogensB schrieb:
Extremely well done! I have tried a few things, but I failed :-/
Is there any way you can share the corrected files?
Or an even more detailed description of how to do the fix; I am not sure I know how to follow your "recipe" to fix the files?
Regards,
MogensB
I take CODE.REL, one of the two obviously more complicated files
as an example, and try to describe the procedure.
You need "xxd" to convert the file to/from text format and
the "patch" utility to apply the diff below,
or alternatively, a text editor with "goto line".
Variante A with "xxd" and "patch" or an editor:
1) Convert all files into an ascii byte stream with.
xxd -p -c1 CODE.REL >CODE.REL.xxd
xxd -p -c1 FORTRAN.REL >FORTRAN.REL.xxd
xxd -p -c1 FTNLIB.OBJ >FTNLIB.OBJ.xxd
xxd -p -c1 PASLIB.OBJ >PASLIB.OBJ.xxd
xxd -p -c1 ULINKER.REL >ULINKER.REL.xxd
2a) Apply the following patch "xxd.diff" with
$ patch -p0 <xxd.diff
patching file CODE.REL.xxd
patching file FORTRAN.REL.xxd
patching file FTNLIB.OBJ.xxd
patching file PASLIB.OBJ.xxd
patching file ULINKER.REL.xxd
2b) Edit every file and insert the two bytes
To illustrate it, I describe CODE.REL.xxx in detail.
Edit from bottom to top, so you have not to compensate the
increased line numbers further down caused by your own inserts.
Goto line 39934 and insert the 1a after it:
ff
1a
66
Goto line 10879 and insert the 1a after it:
60
1a
20
3) Convert all files back to binary with.
xxd -r -p -c1 CODE.REL.xxd >CODE.REL.fixed
xxd -r -p -c1 FORTRAN.REL.xxd >FORTRAN.REL.fixed
xxd -r -p -c1 FTNLIB.OBJ.xxd >FTNLIB.OBJ.fixed
xxd -r -p -c1 PASLIB.OBJ.xxd >PASLIB.OBJ.fixed
xxd -r -p -c1 ULINKER.REL.xxd >ULINKER.REL.fixed
Here is the "unified diff", I call it "xxd.diff".
NOTE: There is a "space" at the beginning of the lines
before and after the one beginning with "+".
xxx.diff:
==== 8< ====
--- CODE.REL.xxd
+++ CODE.REL.xxd
@@ -10879,2 +10879,3 @@
60
+1a
20
@@ -39934,2 +39935,3 @@
ff
+1a
66
--- FORTRAN.REL.xxd
+++ FORTRAN.REL.xxd
@@ -57471,2 +57471,3 @@
66
+1a
3f
--- FTNLIB.OBJ.xxd
+++ FTNLIB.OBJ.xxd
@@ -47103,2 +47103,3 @@
00
+1a
48
--- PASLIB.OBJ.xxd
+++ PASLIB.OBJ.xxd
@@ -45311,2 +45311,3 @@
60
+1a
2f
--- ULINKER.REL.xxd
+++ ULINKER.REL.xxd
@@ -6143,2 +6143,3 @@
60
+1a
41
@@ -13822,2 +13823,3 @@
ff
+1a
2a
==== 8< ====
Variante B with an hexeditor:
If nothing works, you can modify the binary files directly
using a binary editor with *insert* capability.
anyway):HTHThank you Martin for the extra help - I appreciate your effort very much!
Martin
I finally got the SVS compiler running on my 68k-MBC system, and I am very happy about that :-D
It produced the EXAMPLE.68K and it runs; I have a small problem yet to solve, but I am not sure if this is the compiler, or something else - I got this message from the linker/loader about __optoff being an undefined symbol (but the executable runs
C:LO68 -S -O EXAMPLE.68K -T10100 C:S.O EXAMPLE.O C:CLIB: Undefined symbol(s)
__optoff
But I guess that is something else to look for - not sure which library is supposed to have the __optoff definition.
Best regards,
MogensB
C:LO68 -S -O EXAMPLE.68K -T10100 C:S.O OPTOFF.O EXAMPLE.O C:CLIB
The FORTRAN-77 compiler is most likely not the cause of this problem.
The problem is somehow related to the C library CLIB, I believe - I found a german magazine from 1986 mentioning a similar problem. The workaround was to extract OPTOFF.O from the CLIB file, and link directly with the OPTOFF.O file:
C:LO68 -S -O EXAMPLE.68K -T10100 C:S.O OPTOFF.O EXAMPLE.O C:CLIB
And this is successful without any undefined symbol errors. Maybe this is a "known bug" for experienced users of the linker LO68 in CP/M-68K? Or the bug may be in the CLIB file?
anyway):Thank you Martin for the extra help - I appreciate your effort very much!
I finally got the SVS compiler running on my 68k-MBC system, and I am very happy about that :-D
It produced the EXAMPLE.68K and it runs; I have a small problem yet to solve, but I am not sure if this is the compiler, or something else - I got this message from the linker/loader about __optoff being an undefined symbol (but the executable runs
C:LO68 -S -O EXAMPLE.68K -T10100 C:S.O EXAMPLE.O C:CLIB: Undefined symbol(s)
__optoff
But I guess that is something else to look for - not sure which library is supposed to have the __optoff definition.
Best regards,
MogensB
The FORTRAN-77 compiler is most likely not the cause of this problem.
The problem is somehow related to the C library CLIB, I believe - I found a german magazine from 1986 mentioning a similar problem. The workaround was to extract OPTOFF.O from the CLIB file, and link directly with the OPTOFF..O file:
C:LO68 -S -O EXAMPLE.68K -T10100 C:S.O OPTOFF.O EXAMPLE.O C:CLIB
And this is successful without any undefined symbol errors. Maybe this is a "known bug" for experienced users of the linker LO68 in CP/M-68K? Or the bug may be in the CLIB file?
The article I am referring to is available on https://www.ndr-nkc.de/download/mc/1986.04_mc_C-Programme%20CPM68K.pdf
Regards,
MogensB
Please consider sending complete copies of the patched code to Gaby:
http://www.cpm.z80.de/
That is where it truly belongs.
Randy
fredag den 11. marts 2022 kl. 08.18.19 UTC+1 skrev Randy McLaughlin:
Please consider sending complete copies of the patched code to Gaby:
http://www.cpm.z80.de/
That is where it truly belongs.
RandyI Agree - I wrote a mail to Gaby.
Regards,
MogensB
fredag den 11. marts 2022 kl. 18.20.32 UTC+1 skrev MogensB:
fredag den 11. marts 2022 kl. 08.18.19 UTC+1 skrev Randy McLaughlin:
Please consider sending complete copies of the patched code to Gaby:
http://www.cpm.z80.de/
That is where it truly belongs.
68K at no cost, only request is that we maintain the original copyright notice in the software. Gaby is informed, and is about to make the SVS FORTRAN-77 compiler available on the website.RandyI Agree - I wrote a mail to Gaby.
Regards,I am happy to tell you that I was able to contact the founder of Silicon Valley Software, Inc. (which dissolved back in 1988) who is also the author of the compilers. He kindly granted permission to freely use and distribute the SVS Compilers for CP/M-
MogensB
I gave credits to you guys in this forum for your help getting the binary files patched back into working condition. The original binaries for the compilers were unfortunately lost, also with the founder of Silicon Valley Software. He told me, that theSVS Pascal compiler was the tool used for developing the SVS FORTRAN compiler, so it would be great if that one could be fixed as well ;-) - and for Gaby to make available this compiler too!
Regards,
MogensB
On 3/13/22 9:57 AM, MogensB wrote:
@Martin and @David - you got credited for your effort to patch the corrupt binaries - I hope you are OK with being mentioned in Gaby's website :-) if not, just drop a line to Gaby about it.
I know that memory is supposed to get a bit flaky with age but I do not recall doing anything to patch those binaries. Other than suggesting
that it might be possible.
--
http://davesrocketworks.com
David Schultz
@Martin and @David - you got credited for your effort to patch the corrupt binaries - I hope you are OK with being mentioned in Gaby's website :-) if not, just drop a line to Gaby about it.
fredag den 11. marts 2022 kl. 18.20.32 UTC+1 skrev MogensB:68K at no cost, only request is that we maintain the original copyright notice in the software. Gaby is informed, and is about to make the SVS FORTRAN-77 compiler available on the website.
fredag den 11. marts 2022 kl. 08.18.19 UTC+1 skrev Randy McLaughlin:
Please consider sending complete copies of the patched code to Gaby:I Agree - I wrote a mail to Gaby.
http://www.cpm.z80.de/
That is where it truly belongs.
Randy
Regards,
MogensB
I am happy to tell you that I was able to contact the founder of Silicon Valley Software, Inc. (which dissolved back in 1988) who is also the author of the compilers. He kindly granted permission to freely use and distribute the SVS Compilers for CP/M-
I gave credits to you guys in this forum for your help getting the binary files patched back into working condition. The original binaries for the compilers were unfortunately lost, also with the founder of Silicon Valley Software. He told me, that theSVS Pascal compiler was the tool used for developing the SVS FORTRAN compiler, so it would be great if that one could be fixed as well ;-) - and for Gaby to make available this compiler too!
Regards,
MogensB
søndag den 13. marts 2022 kl. 17.49.09 UTC+1 skrev David Schultz:would mention your name to Gaby. Please let me know, I can of course ask Gaby to remove your name from the site, if you don't feel it belongs there! I just wanted to make it clear that I was not the one capable of fixing the files :-)
On 3/13/22 9:57 AM, MogensB wrote:
@Martin and @David - you got credited for your effort to patch the corrupt binaries - I hope you are OK with being mentioned in Gaby's website :-) if not, just drop a line to Gaby about it.I know that memory is supposed to get a bit flaky with age but I do not
recall doing anything to patch those binaries. Other than suggesting
that it might be possible.
--
http://davesrocketworks.com
David Schultz
Hi David - I am sorry if I misunderstood your comments in this thread, I was just thinking you were the one correctly identifying the root cause of the problem with the files - the EOF markers being deleted from the files? This was why I thought I
Best Regards,
MogensB
Thx to *everyone* helping to make these important contribution to the CP/M software collections. It is amazing to see how I started with posting a question in search of a FORTRAN compiler, and now we have two almost "lost" significant compilers workingon CP/M-68K.
/MogensBThere is another, kind of. The sources for the PLM compiler hosted on a
Am 03/13/2022 05:59 PM, MogensB schrieb:would mention your name to Gaby. Please let me know, I can of course ask Gaby to remove your name from the site, if you don't feel it belongs there! I just wanted to make it clear that I was not the one capable of fixing the files :-)
søndag den 13. marts 2022 kl. 17.49.09 UTC+1 skrev David Schultz:
On 3/13/22 9:57 AM, MogensB wrote:
@Martin and @David - you got credited for your effort to patch the corrupt binaries - I hope you are OK with being mentioned in Gaby's website :-) if not, just drop a line to Gaby about it.I know that memory is supposed to get a bit flaky with age but I do not >> recall doing anything to patch those binaries. Other than suggesting
that it might be possible.
--
http://davesrocketworks.com
David Schultz
Hi David - I am sorry if I misunderstood your comments in this thread, I was just thinking you were the one correctly identifying the root cause of the problem with the files - the EOF markers being deleted from the files? This was why I thought I
Best Regards,
MogensB
No offence please, this is my view of the things,
he has not much to do with the restoration
*BUT*
Without his emulator, I never had finished this project !!!
I also have to thank *Randy McLaughlin* to make this possible,
because of his efforts to not only archive these files, but many, many more!
And finally the founder of Silicon Valley Software, Inc., to make his compiler available to us.
And please forgive me, if I have forgotten onyone else :-)
Martin
There is another, kind of. The sources for the PLM compiler hosted on a
VAX were made available some time ago. In FORTRAN. I tried to get it to compile using the GCC version of FORTRAN but didn't get very far.
On 3/13/22 5:19 PM, MogensB wrote:working on CP/M-68K.
Thx to *everyone* helping to make these important contribution to the CP/M software collections. It is amazing to see how I started with posting a question in search of a FORTRAN compiler, and now we have two almost "lost" significant compilers
David/MogensBThere is another, kind of. The sources for the PLM compiler hosted on a
VAX were made available some time ago. In FORTRAN. I tried to get it to compile using the GCC version of FORTRAN but didn't get very far.
Perhaps it would work better with the native FORTRAN? If so, then it
would be possible to compile the few CP/M-68K tools (ed, etc.) that are
in PLM.
--
http://davesrocketworks.com
David Schultz
On the internet you can find FORTRAN source for a PL/M 80 cross compiler, which is relatively clean
FORTRAN 66 and does work, however you need the later version as the original V2 generates incorrect code.
ogd...@gmail.com schrieb am Montag, 14. März 2022 um 12:01:47 UTC+1:
On the internet you can find FORTRAN source for a PL/M 80 cross compiler, which is relatively cleanWe have versions 2 and 4 of the cross compiler.
FORTRAN 66 and does work, however you need the later version as the original V2 generates incorrect code.
I was not aware of a PL/M 68k, where can it be found?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 428 |
Nodes: | 16 (2 / 14) |
Uptime: | 105:28:36 |
Calls: | 9,053 |
Calls today: | 10 |
Files: | 13,395 |
Messages: | 6,015,444 |