Welcome to the Revived 4DOS! 

4DOS Screenshot
4DOS

Thanks to Rex Conn who re­leased build 132 source code, de­vel­op­ment of the King of the DOS/W9x shells can now be con­tin­ued! (Use Take Com­mand for NT.) 4DOS re­mains free and not sup­por­ted by JP Soft­ware. It is main­tained by me (Лъчезар Георгиев). I read comp.os.msdos.4dos.

Contents

  1. Files for download
  2. Building 4DOS.COM
  3. Testing 4DOS.COM
  4. Building 4HELP.EXE and 4MAKE.EXE
  5. "Dead link?!"
  6. "Forking"?!
  7. "Porting"?!
  8. "FreeDOS-only?!"
  9. Motivation
  10. Priorities
  11. Known problems
  12. Acknowledgements
  13. About me
  14. Build history
  15. Online interactive demo (1.6 MB)

4DOS users can donate e.g. 1 hour of their wage () to support its maintenance. Ta! Donors: Stephen Foyle, 林俊生 (Lam Chun Sang).

1. Files for download

(87 KB) against the original (7.50.1) sources and 4DOSHLP1

(763 KB): executables, help, documentation, installation files

(552 KB): the above archive but as WinUDA SFX instead of ZIP

2. Building 4DOS.COM

You need patch(1), MASM 6.1x and VC 1.5x with library sources (for msdos.h).

  1. Apply CODE.DIF against the original source code release by Rex Conn.
  2. Create a DOS sub-directory. 4DOS.COM will be there if built successfully.
  3. Modify MSC7.BTM to set your environment variables PATH, INCLUDE, LIB.
  4. Run MKDOS.BTM. You will see some hard-to-fix warnings. Ignore them.

The INISTRUC.* files must be frozen until we have the missing header files (dialog.h, general.h, iniio.h, iniipar.h, iniistr.h, iniutil.h, option.h, resource.h) to build OPTION.EXE.

3. Testing 4DOS.COM

Before testing your changes, increment both VER_BUILD and INTVER so that the new shell does not inherit the old one, or it will crash soon or later. Do not forget to "patch" the build number in OPTION.EXE at offsets 122F6h and 122FFh.

4. Building 4HELP.EXE and 4MAKE.EXE

You need BP7 (TP7), TPRO5, BP7PATCH, Turbofix. (To build HELPCFG.EXE, you also need Turbo Pascal Editor Toolbox 4.0, but as the necessary custom version of "ediscrn.inc" is missing from the 4HELPSRC archive, it cannot be built for now.)

  1. Install BP7 and TPRO5 and build the latter's units.
  2. Apply the BP7 patch and Turbofix.
  3. Update tpcmd.pas,tpdos.pas,tpedit.pas,tpinline.pas,tpmemchk.pas,tpstring.pas
    and tpcrt.pas and copy tpdefine.inc,tppick.in1 and tpmouse.asm from TPRO5.
  4. Apply 4HELP.DIF and adjust TPC.CFG and BUILD.BTM for your environment.
  5. Run BUILD.BTM. You will see an error for HELPCFG.EXE whose build will fail.

All links provided above were valid at the time of writing. Their validity in the future cannot be guaranteed by anyone. Please report any "dead" link.

6. "Forking"?!

Please do not create a "fork". Let us unite our efforts and not be like the swan, the pike and the crayfish in the Krylov's fable who dragged the cart to 3 different directions. Let us merge each others' patches. (So far, only Kenneth Davis and Michal Necasek have contributed to my builds.)

7. "Porting"?!

Michal Necasek has ported 4DOS to Open Watcom C. His source code patches are now merged with mine. The port is preliminary and does not build with "standard" Open Watcom C version 1.7!

"Porting" 4DOS to Linux, *BSD, Mac OS X or another UNIX-like OS, even if it was not expressly disallowed by Rex Conn, would be very hard to do, as 4DOS is inherently a 16-bit DOS programme. You had better wait for him to port TCC (ex-4NT), but please be aware that a full port is already impossible, because just too many (mostly new) functions in TCC (ex-4NT) are NT-specific.

Alas, it seems that the UNIX-like operating systems will have to live with standard GNU shells like BASH while the power of the JP Software products will remain limited only to the [so far] ubiquitous "NT". C'est la vie! On the other hand, with the demise of Microsoft started with "Vista", nobody knows when times will change to the extent that Rex Conn could write and sell a 4NIX or 4MAC...

8. "FreeDOS-only?!"

The 4DOS source code licence starts as a simple, all-permissive licence: "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so."

But it then says: "The Software, or any portion of it, may not be compiled for use on any operating system OTHER than FreeDOS without written permission from Rex Conn", contrary to the above permission "to deal without restriction".

When asked "what about MS-DOS, PC-DOS, DR DOS etcetera?", Rex Conn answered: "I don't have any problems with people using it on those OS's (although I'd be surprised if there was a lot of MS-DOS or PC-DOS action left). That license was written by the FreeDOS people – it was probably worded that way because it's impossible to list every possible variation of the DOS OS's."

Because of these contradictions of the source code licence, the binary archive is distributed under its original 2004 freeware licence, which is much more consistent and clear. If the source code licence can be changed at all (i.e. it is not too late) I regard this freeware licence as the best candidate. After all, it is already used for the 4OS2 source code. But I am not a lawyer.

From the JP Software forum:

"Luchezar Georgiev has taken over 4DOS maintenance and development. He's added a number of new features, bug fixes, and compatibility fixes; If you're still using 4DOS I recommend downloading the latest build from his web page at http://www.4dos.hit.bg/.

I've also added a link to his web page on our download page in the 4DOS section."

Rex Conn   
JP Software

9. Motivation

It is a real pleasure to "wade in" this masterpiece of code especially for a C++ and Windows programming ignorant like me. 4DOS has been one of my favourite programmes since ~1990, so it is a big honour for me to revive its development!

As TCC (ex-4NT) is already a few years ahead of 4DOS, we can not "catch up". But 4DOS will live at least until TCC (ex-4NT) can be run in DOS – now impossible, but perhaps some day some Win32 emulator for DOS like DOSWIN32, HINTOS, WINDOSX or HX will be able to run it?

Note that I do not claim any "copy right" over my patches or the contents of this web site – they are placed in "public domain" for maximal benefit of the DOS community. The future generations who will live in a much more just and highly developed society than we do will surely find funny the pitiful attempts of our capitalist society to impose the ancient idea of "copy right" dated back to the Gutenberg era over the digital realm. Oh, how they will laugh at us!

If the above is not enough, reckon me using the Libre Commons Res Communes Licence for my patches and site: Ⓛ 2006–2008 Libre Commons Res Communes Licence.

10. Priorities

Bug fixes are always a higher priority for me than adding new features. If you find a bug, please let me know so I can try to find and fix it. I cannot promise that I will manage to catch it alone, so I may need your help in that. Of course, if you can find it yourself, you will save me a lot of time.

As to adding new features, if you convince me that it is really useful, and if you can find a similar feature in TCC (ex-4NT) or in older 4DOS versions, I will consider adding it when I can. Of course, you may also add it yourself – then I will be very grateful to have your patch so I can add it too.

I will not add x86 emulator support. 4DOS.COM was tested in PicoXT and JPC and found to work.

11. Known problems
  • After a CLS command, prompt is positioned on the second, not the first line.
  • If command line editing mode is changed, cursor shape returns to default only
    on next prompt.
  • "Warm" REBOOT crashes in ROM-DOS when Datalight EMM386 is loaded.
  • Last access date can be set only in W9x, MS-DOS 7.x, PC DOS 7.1 and
    no other DOS variant. Creation date/time can be set only in W9x. This is a
    limitation of the DOS kernels, not 4DOS.
  • In DOSLFN only, a DIR right after a TOUCH in the same directory may not
    show the updated file date/time as the DOSLFN cache has not been refreshed.
    This is a problem of DOSLFN, not 4DOS.
  • In VESA text video-modes with more than 80 columns, the new 4HELP
    (TPRO?! BP?!) resets the video-mode on start and blanks screen on exit.
  • Directory names containing backquotes are not supported.
  • DIR /S fails with "Out of memory" on "all-in-one" CDs in LFN mode.
  • 4DOS crashes in Wendin-DOS and ZDOS (of all 14 tested operating systems).
  • If InstallPath is not set, OPTION cannot invoke 4HELP (uses garbage as path).
12. Acknowledgements to:
  • Rex C. Conn – for writing 4DOS (1986-2004) and releasing its sources
  • Tom Rawson – for founding JP Software (JP stands for Jamaica Plain)
  • Sebastian Mozejko – for his mediation on releasing the source code
  • James F. Hall – for publishing the source code released by Rex Conn
  • Kenneth J. Davis – for the first patches allowing successful build
  • Charles E. Dye – for his extended help and list of [now fixed] bugs
  • Michal Necasek – for porting 4DOS to Open Watcom C
  • Stephen Foyle and Johnson Lam who donated €€ to support my 4DOS effort
  • Gary Welles, Szymon Wiatr, Jacob Poon and others who reported 4DOS bugs
  • Stephen Foyle, Steven Kamp, Stefano Piccardi and others who thanked me

I wish everyone follow the example of Rex Conn. Release the sources of your unused software! Let others use it, if you do not! Do not be another Plyushkin!

13. About me

I am a Bulgarian radio- and computer engineer, hardware designer and programmer working as an Assistant Professor in the Computer Science department at the Technical University of Varna, Bulgaria. I am married and have two daughters.

14. Build history since build 132 in reverse order

This history is duplicated in the README.TXT file in the "Binaries" archive
on the left. See the patches for details on these changes. Sources released
by Rex Conn were version 7.50 build 132, so it is the base. After build 150,
version number is determined by the formula VERSION = 6.00 + BUILD / 100

Build 161 (Version 7.61) — 28 January 2008:
  • Correctly show the minor version number of OS/2 Warp 4.x
  • Correctly show X-DOS version and avoid NLS separator corruption in it
  • Recognise Wendin-DOS (but unfortunately 4DOS crashes in it)
Build 160 (Version 7.60) — 28 December 2007:
  • Auto-completion and SELECT now support filenames containing backquotes
  • HEAD/TAIL /V option header now always starts on new line if /C used
  • Return value of @FILEWRITE now equals the number of bytes written
Build 159 (Version 7.59) — 27 October 2007:
  • Wildcard matches include all LFNs containing bracket characters ([])
  • Added @MD5 function for files using the RSA algorithm from RFC 1321
  • Updated help file for the above change
CODE.DIF changes on 3 October 2007:
  • Integrated the changes by Michal Necasek for Open Watcom C
  • Changes allowing 4DOS build will appear in Open Watcom C version 1.8
  • VC 1.5x still builds a 100% identical executable file (same as build 158)
Build 158 (Version 7.58) — 15 September 2007:
  • Direct screen output now works in monochrome video modes too
  • Amended sign-on message with information about 4DOS patches
  • Re-enabled the MOVE /W(ipe) option
Build 157 (Version 7.57) — 27 July 2007:
  • Auto-completion of file names with many dots works in DOSLFN as in W9x
  • Creation / access times can now be TOUCHed in DOSLFN, not only in W9x
  • SELECT /X now works in DOSLFN too, not only in W9x
  • Fixed possible pointer underflow if @WORD and @FIELD count backwards
  • @WORD and @FIELD no longer return whole string if it has leading space
  • Added @FIELDS function
  • Updated help file for the above change
Build 156 (Version 7.56) — 25 June 2007:
  • Show zero creation or access times in DOSLFN the same way as in W9x
  • Added _DATETIME and _MONTHF variables
  • Added @AGEDATE and @MONTHF functions
  • Updated help file for the above changes
Build 155 (Version 7.55) — 14 May 2007:
  • Show proper CD/DVD-ROM disk space in raw DOS; fixes DIR in PCDOS7.1
  • Avoid false detection of MS-DOS 7 (MSDOS7 variable) in case of FreeDOS
  • DIR /2 /X in Windows now looks like in DOS and doesn't reach column 80
  • VER /R now displays also build date
Build 154 (Version 7.54) — 20 April 2007:
  • Added message.* to global header dependency
  • Added high-level @EMS function code (was missing in original sources)
  • Added _alt,_capslock,_ctrl,_lshift,_numlock,_rshift,_scrolllock,_shift
  • Updated help file for the above change
Build 153 (Version 7.53) — 15 February 2007:
  • Recognise LZ-DOS, RXDOS, DOS-ROM and S/DOS
  • The "Marked" message of SELECT no longer shifts even on largest files
  • 8.3 file size over 1 GB no longer misaligns DIR, TREE or SELECT output
  • Updated help for the above (maximal non-wrap description size now 39)
Build 152 (Version 7.52) — 4 February 2007:
  • Correctly process the "invalid disk change" code during critical error
  • Irrelevant error codes in critical error converted to "general failure"
  • Added a /L(ine offset) option to LIST
  • Updated help file for the above change
Build 151 (Version 7.51) — 31 January 2007:
  • For Novell DOS and DR-DOS 7.x-8.0, show the right DOS version
  • For hard errors, show operation and drive; accept only allowed actions
  • DOS error messages amended and edited to clarify and remove duplicates
  • Updated help file for the above change
Build 150 — 25 January 2007:
  • Fixed the "Lock violation on COPY from remote drive without SHARE" bug
  • Worked around a bug (in MSVCRT?!) leaving high byte of _doserrno != 0
  • VER_MINOR = VER_BUILD - 100 from now on (version 7.51 = build 151)
Build 149 — 18 January 2007:
  • Fixed the "DIR [PATH] finds no files in DOS LFN volumes" bug
  • An * instead of *.* default wildcard is now used for DOS LFN volumes
  • FFIND /U (summary only) option can now be evaluated by @EXECSTR
  • FFIND and LIST search can now be interrupted with Ctrl-C
4HELP Changes on 15 January 2007
4HELP now supports mouse wheel (As for 4DOS, a driver that supports
wheel is needed, e.g. Cute Mouse 2.x; the W9x driver does not support
wheel for the DOS mouse API.)
Build 148 — 10 January 2007:
  • LIST, SELECT and command history window now support mouse wheel
    Note: A driver that supports wheel is needed, e.g. Cute Mouse 2.x
  • The right mouse button now exits LIST and SELECT
Build 147 — 8 January 2007:
  • Fixed command line buffer overflow when repeatedly pressing F12
  • Added hexadecimal output option to @EVAL
  • Updated help file for the above change
Build 146 — 7 January 2007:
  • Fixed command line buffer overflow and path search name underflow bug
  • Added new @CWD and @CWDS functions
  • Updated help file for the above change
Build 145 — 6 January 2007:
  • @READY now equals the inverted "no disk in drive" bit for CD-ROMs
  • Added new EJECTMEDIA and CLOSETRAY commands
  • Updated help file for the above change
Build 144 — 30 December 2006:
  • Added a /V(erbose) option to TYPE to show a header for each file
  • Added a /P(ower off) option to REBOOT to shut the system down
  • REBOOT now flushes SMARTDRV cache before reboot or power off
  • Updated help file for the above changes
Build 143 — 29 December 2006:
  • /P page prompts are now overwritten like DR-/PTS-DOS COMMAND.COM
  • Restored DOS version 2.x compatibility of 4DOS.COM, lost in v6
  • 4DOS.COM now aborts on attempt to run it in DOS version 1.x
Build 142 — 26 December 2006:
  • Restored 8086/8088 (PC/XT, Pravetz-16, etc.) compatibility, lost in v6
  • Added compatibility information about CADStar PCB in the help file
  • Added @SERIAL function; help file updated for it too
Build 141 — 24 December 2006:
  • Added GB units to file size ranges, @DISK* and @FILESIZE functions
  • DIR /4 now shows size of files over 1 GB with precision of 0.1 GB
  • Added information about the above features in the help file
Build 140 — 22 December 2006:
  • For Pentium 4 and up, _CPU now returns 786
  • Removed the @READY warning from 4DOS.HLP and added 786 info to it
  • Added build.h dependency for expand, removed shareware dependencies
Build 139 — 21 December 2006:
  • Recognise Datalight ROM-DOS
  • Can now load in upper memory in PTS-DOS
  • @READY now works properly in PTS-DOS
Build 138 — 19 December 2006:
  • @READY now works more reliably with CD-ROM drives
  • Removed unused modules "batcomp" and "parspath" from 4DOS.LNK
  • INTVER = VER_BUILD again, now OPTION.EXE patched on each build
Build 137 — 17 December 2006:
  • Re-enabled _4INST.BTM (self-installer) support
  • Added the installer files from version 6.02 (1999) to the archive
  • 4DOS.HLP replaced by extended and updated version by Charles Dye
Build 136 — 15 December 2006:
  • Process the DR-DOS F5/F8 startup keystrokes too
  • Fixed the "%* affected by the SHIFT command" bug
  • Removed the unused (non-4DOS and shareware) error messages
Build 135 — 13 December 2006:
  • No longer mistake DR-DOS 7.0x for Novell DOS
  • Recognise PC DOS, FreeDOS, PTS-DOS and DR-DOS 7.03
  • Fixed the "DIR /F and DIR /B /S disable colourisation" bug
Build 134 — 9 December 2006:
  • Batch debugger now refuses to load batch files over the 64 KB size limit
  • Fixed the "total @FILESIZE roll-over at 4 GB" bug
  • Fixed the "DESCRIBE loses third-party info" bug
Build 133 — 7 December 2006:
  • Properly show FAT32 drive space in MS/PC/LZ/EDR/PTS/ROM/FreeDOS
  • Properly show free XMS memory in the MEMORY command if > 64 MB
  • Re-enabled the /Y single-stepping option that was disabled in 2003
  • Fixed the "SET /M not upper-casing master environment variables" bug
  • Fixed the "RD not removing hidden and system sub-directories" bug
  • Fixed the C4018 "signed/unsigned mismatch" C compiler warnings
  • Reverted INTVER from 131 to 130 to make OPTION compatible
4DOS History before build 132
For earlier builds and versions and their history, please see the site of
Klaus Meinhard. It provides a wealth of information on 4DOS and is a
must visit for any serious 4DOS user.
Brief History of Bulgaria
Valid XHTML 1.1 Valid XHTML 1.1 Valid XHTML 1.1Valid CSS?

The visitors of this page come from 84 countries. Top 10 visitors' cities: 北京市 (Beijing), Herndon, London, 台北市 (Taipei), Paris, Denver, Albuquerque, Toronto, Amsterdam, Den Haag.