OzzFan wrote on 2021-01-01, 00:07:
Ok, so I think I'm getting the hang of this old school coding. I'm still having some problems using some of the C++ standards in the STLport for the DIgital Mars compiler, such as string and cout (lots of errors about bad header references in the iostream.h file).
Did you get these sorted out?
And it looks like if I want to write any sort of system identification / benchmarking tool, I'm going to have to write my own routines and not rely on the APIs of the OS (in this case DOS and Win16).
Yeah, I think DOS particularly didn't do much to expose information about the underlying hardware to you - like most OSes, its primary function is to hide that from you, but unlike more modern OSes they didn't include extra parts that let you find out about the underlying hardware when you want it, because it's a fairly minimal OS. Maybe if you look around in old collections of programming libraries you might find useful stuff, although possibly a lot of them will be shareware so you might have licensing problems.
K1n9_Duk3 wrote on 2021-01-01, 23:10:
You could also hijack environment variables for passing string data, but then you might just as well use (temporary) files to pass data back and forth.
If you're talking about DOS, then writing temporary files might require actually involve blocking writes to a slow hard drive if there's no cache like SMARTDRV installed, so an environment variable would be nicer, but then there's a limit to the size of the environment which can be easy to hit! I certainly set up my SHELL line in CONFIG.SYS with only enough environment space for what I needed so as to not waste too much memory.
But if you already have full source code, you might as well combine both programs into one and avoid passing data back and forth on program start or termination.
I suppose that splitting into separate executables could be useful if you've got a lot of code and it can't all fit into 640KB at once along with your data, although maybe overlays could help there too. Old Microprose games for example would use overlays to provide hardware drivers, and then separate executables for different phases of game play (menu, random game creation, briefing, gameplay, etc.) which passed data between each other. Some of the data was in temporary files, I'm not sure if all of it was though.
Yet another method of inter-process communication is the "Intra-Applications Communications Area" in the "BIOS Data Area". It's been a long time since I used it so it's lucky I vaguely remembered the correct term to search the web for, but here's how http://www.piclist.com/techref/language/delph … g/MISC0015.html describes it:
[...] 0000:04F0 [...] is the intra-applications communications area in the bios area
of memory. A Program may make use of any […]
Show full quote
[...] 0000:04F0 [...] is the intra-applications communications area in the bios area
of memory. A Program may make use of any of the 16 Bytes in this area
and be assured that Dos and the bios will not interfere With it. This
means that it can be effectively used to pass values/inFormation
between different Programs. It can conceivably be used to store
inFormation from an application, then terminate from that application,
run several other Programs, and then have another Program use the
stored inFormation. As the area can be used by any Program, it is wise
to incorporate a checksum to ensure that the intermediate applications
have not altered any values. It is of most use when executing child
processes or passing values between related Programs that are run
consecutively.
If you're passing more data than will fit in that area, you could put a pointer to a buffer in it.