Discussion:
Remote debugging in virtual machine?
(too old to reply)
ta0590897
2014-10-08 15:12:27 UTC
Permalink
(Sorry about crossposting from the subreddit but it has only 2 subscribers)

I want to run my DOS program, cross-compiled with OW, in a virtual DOS
machine such as DOSBox or QEMU. The host is Windows, and I want to do my
debugging via either wdw.exe or better still Code::Blocks.

While I managed to set up FreeDOS in QEMU to do networking, I don't know
how to proceed from here. I cannot get tcpserv.exe to run even after
installing a packet driver, it says "unable to open socket stream".
Though I don't really know much about networking.

After googling the issue, I got the impression that remote debugging
does not really work in Open Watcom except via serial cable.

Is this true? Just so I'm not spending all my time trying something futile.
Mat Nieuwenhoven
2014-10-12 07:49:35 UTC
Permalink
Post by ta0590897
(Sorry about crossposting from the subreddit but it has only 2 subscribers)
I want to run my DOS program, cross-compiled with OW, in a virtual DOS
machine such as DOSBox or QEMU. The host is Windows, and I want to do my
debugging via either wdw.exe or better still Code::Blocks.
While I managed to set up FreeDOS in QEMU to do networking, I don't know
how to proceed from here. I cannot get tcpserv.exe to run even after
installing a packet driver, it says "unable to open socket stream".
Though I don't really know much about networking.
After googling the issue, I got the impression that remote debugging
does not really work in Open Watcom except via serial cable.
Is this true? Just so I'm not spending all my time trying something futile.
Hi,

in general remote debugging works quite well. I've used serial, TCP/IP, and
something specific to OS/2 (and possible parallel as well).

So in Freedos tcpserv doesn't work? Have you tested the generic TCP/IP
things first, link pinging an outside host, and using the browser Arachne?

Mat Nieuwenhoven
Mat Nieuwenhoven
2014-10-12 14:25:49 UTC
Permalink
Post by Mat Nieuwenhoven
Post by ta0590897
(Sorry about crossposting from the subreddit but it has only 2 subscribers)
I want to run my DOS program, cross-compiled with OW, in a virtual DOS
machine such as DOSBox or QEMU. The host is Windows, and I want to do my
debugging via either wdw.exe or better still Code::Blocks.
While I managed to set up FreeDOS in QEMU to do networking, I don't know
how to proceed from here. I cannot get tcpserv.exe to run even after
installing a packet driver, it says "unable to open socket stream".
Though I don't really know much about networking.
After googling the issue, I got the impression that remote debugging
does not really work in Open Watcom except via serial cable.
Is this true? Just so I'm not spending all my time trying something futile.
Hi,
in general remote debugging works quite well. I've used serial, TCP/IP, and
something specific to OS/2 (and possible parallel as well).
So in Freedos tcpserv doesn't work? Have you tested the generic TCP/IP
things first, link pinging an outside host, and using the browser Arachne?
I did a quick test with VirtualBox (VB) and the pre-configured FreeDos (FD)
virtual machine at http://lazybrowndog.net/freedos/virtualbox/ , which also
has clear instructions., which I followed.
I booted FD in TCP mode (item 3 on the menu, no MS cient), I could ping
outside from within FD, and transferred programs to it using FTP, so
networking is working.
I could duplicate your error and also know why: FD doesn't supply a
standard set of interfaces for TCP program to use (that would take up much
precious memory), but each TCP program must have built-in TCP
functionality. And the Watcom tcpserv doesn't come in that flavor.
This preconfigured FD has other networking options, and so has Watcom. I
tried items 4 (TCP), 5 (NetBIOS) and 6 (IPX). Consistent result were only
if I stopped FD completely and started it from VB. For each of those, after
start up, you have to issue 'net start' to get the networking stack up.
Item 4 didn't work, 6 crashed when doing 'net start', 5 (netbios) seemed to
work OK. Note that this is 'native' Netbios over ethernet (the classical
one), not Netbios over TCP/IP. For NetBios, Watcom support the 'netserv'
server, but strangely this exited after a short time with 'cannot load trap
file' (which it doesn't need). I don't have time to look at how good the
Netbios implementation of FD is, or why netserv fails.
So maybe your options are limited to serial and/or parallel. Serial should
work provided you host machine either has two serial ports (assign one for
FD) and you use a null-modem cable between the two ports. I'm not sure it a
serial port from a VM can be talked to directly from the host, that would
be ideal. Parallel the same story.

Hope this helps, Mat Nieuwenhoven
Mat Nieuwenhoven
2014-10-13 19:58:43 UTC
Permalink
Post by Mat Nieuwenhoven
Post by Mat Nieuwenhoven
Post by ta0590897
(Sorry about crossposting from the subreddit but it has only 2 subscribers)
I want to run my DOS program, cross-compiled with OW, in a virtual DOS
machine such as DOSBox or QEMU. The host is Windows, and I want to do my
debugging via either wdw.exe or better still Code::Blocks.
While I managed to set up FreeDOS in QEMU to do networking, I don't know
how to proceed from here. I cannot get tcpserv.exe to run even after
installing a packet driver, it says "unable to open socket stream".
Though I don't really know much about networking.
After googling the issue, I got the impression that remote debugging
does not really work in Open Watcom except via serial cable.
Is this true? Just so I'm not spending all my time trying something futile.
Hi,
in general remote debugging works quite well. I've used serial, TCP/IP, and
something specific to OS/2 (and possible parallel as well).
So in Freedos tcpserv doesn't work? Have you tested the generic TCP/IP
things first, link pinging an outside host, and using the browser Arachne?
I did a quick test with VirtualBox (VB) and the pre-configured FreeDos (FD)
virtual machine at http://lazybrowndog.net/freedos/virtualbox/ , which also
has clear instructions., which I followed.
<snip>

I did some more testing, this time on Windows, and remote debugging using
TCP in FreeDos seems to work, as follows:
- Use the preconfigured FD mentioned above, and boot menu item 3 (TCP). I
set up the VM with a bridged network adapter, because it needs its own IP
address. It is possible it would work with a VB host-only network too, I
haven't tested that. If you use that, don't enable its DHCP server, that
doesn't work with FD, use fixed IP addresses.
- The FD is initially set up using DHCP. In FD I used MC to set up the FTP
server to c:\ftpdata (create the directory): change \fdos\ftppass.txt to
have a sandbox /drive-c/ftpdata and uploaddir / . Start the ftpsrv, then
from windows in a cmd prompt go to the Watcom binw directory. There start
the ftp client (ftp <ipaddress_of_FD>), login, enter binary, then transfer
std.trp and tcpserv.exe to FD. Plus any program you want to debug. In FD
stop ftpsrv.
- In FD using MC, change c:\autoexec.bat, to rem out the DHCP line in
config 3. Also configure \fdos\wattcp.cfg with a good IP config (should be
similar to the DHCP config, just different IP address), Halt FD (not
reboot). Start FD from VM GUI.
- In FD, go to \ftpdata, start tcpserv .
- In Windows, in a cmd prompt in the Watcom binnt directory, start 'wd
/tr=tcp;<ipaddress_of_FD> application_to_debug .

I also tested again NetBIOS (you'll need std.trp and netserv.exe in FD),
after booting to FD menu item 5. netserv starts, but from the host Windows
machine "wd /tr=net application_to_debug" didn't connect. Of course the
Windows machine must be configured for 'native' NetBIOS also, not just the
standard NetBIOS over TCP/IP.

I also tested serial again using a named pipe \\.\pipe\vmwaredebug, after
starting the program "vmwaregateway /t" in a cmd prompt (see the VB help
about serial ports). If FD is started, you see in vmwaregateway an incoming
pipe connection. Because vmwaregateway provides by default an TCP server on
localhost:567 (tested with telnet), I used "wd /tr=tcp;localhost:567". It
doesn't actually give an error but doesn't interact with FD's serserv,
possibly because the protocol for tcp and ser are different.

Happy debugging!

Mat Nieuwenhoven

Paul S. Person
2014-10-13 16:40:06 UTC
Permalink
Post by ta0590897
(Sorry about crossposting from the subreddit but it has only 2 subscribers)
I want to run my DOS program, cross-compiled with OW, in a virtual DOS
machine such as DOSBox or QEMU. The host is Windows, and I want to do my
debugging via either wdw.exe or better still Code::Blocks.
This is an off-the-wall suggestion, but have you considered running
the DOS version of wd (the 16-bit wdw is for 16-bit Windows) inside
the virtual DOS session?

As it happens, I have a local repository for the OW source code, and
that contains a complete image of the final product. I tested the
binw\wd in that, and it came up -- and it has an interface very
similar to that of wdw. How well it works I have no idea.

A few "obvious" problems:
1) Depending on how you installed Open Watcom, the binw directory may
or may not have the debuggers in it.

2) Inside the DOS session, only binw should be in the path, not binnt.

3) I have read a report that DOSBox can run Windows 3.1, in which case
the 16-bit wdw might also be available if you happen to have Windows
3.1 available.

I know it seems strange using DOS tools on a Windows system instead of
Windows tools. But if it works, then it has certain clear advantages
over trying to get remote debugging to work.
--
"Nature must be explained in
her own terms through
the experience of our senses."
Continue reading on narkive:
Loading...