Author Topic: Kermit 95 / C-Kermit for Windows and OS/2  (Read 12000 times)

davidrg

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Kermit 95 / C-Kermit for Windows and OS/2
« Reply #15 on: February 03, 2023, 05:15:02 am »
For both windows and OS/2 I've just used the included libs with OpenWatcom. No DOS support should be required - it should be sufficient to just download the Engine and either the "Windows NT files" or "OS/2 files" depending on the target (windows/os2).

So i think to build the dialer *on* OS/2 with OpenWatcom 1.9, it should be sufficient to run:
Code: [Select]
set root=C:\src (where ever the full source code lives)
cd %root%
setenv.cmd
cd ..\dialer
mkos2.cmd

And assuming zinc is in %root%\zinc the include and lib path should get setup correctly. I've not tried this actually on OS/2 yet though - still need to figure out a reasonable way of getting the source into the VM. The process on Windows is pretty much identical - just .bat instead of .cmd

davidrg

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Kermit 95 / C-Kermit for Windows and OS/2
« Reply #16 on: February 03, 2023, 01:00:52 pm »
Found a different Warp 4 VM that had Fixpak 15 applied and the SNAP graphics driver so actually had usable graphics performance and a usable resolution! Spent I don't know how long trying to get the arca package manager to work so I could maybe install git but I think it wants some tcpip update that isn't included in Fixpak 15. If that update was ever free I don't think its a rabbit hole worth going down based on past experience with OS/2 updates.

So I zipped up all the source and FTPd it into the VM with IBM WebExplorer (ugh), adjusted the k95dial.mak to do a debug build, and if I'm understanding the OpenWatcom Debugger correctly its falling over at zinc\include\ui_win.hpp:1751 though I have no idea why or whats even calling that (some zinc code?). Tried rebuilding Zinc with OpenWatcom 1.9 (which required fixing zinc\source\o_print.cpp) but that didn't help. Tried rebuilding it with the /bm (multithreaded runtime) compiler option but no change.

Not really sure where to go from here as far as the dialer is concerned. As far as I know it was last successfully built for OS/2 in November 2002 for Kermit 95 v2.1.2 using an IBM compiler and a modified version of Zinc 4.2. OS/2 support was dropped after 2.1.2 so its possible some change in Kermit 95 2.1.3 broke something. Or maybe the switch to OpenWatcom has broken something on OS/2. Or maybe some change in OpenZinc 1.0 (which is based on Zinc 4.2) has broken something on OS/2. The Zinc designer can't open dialer.dat (which contains all the GUI designs) but maybe the designer is just broken on OS/2 in some way, or there is some extra setup thats required.

Edit: Ended up merging the makefile changes over into the master branch so that if nothing else Github Actions can check that windows-related changes to the dialer don't break OS/2 any further. The issue of the OS/2 Dialer crashing on startup is now tracked by ticket #152
« Last Edit: February 03, 2023, 11:51:18 pm by davidrg »

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4855
  • Karma: +102/-1
    • View Profile
Re: Kermit 95 / C-Kermit for Windows and OS/2
« Reply #17 on: February 04, 2023, 04:39:02 am »
Hi, tried some more to get the dialer compiling on OS/2, no luck as the detection code seems broken.
Code: [Select]
===============================================================================
C-Kermit Dialer Build Configuration
===============================================================================
Architecture:             x86
Compiler:                 OpenWatcom WCL386
Compiler Version:         OpenWatcom
Compiler Target Platform: OS/2
===============================================================================


Using ctl3d32
k95dial.mak(82): Error(E21): Extension(s) (.cpp.obn) not defined
k95dial.mak(83): Warning(W20): Command list does not belong to any target
k95dial.mak(85): Error(E21): Extension(s) (.c.obn) not defined
k95dial.mak(86): Warning(W20): Command list does not belong to any target
k95dial.mak(153): Error(E25): Extension (.cpp) declared more than once
k95dial.mak(153): Error(E25): Extension (.c) declared more than once
k95dial.mak(155): Error(E21): Extension(s) (.c.obo) not defined
k95dial.mak(156): Warning(W20): Command list does not belong to any target
k95dial.mak(158): Error(E21): Extension(s) (.cpp.obo) not defined
k95dial.mak(159): Warning(W20): Command list does not belong to any target
Error(E02): Make execution terminated

Looking at the Windows dialer, it does seem to be needed to setup the TCPIP and such rather then simply the modem. While the Windows dialer runs here, the rest of the latest C-Kermit has DLL problems, had to add vcruntime140.dll then api-ms-win-crt-runtime-l1-1-0.dll which unluckily still failed to load the DLL, I assume it is just to long and weird of a DLL name. These can't be statically linked?
As for the package manager, or rather the underlaying Python I believe, failing, yes everything for quite a while has been linked to the newest TCPIP stack. It is freely available, likely needs some fixpak installed first. Same with Snap, there's a free version on Hobbes but IIRC, it needs some fixpak installed first as well.
There are ISO's of Warp v4.52 floating around, places like https://winworldpc.com/product/os-2-warp-4/os-2-warp-452 and while in theory you should have a license, IBM doesn't seem to care as these ISO's are still available. 4.52 is basically a rerelease of v4 with all the fixes up till then on a bootable CD.

davidrg

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Kermit 95 / C-Kermit for Windows and OS/2
« Reply #18 on: February 04, 2023, 05:03:31 am »
Yeah, for the Windows version you've got install the Visual C++ runtime - for Vista and newer the correct one should be this: https://aka.ms/vs/17/release/vc_redist.x86.exe - I'll have to check Frank has put links to the runtime downloads in the ckwin download section. I've still got building a proper install program on my to-do list but it will probably be a while before I get around to it - too many other things that need fixing.

On OS/2 I don't bother to try and detect the compiler - the makefiles just assume OpenWatcom 1.9, though the makefiles should still support icc as well.

Building the dialer on Warp 4 Fixpak 15 with OpenWatcom 1.9 installed to C:\watcom and the kermit located in C:\src and the OpenZinc 1.0 located in C:\src\zinc should be:

Code: [Select]
C:\watcom\owsetenv.cmd
set include=%include%;C:\src\kermit\k95
set include=%include%;C:\src\zinc\include
set lib=C:\src\zinc\lib\ow19;%lib%
cd C:\src\kermit\dialer
wmake -h -ms -f k95dial.mak PLATFORM=OS2 MAKE="wmake -h -ms" os2

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4855
  • Karma: +102/-1
    • View Profile
Re: Kermit 95 / C-Kermit for Windows and OS/2
« Reply #19 on: February 05, 2023, 03:49:37 am »
Ok, that worked and running k2dial resulted in,
Code: [Select]
02-04-2023  18:38:01  SYS3175  PID 00b4  TID 0001  Slot 00a1
L:\WORK\CKWIN\KERMIT\DIALER\K2DIAL.EXE
c0000005
00000000
P1=00000001  P2=00000000  P3=XXXXXXXX  P4=XXXXXXXX
EAX=00417434  EBX=000d7544  ECX=00000000  EDX=00000000
ESI=000b22b4  EDI=00000000
DS=0053  DSACC=d0f3  DSLIM=b7ffffff
ES=0053  ESACC=d0f3  ESLIM=b7ffffff
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:00000000  CSACC=d0df  CSLIM=b7ffffff
SS:ESP=0053:000d74f4  SSACC=d0f3  SSLIM=b7ffffff
EBP=00417434  FLG=00010246

Which I guess is the same result as you.

davidrg

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Kermit 95 / C-Kermit for Windows and OS/2
« Reply #20 on: February 05, 2023, 09:55:35 pm »
Yeah, that's the same error I get.

I assume its an issue with OpenWatcom+OS2 given the same code builds and runs fine on Windows with both Visual C++ and OpenWatcom. There are still a few problems like this affecting C-Kermit itself - optimized builds crash on startup, as do builds with NetBIOS enabled. Quite possibly these are all genuine bugs in the code that just didn't affect the IBM compiler for whatever reason and are only showing up now when using Watcom.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4855
  • Karma: +102/-1
    • View Profile
Re: Kermit 95 / C-Kermit for Windows and OS/2
« Reply #21 on: February 05, 2023, 10:19:42 pm »
Do you think it would still compile with the IBM compiler and do you know which version was used. I have 3.08.

davidrg

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Kermit 95 / C-Kermit for Windows and OS/2
« Reply #22 on: February 06, 2023, 12:22:43 am »
I've no idea what version was used previously I'm afraid. Based on the makefile, it was some version of VisualAge that probably installed by default into C:\IBMCXX0. The last OS/2 release of Kermit 95 was 2.1.2 on 25 November 2002 so it won't be anything newer than that. I think after 2.1.2, OS/2 support was dropped entirely.

The dialer source code comes from the Kermit 95 2.1.3 build tree so binaries from this code were never officially released for OS/2. Kermit 95 2.1.3 was released on 21 January 2003 (changelog) though so unlikely anything much would have broken in that time and it probably would have still worked. The only changes I've made to the dialer code since getting permission to release it were ripping out all the registration code, rebranding it, fixing build issues with OpenWatcom and other versions of Visual C++, plus updating the SSH options to match what the new SSH subsystem is actually capable of. So I expect it should be very nearly buildable with ICC.

I've left all the ICC stuff in the makefile so you would just have to change line 18 of k95dial.mak (CMP = OWCL386) to some other value (what value shouldn't matter as long as its not OWCL386) to prevent it from taking the OpenWatcom path in a few if/else statements. To build C-Kermit with icc, you'd need to modify the makefile in a similar way. This time to line 105 of ckoker.mak and build the ibmc target rather than the wcos2 target.

C-Kermit itself is in a bit more of a tricky state than the dialer. C-Kermit for Windows and OS/2 is based on what was going to be Kermit 95 v2.2 which was never released and was never going to support OS/2. As OS/2 was no longer supported there had been some windows-specific changes in modules shared by both Windows and OS/2 that weren't guarded with #ifdef NT or didn't have alternative OS/2 code paths. Additionally, the modules shared with other platforms (unix/linux/vms) have received an additional 20 years of development work without ever being compiled for or tested on OS/2 until last year. All the stuff that causes compile errors for Watcom when targeting OS/2 has been fixed but I wouldn't be too surprised if ICC ran into a few issues. And its possible that even when built with ICC some bugs will remain.

C-Kermit for Windows originally had similar issues (missing code, last built with an ancient non-free compiler, bugs when built with anything else, shared bits not built for windows in over a decade). The difference there is I know windows very well, I'm vaguely familiar with programming for Windows in C/C++, and I've got a big collection of Visual C++ versions and MSDN library CDs that I can use to diagnose problems and look up information on API and compiler changes.