Discussion:
Building 4DOS.COM?
(too old to reply)
Jaelani
2009-03-04 15:30:01 UTC
Permalink
Hi,

Since my main programming language is not C, I haven't been successful
building the 4DOS.COM even though I'm sure that I have all the files
required. I just don't know the environment variables and compiler &
linker parameters to use. I DO know how to build/compile a C source
codes, but I use Borland C compiler and not Microsoft C compiler.

Does anyone know how to do this? Please provide me a step by step
command lines or a batch file for building the 4DOS.COM. Using Microsoft
C compiler, of course. No need to explain each and everything. I'll just
look them up in the help file.

Thanks in advance.


Regards,
Jaelani
Luchezar Georgiev
2009-03-04 17:49:06 UTC
Permalink
Post by Jaelani
Since my main programming language is not C, I haven't been successful
building the 4DOS.COM even though I'm sure that I have all the files
required. I just don't know the environment variables and compiler &
linker parameters to use. I DO know how to build/compile a C source
codes, but I use Borland C compiler and not Microsoft C compiler.
4DOS builds only with the Microsoft C 8.0 (a.k.a. Visual C++ 1.x) compiler.
Neither Borland C, nor the Walter Bright's compilers (Datalight C / Zortech
/ Symantec / Digital Mars) are supported. Even Watcom can't fully build it.
Post by Jaelani
Does anyone know how to do this? Please provide me a step by step
command lines or a batch file for building the 4DOS.COM. Using Microsoft
C compiler, of course. No need to explain each and everything. I'll just
look them up in the help file.
There is a batch file called MKDOS which you need to run. See my web site
for the exact steps to do. As to setting up the compiler, it is enough to
extract the VC152.EXE in e.g. C:\VC, and adjust the PATH, INCLUDE and LIB
environment variables. For example:

SET PATH=C:\VC;%PATH%
SET INCLUDE=C:\VC\INCLUDE
SET LIB=C:\VC\LIB

You also need to install some of the MASM versions I provided links to.
Please let me know if you have further difficulties, here or by e-mail.
Post by Jaelani
Thanks in advance.
You're welcome!

Regards,
Lucho
Luchezar Georgiev
2009-03-05 07:07:38 UTC
Permalink
Post by Luchezar Georgiev
SET PATH=C:\VC;%PATH%
SET INCLUDE=C:\VC\INCLUDE
SET LIB=C:\VC\LIB
PATH=C:\VC\BIN;%PATH%, not C:\VC. But you don't need to set the variables
in your environment. Only in MSC7.BTM, as described on my site. In short,
all the information is already on my site. Read it and do it. That's all.

Regards,
Lucho
Jaelani
2009-03-05 17:34:06 UTC
Permalink
OK. Here's the building part where I failed. Except for the "LIBSRC\H"
INCLUDE path which you forgot to mentioned, all environment variables
are set properly for both MASM v6.15 and MSVC v1.52. Here's the output
after executing the MKDOS.BTM.

Timer 1 on: 23:53:22
Loading NMAKE
Assembling: initerrs.asm
Assembling: 4dlinit.asm
Assembling: fname.asm
Assembling: dosumb.asm
Assembling: decout.asm
Assembling: srchenv.asm
Assembling: parspath.asm
Assembling: findems.asm
Assembling: findureg.asm
Assembling: iniparse.asm
Assembling: relocate.asm
Assembling: hexout.asm
Assembling: 4dos.asm
Assembling: errormsg.asm
Assembling: modules.asm
Assembling: serverrs.asm
Assembling: server.asm
loaddata.asm(62) : warning A4013: instructions and initialized data not
supported in AT segments
Assembling: swapchk.asm
Assembling: reshigh.asm
Assembling: dosumb.asm
Assembling: relocate.asm
Assembling: dv.asm
Assembling: errormsg.asm
Assembling: dosutil.asm
Assembling: inout.asm
Assembling: bcd.asm
Assembling: keyparse.asm
Assembling: tokens.asm
Assembling: umbreg.asm
Assembling: compdrv.asm
Assembling: win95.asm
Assembling: cpuspeed.asm
Assembling: realcode.asm
main.c
parser.c
dosinit.c
cmds.c
expand.c
eval.c
dircmds.c
Out of memory
NMAKE : fatal error U1077: 'CL' : return code '2'
Stop.

ERROR:

Timer 1 off: 23:53:25 Elapsed: 0:00:02.82
Timer 1 on: 23:53:25
Loading NMAKE
NMAKE : fatal error U1073: don't know how to make '\strmenc.obj'
Stop.

ERROR:

Timer 1 off: 23:53:25 Elapsed: 0:00:00.05
Timer 1 on: 23:53:25
Loading NMAKE
Assembling: kstack.asm
Timer 1 off: 23:53:25 Elapsed: 0:00:00.09
Luchezar Georgiev
2009-03-05 18:42:49 UTC
Permalink
Post by Jaelani
OK. Here's the building part where I failed. Except for the "LIBSRC\H"
INCLUDE path which you forgot to mentioned, all environment variables
are set properly for both MASM v6.15 and MSVC v1.52. Here's the output
after executing the MKDOS.BTM.
Yes, I usually forget rather many things, but you can see how I've set the
variables in MSC7.BTM and do the same according to your build environment.
Post by Jaelani
dircmds.c
Out of memory
NMAKE : fatal error U1077: 'CL' : return code '2'
Stop.
The "Out of memory" error is quite strange! Maybe there are problems with
the C compiler's DOS extender?! In what environment do you do your build?
Post by Jaelani
Loading NMAKE
NMAKE : fatal error U1073: don't know how to make '\strmenc.obj'
Stop.
This is because the previous build process failed and STRMENC.OBJ was not
build. If the previous step completed successfully, this wouldn't fail :)

Regards,
Lucho
Jaelani
2009-03-05 22:30:03 UTC
Permalink
Post by Luchezar Georgiev
The "Out of memory" error is quite strange! Maybe there are problems
with the C compiler's DOS extender?! In what environment do you do your
build?
I ran it under Windows XP with 2GB of ram and more than 50% of free memory.

What confuses me is the CL.EXE return code of 2 which is a "file not
found" error. So I tried to build it again by executing MKDOS for the
second time (just curious). Here's the output.

Timer 1 on: 05:07:24
Loading NMAKE
dircmds.c
filecmds.c
syscmds.c
select.c
misc.c
env.c
batch.c
error.c
_file.c
screenio.c
window.c
listall.c
lines.c
doscmds.c
idle.h(37) : fatal error C1083: Cannot open include file: 'portab.h': No
such file or directory

NMAKE : fatal error U1077: 'CL' : return code '2'
Stop.

ERROR:

Timer 1 off: 05:07:38 Elapsed: 0:00:13.87
Timer 1 on: 05:07:38
Loading NMAKE
NMAKE : fatal error U1073: don't know how to make '\strmenc.obj'
Stop.

ERROR:

Timer 1 off: 05:07:38 Elapsed: 0:00:00.04
Timer 1 on: 05:07:38
Loading NMAKE
Timer 1 off: 05:07:38 Elapsed: 0:00:00.04



It seems that somehow the "Out of memory" error message was errornously
displayed while the correct error is the error code. Looks like an error
within an error for me. :/

OK. Now the error message is clear and the problem is the portab.h. I've
searched the whole MSVC152 and MASM directory for that file but it's not
there.

I noticed that the idle.h is a new file taken from the Caldera DOS.
Could it be that the portab.h is missing from the 4DOS package as part
of the idle.h file dependency?
Jaelani
2009-03-06 00:43:20 UTC
Permalink
Post by Jaelani
It seems that somehow the "Out of memory" error message was errornously
displayed while the correct error is the error code. Looks like an error
within an error for me. :/
OK. Now the error message is clear and the problem is the portab.h. I've
searched the whole MSVC152 and MASM directory for that file but it's not
there.
I noticed that the idle.h is a new file taken from the Caldera DOS.
Could it be that the portab.h is missing from the 4DOS package as part
of the idle.h file dependency?
I found the problem that was causing the "Out of memory" error. It was
the PATH environment variable - it was too long for the compiler. I
guess the compiler is not fully aware of Windows environment. So I
discarded the original paths and use only for the compiler directories.
And the problem is solved.

About the portab.h file, I downloaded the Caldera OpenDOS source code
and found the required file including the idle.h file which is identical
byte-by-byte. You may want to update (for the last time) the 4DOS
patches to include the portab.h file. I got the Caldera OpenDOS source
code package from the following "DR-DOS/OpenDOS Enhancement Project" web
page.

http://www.drdosprojects.de/index.cgi/download.htm


As I thinkered the path order of the PATH environment variable, I
noticed that (presumably) the NMAKE from the MASM package is much faster
that the one from the MSVC one although MASM NMAKE has a lower version.
I tested it by building 4DOS.COM from scratch. Also, when using MSVC
NMAKE, the U1077 error message will display:

NMAKE : fatal error U1077: 'C:\TCC\TCC.EXE' : return code '2'

rather than:

NMAKE : fatal error U1077: 'CL' : return code '2'


By the looks of it, the MSVC NMAKE displays the COMSPEC environment
variable rather than the executed program. Another NMAKE bug?
Luchezar Georgiev
2009-03-06 07:20:25 UTC
Permalink
Post by Jaelani
Post by Jaelani
OK. Now the error message is clear and the problem is the portab.h.
I've searched the whole MSVC152 and MASM directory for that file but
it's not there.
I noticed that the idle.h is a new file taken from the Caldera DOS.
Could it be that the portab.h is missing from the 4DOS package as part
of the idle.h file dependency?
Yes, exactly! But now when I checked my sources, it turned out that this
file is... empty! Seeing that there is nothing important in this file, I
must have created an empty file. Just type REM > PORTAB.H and you've got
it! Therefore, this bug is actually in the... "diff" utility, which does
not seem to include empty files in its output, although I always use the
"-Nu" options when producing the CODE.DIF patches. I looked at the "diff
--help" output again but it doesn't have a special option to include the
empty files in the patch it creates. Therefore it must do it by default,
but alas, it doesn't! :-(

Well, this should be the small obstacle that serves as a test, whether a
given developer is smart enough to build 4DOS, which you just proved for
yourself! ;-) Now, do you think that it's better to add this file to the
patch "by hand", if "diff" can't do this automatically? If so, I will do it.
Post by Jaelani
I found the problem that was causing the "Out of memory" error. It was
the PATH environment variable - it was too long for the compiler. I
guess the compiler is not fully aware of Windows environment.
The compiler is an extended DOS program and isn't aware of Windows at all.
Post by Jaelani
So I
discarded the original paths and use only for the compiler directories.
And the problem is solved.
Congratulations!

As to the NMAKE strange behaviour, I have no idea what's going on here. But
most important is that now you have managed to build 4DOS.COM! Please, test
it by comparing it byte-by-byte with my binary files. It should differ only
in a few bytes where the __DATE__ is put (2 for the date, 1 space and 3 for
the month, or 6 only bytes in total!). FreeDOS COMP does the best job here.
It shows you the differences in hexadecimal and in ASCII, at the same time.

Note that you need to have a DOS or Windows 9x environment in order to test
4DOS properly. I build it in DOS or Windows 98 (SE), and test it there too.
Never tried to BUILD it in an NT environment but you've proved that this is
possible. So far, so good, but this is not the environment 4DOS is designed
to RUN in. If you take over 4DOS maintenance, you could get complaints from
DOS / Windows 9x users saying that something is wrong in their environment,
if you haven't tested how it runs there after a change but only in your NT.
It's not difficult to shrink your NTFS partition and install Windows 98(SE)
in the freed space, in a new FAT32 partition. I also have SIX different DOS
versions and if I do a DOS-specific change, test how it runs in all of them
(but if you don't do such changes, you may save this trouble for yourself).

Regards,
Lucho
Jaelani
2009-03-06 09:50:02 UTC
Permalink
Post by Luchezar Georgiev
Well, this should be the small obstacle that serves as a test, whether a
given developer is smart enough to build 4DOS, which you just proved for
yourself! ;-)
It's a bit discouraging for potential contributors, IMO. I consider
myself lucky that you are still around. If we want 4DOS to live longer or
even maybe forever, it should be made as easy as possible for
programmers also - regardless how dumb he/she can be. Who knows, even
the dumbest of the dumbest can spark a silly but good idea. After all,
the 4DOS is very short in contributors.
Post by Luchezar Georgiev
Now, do you think that it's better to add this file to the
patch "by hand", if "diff" can't do this automatically? If so, I will do it.
Since building preparations are mostly manual, it would be better if
there is a batch file that can automate the patches, setup the MSC7.BTM
file and check all required tools according to the user provided paths.
Consider it as a development environment setup application. Including
the batch file in the patch package itself would be best, IMO.
Post by Luchezar Georgiev
Please, test it by comparing it byte-by-byte with my binary files. It
should differ only in a few bytes where the __DATE__ is put (2 for the
date, 1 space and 3 for the month, or 6 only bytes in total!). FreeDOS
COMP does the best job here. It shows you the differences in hexadecimal
and in ASCII, at the same time.
I've tested them and the difference is only the month and the date
portion of the text - 5 bytes in total (the space character position is
identical).
Post by Luchezar Georgiev
Note that you need to have a DOS or Windows 9x environment in order to
test 4DOS properly. I build it in DOS or Windows 98 (SE), and test it
there too. Never tried to BUILD it in an NT environment but you've
proved that this is possible. So far, so good, but this is not the
environment 4DOS is designed to RUN in.
No, I never consider Windows to be a good DOS testing environment even
under Windows 98 safe mode simply because Windows interferes the system
too much. My system is dual boot to Windows XP NTFS and to DOS FAT-32
(this includes FreeDOS, Windows 98 DOS and Windows 98). I had to abandon
Windows 98 for my main OS since there's no driver for my nForce
motherboard and since I'm only doing a test build. And no, I don't use
4DOS for my Windows XP because it's much slower than TCC.
Post by Luchezar Georgiev
If you take over 4DOS
maintenance, you could get complaints from DOS / Windows 9x users saying
that something is wrong in their environment, if you haven't tested how
it runs there after a change but only in your NT.
For me, real mainteance is keeping the website up to date which I'm not
very good at. If I do become the only contributor left, I would hand the
website maintenance to other person who dwells in this newsgroup longer
than me, a long time 4DOS user, already has a 4DOS dedicated web page
and knows to handle website better than me (I'm just a novice :p ).
Post by Luchezar Georgiev
I also have SIX different DOS versions
and if I do a DOS-specific change, test how it runs in all of them (but
if you don't do such changes, you may save this trouble for yourself).
I do have many of other DOS versions in archive for testing and
educational purposes. Still have plenty of room in my FAT-32 partition
and multi boot entries. So that won't be a problem.


But really, I'm not aiming to become a 4DOS maintainer, just a free
contributor which are not bound by anything except for my own
contributions as a programmer. Besides, I still don't fully know the
general inner working of 4DOS. Any single error can be disasterous. It
would be too risky to make a public 4DOS.COM patch at this time.
Luchezar Georgiev
2009-03-06 12:00:05 UTC
Permalink
Post by Jaelani
It's a bit discouraging for potential contributors, IMO. I consider
myself lucky that you are still around. If we want 4DOS to live longer
or even maybe forever, it should be made as easy as possible for
programmers also - regardless how dumb he/she can be. Who knows, even
the dumbest of the dumbest can spark a silly but good idea. After all,
the 4DOS is very short in contributors.
Klaus requested and I sent him a single archive of all 4DOS source code and
all non-standard libraries used except the non-free Mix C/WinDOS toolchest.
Post by Jaelani
Since building preparations are mostly manual, it would be better if
there is a batch file that can automate the patches, setup the MSC7.BTM
file and check all required tools according to the user provided paths.
Consider it as a development environment setup application. Including
the batch file in the patch package itself would be best, IMO.
I don't think that these two should be mixed. The setup batch file is run
only once, whereas the build batch file - on every build. But you're free
to write a setup batch file yourself, if you feel it is really necessary.
But I don't think so, because the setup is done only once, and that's it.
Post by Jaelani
I've tested them and the difference is only the month and the date
portion of the text - 5 bytes in total (the space character position is
identical).
Good to know.
Post by Jaelani
No, I never consider Windows to be a good DOS testing environment even
under Windows 98 safe mode simply because Windows interferes the system
too much. My system is dual boot to Windows XP NTFS and to DOS FAT-32
(this includes FreeDOS, Windows 98 DOS and Windows 98). I had to abandon
Windows 98 for my main OS since there's no driver for my nForce
motherboard and since I'm only doing a test build. And no, I don't use
4DOS for my Windows XP because it's much slower than TCC.
Great.
Post by Jaelani
For me, real mainteance is keeping the website up to date which I'm not
very good at. If I do become the only contributor left, I would hand the
website maintenance to other person who dwells in this newsgroup longer
than me, a long time 4DOS user, already has a 4DOS dedicated web page
and knows to handle website better than me (I'm just a novice :p ).
Very well, send your patches to Klaus and let him integrate them. I hope
you both can form a good team! :) I myself wouldn't like to be involved.
Post by Jaelani
I do have many of other DOS versions in archive for testing and
educational purposes. Still have plenty of room in my FAT-32 partition
and multi boot entries. So that won't be a problem.
Great.
Post by Jaelani
But really, I'm not aiming to become a 4DOS maintainer, just a free
contributor which are not bound by anything except for my own
contributions as a programmer. Besides, I still don't fully know the
general inner working of 4DOS. Any single error can be disasterous. It
would be too risky to make a public 4DOS.COM patch at this time.
That's the current status, but in the future you will be better and better.

Is there anything else I forgot? If not, I'll leave you and Klaus and stop
any 4DOS activity. Hopefully you can cope with everything without my help,
as I've coped with what I could without the help of Rex Conn or Tom Rawson
(of course, I won't remove my 4DOS sites, just will stop updating them...)

Regards,
Lucho
Klaus Meinhard
2009-03-06 13:29:54 UTC
Permalink
Hi Jaelani;
Post by Jaelani
For me, real mainteance is keeping the website up to date which I'm
not very good at. If I do become the only contributor left, I would
hand the website maintenance to other person who dwells in this
newsgroup longer than me, a long time 4DOS user, already has a 4DOS
dedicated web page and knows to handle website better than me (I'm
just a novice :p ).
I wonder who that could be?

Anyway, I've put the Version 8.00 sources and tools Luchezar sent me up
on my site (4DOS Sources page, first link). Since I can do absolutely
nothing with them (I haven't the faintest idea of Pascal, C and the
like) I'd like you to check them out under the viewpoint of
completeness, ease of compilation and the like. I think we have the same
basic idea. anybody interested should find it easy to get along with
them.
Post by Jaelani
I do have many of other DOS versions in archive for testing and
educational purposes. Still have plenty of room in my FAT-32 partition
and multi boot entries. So that won't be a problem.
But really, I'm not aiming to become a 4DOS maintainer, just a free
contributor which are not bound by anything except for my own
contributions as a programmer. Besides, I still don't fully know the
general inner working of 4DOS. Any single error can be disasterous. It
would be too risky to make a public 4DOS.COM patch at this time.
Is your email adress valid? Otherwise I'd like you to contact me by
email. There are a few things I don't want to write publicly in the
newsgroup.
--
* Klaus Meinhard *
4DOS Info - Info for DOS
www.4dos.info
Loading...