OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Networking => Topic started by: SoundChaser on April 17, 2025, 04:20:15 am

Title: TCP/IP from MVDM DOS sessions
Post by: SoundChaser on April 17, 2025, 04:20:15 am
Hello folks,

TL;DR - is there a recipe to have packet drivers in a MVDM session talk to a NIC's physical device driver?

----

If I got it correctly, in order to reach the network MVDM forwards network requests (from interrupts) to the matching VDD (Virtual device driver) which in turns escalates the call to the PDD (Physical device driver) which allows for coexistance of multiple DOS sessions using different protocols on the same network card managed by OS/2 at the PDD level. Great.

Fast forward in 2025, I mostly only care about TCP/IP. While my previous searches led me to find some development material for "IBM TCP/IP for OS/2" (the vanilla TCP/IP support) there's really only very few applications designed around IBM's SDK beyond IBM's own tools or WinOS2 TCP/IP support.

About _every_ other TCPIP application out there was, instead, using the MIT/FTP software packet driver approach.

Months ago, I entertained the idea of porting mTCP for IBM TCP/IP but there's a fair amount of uncertainty to that project, which certainly could end up being a great article for hackaday.com or patreon. A little voice tells me, there must a simpler way, but we just collectively forgot about it?

Reading about FTP Software TCP/IP for OS/2 in InfoWorld archives, in order to make the software run, the reviewers had to use the ODINSUP, because their network adapter only came with Netware support.

See: https://books.google.com/books?id=WzgEAAAAMBAJ&lpg=PP1&hl=fr&pg=PA86#v=onepage&q&f=false

Then we have this also very entertaining bit from Netware that ODINSUP has (of course) it's mirror in ODI2NDI.OS2 that's part of (wait for it... it hurts....) NTS/2 (LAPS)... which is probably MTPN now?

See: https://support.novell.com/docs/Tids/Solutions/10051720.html

Given that there exists packet driver shims for ODI and NDIS that lives in the DOS realm, these would typically forward any request to the PDD through the virtual device driver. With probably a fair amount of net.cfg fun, it seems - at least on paper - that we could use mTCP software from DOS sessions with the packet driver correctly configured with the right shim.

For now, I would only care about Intel ethernet as it would cover most Thinkpads (for those running OS/2 or ArcaOS on bare metal) and virtualisation solutions.

Has anyone ever been able to do that? Is there a flaw in my conception of how network works in DOS that would make this usage scenario unviable?

Title: Re: TCP/IP from MVDM DOS sessions
Post by: SoundChaser on April 17, 2025, 04:22:13 am
Adding another bit, which seems to do exactly what I want, but in IPX world

http://www.jacco2.dds.nl/freeipx.html
Title: Re: TCP/IP from MVDM DOS sessions
Post by: Martin Iturbide on April 17, 2025, 09:43:42 am
Hello SoundChaser.

Here it is something related that I tried without success:
https://www.os2world.com/forum/index.php/topic,2961.0.html

My goal at that time was to run  MicroWeb DOS web browser under a DOS VDM, but I was not able to do it. It uses mTCP and some connection between mTCP and IBM TCP/IP for DOS was required. Even the author of mTCP was here on the forums (mbbrutman), but I was not at his technical level to keep going.

Regards
Title: Re: TCP/IP from MVDM DOS sessions
Post by: SoundChaser on April 17, 2025, 01:00:58 pm
Yeah my experiment would consist in using FTP Software TCP/IP stack instead. It likely comes with a VDD for DOS since they support WinOS2 (I expect it to be similar to Trumpet)

That driver would be a packet driver, which would be mTCP compatible (maybe?)
Title: Re: TCP/IP from MVDM DOS sessions
Post by: Sean Casey on April 18, 2025, 03:41:29 pm
Hi SoundChaser,

Should you ever get FTP Software's stack working on OS/2, please report back.    I use Paradox 4.5 for DOS w. SQL Link to Interbase which requires FTP Software's TCP/IP stack.  Would like to ditch DOS and move it to OS/2.

I once looked at using the DIS_PKT shim that works with an NDIS interface, but due to my limited skills, I didn't get very far.
Title: Re: TCP/IP from MVDM DOS sessions
Post by: SoundChaser on April 22, 2025, 05:54:53 am
Should you ever get FTP Software's stack working on OS/2, please report back.    I use Paradox 4.5 for DOS w. SQL Link to Interbase which requires FTP Software's TCP/IP stack.  Would like to ditch DOS and move it to OS/2.

Ever considered migrating it to Paradox 4.5 for Windows 3.1 instead? If it was discarded, I'd be curious to know more. The core db engine is supposedly the same.

Title: Re: TCP/IP from MVDM DOS sessions
Post by: Bogdan on April 23, 2025, 09:03:41 pm
Hello folks,

TL;DR - is there a recipe to have packet drivers in a MVDM session talk to a NIC's physical device driver?
It works without any problems using FTP Software's PC/TCP with INT61VDD.SYS driver.

Quote
Fast forward in 2025, I mostly only care about TCP/IP. While my previous searches led me to find some development material for "IBM TCP/IP for OS/2" (the vanilla TCP/IP support) there's really only very few applications designed around IBM's SDK beyond IBM's own tools or WinOS2 TCP/IP support.
The DOS part of the TCP/IP PTK shares the same interfaces with FTP Software's PC/TCP Version 4. So all TCP/IP DOS applications shipped with the PC/TCP product or OnNet should work.
Title: Re: TCP/IP from MVDM DOS sessions
Post by: Sean Casey on April 30, 2025, 12:47:30 am
Ever considered migrating it to Paradox 4.5 for Windows 3.1 instead? If it was discarded, I'd be curious to know more. The core db engine is supposedly the same.

I use Paradox 9 on Linux Wine almost daily for a couple GUI db apps, but I like Paradox for DOS if I just need to look things up via SQL as it's very fast.  PDX for DOS works fine in OS/2 when accessing SQL Server via db-lib, but I can't get to my Interbase data via Paradox for DOS in OS/2 as it requires FTP Software's FTP stack.  Not a big deal, but I had spent some time a while back to see if I could get it to work under OS/2, so I was interested in this thread. 

I couldn't find anything on that INT61VDD.SYS driver Bogdan refered to?
Title: Re: TCP/IP from MVDM DOS sessions
Post by: SoundChaser on May 02, 2025, 01:33:05 pm
Quote
It works without any problems using FTP Software's PC/TCP with INT61VDD.SYS driver.

OMG, Bogdan... this is what I was looking for, and for a while now, but it seems that information was obliterated from the search engines.

The VDD must have a PDD counterpart? I assume this comes from PC/TCP for OS/2?

Title: Re: TCP/IP from MVDM DOS sessions
Post by: Sean Casey on May 03, 2025, 11:30:14 pm
I see, that INT61VDD.SYS, an INT 61h emulator, was included in PC/TCP for OS/2.  I'll need to install both FTP Software's OS/2 and DOS products.

Update:  Installed PC/TCP OS/2 and DOS on Warp 3 and a quick test of the PC/TCP DOS stack seems to work fine.  Unfortunately, the version of FTP Software's PC/TCP for OS/2 version I have, version 1.3.1, isn't compatible with ArcaOS (INT61VDD.SYS dated 3/31/95).   
Title: Re: TCP/IP from MVDM DOS sessions
Post by: SoundChaser on May 04, 2025, 03:47:41 pm
I see, that INT61VDD.SYS, an INT 61h emulator, was included in PC/TCP for OS/2.  I'll need to install both FTP Software's OS/2 and DOS products.

Strictly speaking, it's not that much an emulator, but rather a virtualization of the network hardware to handle DOS 61h interrupts. IF you mean "it emulates a DOS packet driver", I agree with you it replaces what would be otherwise a so-called DOS "packet driver".


Update:  Installed PC/TCP OS/2 and DOS on Warp 3 and a quick test of the PC/TCP DOS stack seems to work fine.  Unfortunately, the version of FTP Software's PC/TCP for OS/2 version I have, version 1.3.1, isn't compatible with ArcaOS (INT61VDD.SYS dated 3/31/95).

ARGH. After I installed PC/TCP 1.3.1 (winfiles, IBM TCP/IP 1.3.1 is really PCFTP) my system behaved on 2nd reboot (curiously, the first reboot went fine) with a country.sys screen of death. I had to recover an archive from prior to the installation of PC/TCP.

So close. Here's my plan for my second attempt:

- extract the PC/TCP lines from the "current" (archived) config.sys
- merge them in my "current" (active) config.sys but at the end but keep out anything related to the old Microsoft components.

I'm curious about the symptoms you've observed, if they differ from my boot error.

Title: Re: TCP/IP from MVDM DOS sessions
Post by: Sean Casey on May 04, 2025, 07:32:05 pm
I'm curious about the symptoms you've observed, if they differ from my boot error.

The installation routine for PC/TCP for OS/2 would not execute on ArcaOS, so I had copied the relevant OS/2 entries from my Warp 3 config.sys file from the installation that was working. 

I was getting a SYS01521 error during the boot of ArcaOS.  It just took a INT61VDD.SYS device statement and adding a reference to the PCTCP installation directory placed at the tail of my LIBPATH to cause the error. 

If you have better luck, please post your findings.
Title: Re: TCP/IP from MVDM DOS sessions
Post by: Dave Yeo on May 04, 2025, 07:45:35 pm
Code: [Select]
F:\test>help 1521

SYS1521: There are too many parameters specified in the
*** statement on line *** of the CONFIG.SYS file.  Line ***
is ignored.

EXPLANATION: The specified statement in the CONFIG.SYS file has more
parameters than are expected.

ACTION: Edit the CONFIG.SYS file to correct or remove the incorrect
statement and restart the system.

One I haven't seen.
Understand that through Warp v4 OS/2 used a 16 bit stack based on BSD 4.3, while now we use a 32 bit stack ported from AIX based on BSD 4.4. Not sure about using an old device with the new stack.
Title: Re: TCP/IP from MVDM DOS sessions
Post by: SoundChaser on May 04, 2025, 11:03:51 pm
Sean: I did not have that error message. I won't have the chance to try out until tomorrow at the latest, but I'll report back. Thank you for the report!!

Dave: Possibly. I'm still no clear how the PC/FTP exactly works, but since it was meant as a TCPIP stack for OS2 systems _without_ one (without IBM tcpip for os2) I suspect the IBM BSD stack to be completely bypassed?



Title: Re: TCP/IP from MVDM DOS sessions
Post by: SoundChaser on May 05, 2025, 12:04:53 am
The DOS part of the TCP/IP PTK shares the same interfaces with FTP Software's PC/TCP Version 4. So all TCP/IP DOS applications shipped with the PC/TCP product or OnNet should work.

I'm really curious about have more details about your findings there. Does the vtcpdos.vdd implement the FTP software packet driver interface? Btw, I really suspect IBM to have licensed FTP software work in early releases to eventually complete it with "enterprise", 32bit, versions from AIX later on.

Personally, I've found evidence that the NBF (netbios frame) VDD implements both NetBIOS and 802.2 LLC interrupt handler that's present in IBM's DOS offerings so that any NetBIOS or 802.2-based software from IBM running under DOS would also work under OS2 (typically, mainframe clients) while, to my understanding, the TCP VDD talks to OS2's TCP kernel support. It's there to ensure backcomp with "IBM TCPIP for DOS"-based products.

Title: Re: TCP/IP from MVDM DOS sessions
Post by: Dave Yeo on May 05, 2025, 01:25:56 am
Dave: Possibly. I'm still no clear how the PC/FTP exactly works, but since it was meant as a TCPIP stack for OS2 systems _without_ one (without IBM tcpip for os2) I suspect the IBM BSD stack to be completely bypassed?

In that case, there may be sharing issues, the network adapter and sockets at least. "ifconfig lan0 down" for example may fix the socket sharing, not sure about the network adapter.
Title: Re: TCP/IP from MVDM DOS sessions
Post by: SoundChaser on May 05, 2025, 03:22:11 pm
OK while I do _not_ pretend to have material that's awesome enough to make an OS/2 Museum article, or the talent of Michal to do spelunking within the darkness of days gone by, this is getting pretty interesting nevertheless.

My system boots. I suspect ae (e replacement, I hate it) to have garbled my config.sys the first time, which - *if* its indeed the case, led to the infamous country.sys trap error. Maybe it was an operator error as well. Anyway, I've had many problems with editing simple text files from the prompt using ae, so I decided to stick with tedit and epm and forget about e until I recover IBM's original one from my Warp 4 Advanced Server CDROM.

Enough ramblings. the findings:

First, PC/TCP 1.3.1 modifies the config.sys with new entries very early in the file.

I decided to move them closer to other IBMCOM and MPTN (MPTS, whatever) :

Code: [Select]
...snipped...
REM *** this next line was added to the config.sys in the original install.
SET HOSTNAME=ARCAOS

REM *** the line below was added by PC/FTP and I commented it out as it uses the old MS Protocol Manager.
REM DEVICE=d:\pctcp\drv\PROTMAN.OS2 /I:d:\pctcp\drv
REM *** I replaced it with IBM's PROTMAN. I do not know whether they can co-exist.
REM *** BTW, interestingly enough, protman was not in the config.sys already, perhaps because
REM *** I opted out from NetBIOS/NetBEUI?
DEVICE=D:\IBMCOM\PROTMAN.OS2 /I:D:\IBMCOM

REM *** This line corresponds to PC/TCP socket driver.
DEVICE=d:\pctcp\drv\SOCKET.OS2

REM *** This comment was added by PC/TCP installer. I moved it right before my
REM *** NIC driver to document the original message and what's my NDIS driver.
REM *** You must find what is your NIC corresponding NDIS device driver for your setup.
REM *** PUT THE NDIS DEVICE= STATEMENT HERE ***
DEVICE=D:\IBMCOM\MACS\E1000B.OS2

REM *** This is where the fun starts. This is the int 61h driver.
REM *** I'll post another message with additional findings
DEVICE=d:\pctcp\drv\INT61VDD.SYS

REM *** ... and it darkness, bind them :-)
REM *** At this point, everything else correspond to my original config.sys
CALL=D:\IBMCOM\PROTOCOL\NETBIND.EXE
<...snipped...>

Then the installer also add a script to the startup folder, the script invokes the following from pc/tcp folder.

Code: [Select]
netbind
tcpmgr start

There another script, called pctcp.cmd which starts, minimized the VDD_D daemon:

Code: [Select]

rem pctcp.cmd - starts up pctcp services

ifconfig lo0 localhost
hostname arcaos.local
minstart VDD_D


Finally, the default autoexec.bat receives the following new entry:

Code: [Select]
D:\PCTCP\BIN\INST61

And _that_ is what loads the int 61h handler in every VDM instance.

-=-=-=-=-=-=-=-=-=

The install process also tell about modifying the protocol.ini file.... yay..... Since I'm using IBM's protocol manager, I left PCTCP protocol.ini untouched and updated \IBMCOM\protocol.ini instead. I copied the snipped to be filled from PCTCP's protocol.ini, though.

Code: [Select]
[PROT_MAN]

   DRIVERNAME = PROTMAN$

[IBMLXCFG]

   TCPIP_NIF = TCPIP.NIF
   E1000B_NIF = E1000B.NIF

[TCPIP_NIF]

   DriverName = TCPIP$
   Bindings = E1000B_NIF

[E1000B_NIF]

   DriverName = E1000B$


;FTP Software --- PCTCP Section -------
[SOCKET]
drivername = $SOCKET
; The next line was unfilled, I've manually added E1000B$ to bind $SOCKET with E1000B$
bindings= E1000B$
;----------------------------------

Does it work? Hell no :-) Even PCTCP software doesn't work _but_ it could be a configuration thing. I went fast in itsinstall process. The IBM TCP stack still works, I'm typing this from Firefox under ArcaOS 5.1

Oh, and I get a trap error on shutdown in the int61vdd ever since. Very annoying.

Next post will cover my findings wrt int 61h.


Title: Re: TCP/IP from MVDM DOS sessions
Post by: SoundChaser on May 05, 2025, 03:38:38 pm
Now for the INT 61h documentation.

It turns out that Ralf Brown's Interrupt List has some info about it.

https://www.cs.cmu.edu/~ralf/files.html

The following page contains the same documentation, but formatted in HTML format:

https://www.ctyme.com/intr/rb-6703.htm

Code: [Select]
FTP Software PC/TCP - TCP/IP TSR System Call interface

AH = system call number (also see entries below)
01h "pkt_alloc" (v2.05; this is "net_config" in v2.1+)
02h "pkt_free" (v2.05; this is "get_kernel_info" in v2.1+)

Return:
CF clear if successful
CF set on error
AL = basic error (see #03319)
AH = suberror number (see #03320,#03321)

InstallCheck:
Test for the signature "TCPTSR" three bytes beyond the start
of the interrupt handler

Range:
INT 20h to INT E0h, selected by configuration

BUG: The SLIP kernel for v2.05 bounds-checks the wrong register, so values greater than 54h in AH may crash the system. Other kernels may have this bug as well.

See Also: INT 61/AH=00h"PC/TCP" - INT 61/AH=2Ah - INT 61/AH=54h

Index:
Installation check;PC/TCP



(Table 03319)
Values for PC/TCP error code:
00h "NET_NOERR" successful
01h "NET_ERR_INUSE" protocol or socket already in use
02h "NET_DOS_ERR" MS-DOS error (returned as suberror code in AH)
03h "NET_ERR_NOMEM" out of memory
04h "NET_ERR_NOTNETCONN" not a network descriptor
05h "NET_ERR_ILLEGALOP" invalid operation on given kind of network descriptor
06h "NET_ERR_BADPKT" illegal or corrupted packet
07h "NET_ERR_NOHOST" no host bound to specified connection
08h "NET_ERR_CANTOPEN" unable to open file
09h "NET_ERR_NET_UNREACHABLE" network is unreachable
0Ah "NET_ERR_HOST_UNREACHABLE" host is unreachable (see #03320)
0Bh "NET_ERR_PROT_UNREACHABLE" protocol is unreachable
0Ch "NET_ERR_PORT_UNREACHABLE" port is unreachable
0Dh "NET_ERR_TIMEOUT" operation timed out
0Eh "NET_ERR_HOSTUNKNOWN" unable to resolve host name
0Fh "NET_ERR_NOSERVERS" no name servers configured
10h "NET_ERR_SERVER_ERR" bad reply from name server.

Subcodes:
0= no error, 1 = Host unreachable
11h "NET_ERR_BADFORMAT" bad format for IP address or field in IP address
structure is zero
12h "NET_ERR_BADARG" invalid argument
13h "NET_ERR_EOF" foreign host closed its end of connection
14h "NET_ERR_RESET" connection has been reset
15h "NET_ERR_WOULDBLOCK" recv() call was done on a non-blocking connection
with no data available
16h "NET_ERR_UNBOUND" insufficient resources to do operation
17h "NET_ERR_NODESC" could not allocate network descriptor
18h "NET_ERR_BADSYSCALL" invalid/unsupported kernel call
19h "NET_ERR_CANTBROADCAST" unable to broadcast
1Ah "NET_ERR_NOTESTAB" operation illegal because connection not established
1Bh kernel busy, try again later
1Ch "NET_ERR_ICMPMESG" an ICMP message was received (not on streams).
(see #03321)
---v2.1+---
1Dh "NET_ERR_TERMINATING" internal kernel fatal error
1Eh "NET_ERR_TAG_LOCKED" not allowed to set this tag (net_config)
1Fh "NET_ERR_BAD_INTERFACE" non existent interface specified
20h "NET_ERR_BADCONFIG" kernel cannot run - bad configuration
21h "NET_ERR_EMM" expanded memory error
22h "NET_ERR_CANT_SHUTDOWN" cant unload kernel (multitasker running)
23h "NET_ERR_PARKED_IN" unable to unhook DOS interrupt
24h "NET_ERR_NOQIOS" ran out of resources; try again later
25h "NET_ERR_WOULD_TRUNCATE" datagram too large and "don't truncate" was set



(Table 03320)
Values for subcodes of PC/TCP error 0Ah "NET_ERR_HOST_UNREACHABLE":
00h    no error
01h    host unreachable
02h    ARP failed
03h    hardware failure
04h    link failure
05h    no route
06h    gateway down

See Also: #03319 - #03321



(Table 03321)
Values for subcodes of PC/TCP error 1Ch "NET_ERR_ICMPMESG":
07h    unrecognised
08h    can't fragment
09h    srcr_fail
0Ah    source quench
0Bh    time exceeded
0Ch    parameter problem
0Dh    admin_prohib. see also code 0Ah

See Also: #03319 - #03320


But... wait... it says TCP/IP System Call interface.

Yeah. It seems the packet driver is expected to be at INT 60h while the TCP/IP stack to reside at 61h.

What I was originally looking for was a handler for INT 60h instead of a TCP/IP payload forwarder. In other words, this is only useful for software developped for PCTCP and/or OnNet. It's mostly useless to run any software developped for WATTCP or Brutman mTCP DOS stacks, which want to talk to the NDIS adapter through INT 60h

Now if anyone has DOS or WinOS/2 software that works with PCTCP and been yearning for a way to have them run in ArcaOS, this could be your path forward. The hard trap upon shutdown is massively annoying, though.

The quest remains open for a packet driver shim or VDD that would work in MVDM...