Go to another page of CSS Dixieland: Start   Country Music   Tango Music   Migration   Victory   Aryan   Women   Solipsism   Whales   Language   Teaching   Photography   Cinematography   Stereoscopy   Computing History   Computing Links   Free-DOS   Unics   Gopher   Railways   Chess
Third National Flag of the Confederate States of America
Third National Flag of the
Confederate States of America
P. A. Stonemann, CSS Dixieland
P. A. Stonemann, CSS Dixieland
National Jack of the Confederate States Navy
National Jack of the
Confederate States Navy

CSS Dixieland

Probing the depths of knowledge

These essays by P. A. Stonemann, CSS Dixieland, cover a wide range of historical, philosophical, scientifical and technical subjects. Each page deals with a particular topic, divided into sections and explained by itself. Every page shows at its top hyper links to every other page. The Start page also has short descriptions of the other pages. CSS Dixieland expresses gratitude to the readers that make this work meaningful.

This Web document has been tested with KDE Konqueror, graphic HTML interpreter for Linux. It may not be rendered correctly by other graphic HTML interpreters. It will probably be correct when rendered by text-only HTML interpreters (visual, aural, or Braille tactile interpreters), but if feasible, please use KDE Konqueror. Uniform Resource Locator:
https://konqueror.org/

Free-DOS Operating System page

The system for the Computing enthusiast who really knows
The awesome power of the command line, in expert fingers

Walkyrie who takes our dead heroes to Walhalla in Asgard
Walkyrie who takes our dead heroes to Walhalla in Asgard.
Wagner Frost Illustration

Sections in this page

  Introduction to Free-DOS
  Technical characteristics
  Free-COM command interpreter

Technical note: In languages other than English or Latin, but which use mainly Latin characters, some characters are taken from other alphabets, or some Latin characters are modified with diacritic marks for representing different phonemic sounds or other orthographic conventions of those languages. Those characters, when used in this document, have been encoded as entities of Hyper Text Mark-up Language or sometimes in Unicode UTF-8. Therefore computers using other character encodings may render some characters inaccurately, but hopefully, it will still be possible to read non-English words without too much difficulty.

 

Introduction to Free-DOS

Free-DOS is an operating system of 16 bits focused on operation by command line. In this regard the concept is similar to other systems also based on textual commands entered at a command prompt, such as other DOS systems (PC-DOS, MS-DOS, DR-DOS, PTS-DOS, ROM-DOS, Amiga-DOS...), AROS, CP/M, Haiku, Inferno, Plan 9, React OS, Symbian, most systems of the Unics genealogy (Minix, Linux, BSD, Macintosh Darwin OS X, GNU Hurd, Open Solaris...), or systems of another family, when used without X-11 Window or any other graphic interface. Free-DOS can be made to work with GEM or with some other graphic interfaces, as it is the case with most variants of Unics and with several other operating systems, which often can be used by command line or by graphic interface. Some systems can be used only either way, but not both. CP/M is an example of only command line, while Syllable is an example of only graphic interface. In general, although most systems can be used in both ways, either the command line or the graphic interface tends to be predominant in a particular system. In Free-DOS it is the command line, which gives greater flexibility, but which also requires a learning effort.

In many respects, Free-DOS is the most advanced DOS system that exists or has existed, since the invention of QDOS and 86-DOS in 1980-1981 (which were based on CP/M). Any serious work with a computer can be done using Free-DOS, inside certain limitations that are explained in its documentation. For instance, DOS systems in general do not allow task swapping, except background execution of the print spooler (although there are a few programmes that allow a limited switching of tasks), and they do not use virtual memory, but they can be made to use a RAM volume if having enough Random Access Memory in the computer. DOS is intended for the relatively knowledgeable user. Not so knowledgeable as for using Unics, but certainly more than for the ubiquitous Microsoft Windows. Persons without any experience in DOS or in other systems operated by command line, are strongly advised to read first some tutorial appropriate to their current knowledge. Different levels of tutorials can be easily found in the Internet. It may be possible for an intelligent reader to dive directly into the pages of the Free-DOS documentation and to understand their meaning with more or less difficulty, but the documentation is not a tutorial, and it does not make any attempt at smoothing the learning path of a beginner.

Synopsis

Operating System Family: DOS 16 bits

Operating System Categories: embedded operating systems, operating systems based on floppy, free software operating systems, DOS in IBM Personal Computer or compatibles

Producer: James Hall and The Free-DOS Team

Initial Release: version Alpha of 28 June 1994

Latest Stable: version 1.0 of 2006 and version 1.1 of 2012

Working State: current in 2016

Source Model: free open source, some closed source utilities

Licence: GNU GPL. Some public domain, freeware or shareware utilities

Kernel Type: monolithic, intended for unal core processors

Supported Platforms: Intel x86 processor or compatible in IBM Personal Computer or compatible

Default Interface: DOS command line, optional graphic interface

Available Languages: English, German

Presentation

Free-DOS (known in 1994 as PD-DOS, shortly later as Free-DOS, and currently known as FreeDOS, without the hyphen) is an operating system for IBM Personal Computer or compatible, using Intel x86 processor or compatible. Free-DOS supports vintage hardware IBM Personal Computer or compatible made since 1981 to the present, in addition to embedded computers. As a member of the DOS family, Free-DOS provides access to storage volume mainly through its kernel, and partial memory management, but without default graphic interface, although Open-GEM (derived from the Graphic Environment Manager of DR-DOS) is included in the official Free-DOS distribution. Some other graphic interfaces for DOS systems could also be used, though they are not included in the distribution.

Free-DOS is made of different, separate programmes, that act as packages to the overall Free-DOS Project. Free-DOS itself, as well as most of the included programmes, are licenced under the terms of the GNU General Public Licence of the Free Software Foundation, but some programmes are public domain, freeware, or shareware. Most of that non-GPL software is located in the directory of utilities, some programmes are each in its own directory. An example of free use but closed source is the 4DOS command interpreter, which can be used as primary or as secondary interpreter in place of Free-Com, the free and open source default command interpreter of Free-DOS. Many programmes included in the distribution are open source and have their sources available (unlike for example MS-DOS or PC-DOS, which are closed source). Free-DOS does not require any licence fees or royalties. Creation of custom distributions is permitted and encouraged. Any use is allowed, even inside commercial products, keeping the system free and in compliance with the terms and conditions for using it.

As of 2016, Free-DOS current versions are 1.0, released on 3 September 2006, and 1.1, released in 2012. The two versions can be obtained by Internet as an image for burning a compact disk. Version 1.0 gives a 'live' compact disk that can be boot-strapped directly, giving a command line with full Free-DOS functionality. Version 1.1 offers some more resources, such as USB support, but it cannot be boot-strapped from the compact disk, it is intended for installation into a hard disk or another boot-strappable storage volume. Persons wishing to know more about Free-DOS, beyond what is explained in the documentation, can subscribe to a list regularly sent via electronic post, or can write to the appropriate electronic addresses of Free-DOS. There are also at least two Web fora focused on DOS systems, and some Usenet groups. It is also possible to have communication in real time by Internet Relay Chat with persons who are experienced in Free-DOS, thus asking questions or requesting advice. For that purpose Free-DOS has a sparsely-populated IRC channel:
#freedos irc.i7c.org

Computers using other than the Intel x86 family of processors or compatibles, or using architectures other than IBM Personal Computer or its clones, cannot execute Free-DOS. An option for them might be one of the systems of the Unics genealogy, such as Minix or BSD, which are portable to many different kinds of computers. Technically speaking BSD is part of the Unics genealogy, but in legal terms, UNIX (in capital letters) was a trade mark of AT & T, later of Novell, and as of 2016 of The Open Group, not including BSD. That is why the earlier name of 'Unics' is used in this document in reference to systems of that genealogy, but which are not owned or marketed by The Open Group. The CSS Dixieland page on Unics operating systems has information on them. The page can be visited by activating the following internal link:

cssdixieland_unics.html

History of Free-DOS

In April 1994 Microsoft Corporation released MS-DOS version 6.22

It was the last stand-alone version of a very successful series of operating systems of 16 bits started in 1980 by Mister Tim Patterson (Seattle Computer) with the original name of QDOS, shortly later renamed as 86-DOS and sold to Mister Paul Allen and Mister William Bill Gates (Microsoft Corporation).

As PC-DOS, it became incorporated into the IBM Personal Computer marketed in 1981, and further developed by IBM and by many other companies. As MS-DOS, it was released separately by Microsoft. DOS systems were strongly based on the CP/M operating system of 8 bits for Intel 8080, created some years earlier by Mister Gary Kildall (Intergalactic Digital Research). A version of 16 bits for Intel 8086, known as CP/M 86, was offered by IBM as an alternative system for the Personal Computer. Digital Research also developed from CP/M 86 its own DR-DOS system, years later also known as Novell DOS and Caldera Open DOS.

MS-DOS, PC-DOS, DR-DOS, PTS-DOS, ROM-DOS, Amiga-DOS, and several other DOS systems, were predominant in most microcomputers of the 1980's and early 1990's, especially in those of the 'Personal Computer' series of IBM or compatible with them, but also in Commodore Amiga computers and many others. Other systems existed, such as Unics, but they often required more hardware than most microcomputers could offer at the time. Only the best microcomputers of those years could execute Unics, computers known as 'Unics Work Stations'.

Older systems, or computers that were not fully compatible with IBM Personal Computer, were driven out of the market or became restricted to a minority of enthusiasts, such as the P-System or the CP/M operating systems, or as the Apple Macintosh, Commodore Amiga, Atari ST, and other computers. For many years DOS and IBM PC were the kings of microcomputers, although not without pretenders to the throne, some of whom have managed to continue until today.

On 29 June 1994 (only two months after the release of MS-DOS 6.22), Microsoft announced its decision that it would no longer sell or support MS-DOS. The company chose to concentrate efforts on Windows systems (graphic interface operating systems of 16 bits started in 1985, today of 32 or of 64 bits).

Immediately after the announcement made by Microsoft, Mister James Hall, a programmer and long time enthusiast of MS-DOS, posted a public manifiesto proposing the development of an open-source replacement for MS-DOS.

Within a few weeks other programmers joined the project, such as Mister Pasquale Pat Villani and Mister Tim Norman. Mister Villani undertook the creation of the kernel, and Mister Norman the creation of the Free-COM command line interpreter, composed of two independent executables: COMM8086.COM for Intel 8086 processor or compatible, and COMMAND.COM for later Intel x86 processors or compatible.

Thus the kernel, the command interpreters and several core utilities were created by putting together code that the members of the Free-DOS project had written themselves, or that they had found available.

The Free-DOS Kernel (printed book), by Pasquale Pat Villani
Miller Freeman, Emeryville, California, USA, 1996
ISBN 0-87930-436-7

That is how the PD-DOS project began, shortly later renamed as Free-DOS, and after that gradually better known as FreeDOS, without the hyphen between the words 'Free' and 'DOS'. Free-DOS grew to become the most mature DOS system.

Announcement of the PD-DOS Project, made by Mister James Hall in late June 1994, in Usenet Newsgroups:
comp.os.msdos.apps

Versions of Free-DOS

It will be observed in the list below that between the start of the project in late June 1994 and the first public release in January 1998, three and a half years had passed. The creation of a brand new and efficiently working operating system is not an easy quest, even for expert programmers of the quality of those who form The Free-DOS Development Team.

For twelve years there were several official distributions of Free-DOS known as 0.x Alpha or Beta versions, before the release of Free-DOS version 1.0 in September 2006. A distribution of Free-DOS called GNU/DOS was discontinued after the release of Free-DOS version 1.0

Given below is the version number beginning with 0 or with 1, the status of development (ALPHA, BETA or FINAL), the code name by which it was known (none, for several versions), very short notes in the case of versions 1.0 or 1.1, and the date of public release.

0.05 ALPHA, no code name, 12 January 1998
0.1 BETA, code name Orlando, 25 March 1998
0.2 BETA, code name Marvin, 28 October 1998
0.3 BETA, code name Ventura, 21 April 1999
0.4 BETA, code name Lemur, 9 April 2000
0.5 BETA, code name Lara, 10 August 2000
0.6 BETA, code name Midnite, 18 March 2001
0.7 BETA, code name Spears, 7 September 2001
0.8 BETA, code name Nikita, 7 April 2002
0.9rc1 BETA, code name Methusalem, July 2003
0.9rc2 BETA, no code name, 23 August 2003
0.9rc3 BETA, no code name, 27 September 2003
0.9rc4 BETA, no code name, 5 February 2004
0.9rc5 BETA, no code name, 20 March 2004
0.9 BETA, no code name, 28 September 2004
0.9sr1 BETA, no code name, 30 November 2004
0.9sr2 BETA, no code name, 30 November 2005
1.0 FINAL (live disk, without USB support), no code name, 3 September 2006
1.1 (like 1.0 without live disk, but with USB support), no code name, 2012
1.2 (expected to be released at the end of 2016)

By declaration of the Free-DOS Team Leader, Mister James Hall, Free-DOS version 1.1 is not radically different from version 1.0, it is just an enhancement of it. Version 1.0 can be boot-strapped from its compact disk (a feature known as 'live disk'), but in version 1.1 it is necessary to install into a hard disk or another boot-strappable storage volume. This limitation prompted many Free-DOS enthusiasts to continue using version 1.0 rather than 'updating' to version 1.1, to the point that the free download of 1.0 (which had been temporarily unavailable after the release of 1.1), returned to the Free-DOS Web document. The two versions are now available. Version 1.2 is expected to be released at the end of 2016, though since mid 2016 there are two unstable pre-releases available for testing purposes.

Mister Mateusz Viste, of Free-DOS, reports that there has never been a DOS system of 32 bits in existence. They are all of 16 bits. He warns that the number of bits must not be confused with the support for File Allocation Table. All DOS systems support FAT 12 (for floppy disk) and FAT 16 (for hard disk or other storage volumes, since MS-DOS 3.31 often found as FAT 16 B). Five DOS systems are known to support FAT 32:

-MS-DOS versions 7.0, 7.1, 8.0, which are versions of MS-DOS not intended as stand-alone DOS, but as part of Windows 95 (MS-DOS 7.0), Windows 95 B, 98, 98 Second Edition, Millennium Edition (MS-DOS 7.1), or versions of Windows based on NT (MS-DOS 8.0). Most versions of Windows based on DOS (except Millenium Edition) can boot-strap a real DOS (MS-DOS 7.x), without starting Windows. The other versions of Windows (those based on NT) can only show a dialogue box as 'command prompt', using the CMD.EXE executable (MS-DOS 8.x).

-PC-DOS since version 7.1 supports FAT 32

-DR-DOS since version 7.04 also supports FAT 32

-PTS-DOS 32, a stand-alone DOS made in Russia, likewise supports FAT 32

-The newest kernels (FAT 32) of any Free-DOS version (1.0, 1.1, 1.2) give full support to FAT 32, and are the most actively maintained as of 2016

A specific driver (for instance DOSLFN or LFNDOS) must be installed in any of the above versions of DOS for working with long data set names (VFAT system).

The main advantage of FAT 32 is the use of big storage volumes, because FAT 16 is limited to 2 Gigabytes. Although FDISK.EXE of Free-DOS can make partitions of up to 4 Gigabytes as FAT 16, most DOS executables will not be able to work with those partitions, including FORMAT.EXE or SYS.COM, thus being difficult even to install a DOS system in a FAT 16 partition sized over 2 Gigabytes.

The main disadvantage of FAT 32 is that some executables work only with FAT 12 or FAT 16, but not with FAT 32. Some work-round is often possible, such as the creation of a RAM volume (as FAT 16) for temporary operations, copying needed data sets to the RAM volume, processing them, then copying back to hard disk.

There is also a wishful project of Free-DOS 32 (of 32 bits) that has been in a sleeping condition for many years, without any visible activity. It has a small download available, but stupidly enough, the executable is made only for Microsoft Windows operating system and not for DOS. Ridiculous, to offer a supposedly DOS system whose first step requires a totally different system. Besides, what is available is not an operating system at all, it is only a data set system called 'LEAN' (by opposition to 'FAT'), invented by the team that is supposedly working on the Free-DOS 32 project. It looks like one more project whose users are only its inventors, if at all. In discussions amongst DOS enthusiasts there are those who believe that rather than making an effort for a DOS of 32 bits, it would be better to focus on DOS support to data set systems such as HPFS (IBM OS/2), FS (Minix), FFS (BSD), EXT2FS (Linux), NTFS (NT-Based Microsoft Windows), or other data set systems. Different people have different ideas on what constitutes a priority deserving more attention.

Considering that bad start, it is highly probable that such a project of a Free-DOS of 32 bits shall never become a reality. No need of it, because the traditional Free-DOS of 16 bits can be used for many purposes, including long names (VFAT emulation) when using appropriate software, such as the DOSLFN.COM of Herr Henrik Haftmann, which is included in the Free-DOS distribution. Of the command interpreters included in Free-DOS, the newest versions of Free-COM show long names by the /LFN switch, but 4DOS.COM needs a real VFAT data set system, it does not normally work with just a long name driver in FAT 12, FAT 16 or FAT 32. A Free-DOS of 32 bits would require a complete re-writing of the kernel, and many current executables would not work with a kernel of 32 bits, probably even using DOS extenders. Some important DOS executables, such as DEFRAG.EXE, do not even work with FAT 32 in the current Free-DOS of 16 bits.

Distributions

Free-DOS version 1.0 is available for download in at least four known distributions of software.

From the official Free-DOS HTML document in the World Wide Web there are two distributions of software, listed immediately below.

Blair Campbell distribution, CD-ROM image 'Base Disk':
A boot-strappable 'live' compact disk, image in ISO 9660 format, with the current kernel and a number of programmes considered 'basic' for working with Free-DOS.

Blair Campbell distribution, CD-ROM image 'Full Disk':
A boot-strappable 'live' compact disk, image in ISO 9660 format, with five kernels and many more programmes, such as games, network software, programming software, or third party programmes with permission for inclusion in Free-DOS.

Versions with source code of the distributions contained in those two compact disks are also available. They may be downloaded via BitTorrent, FTP or HTTP from hyper links provided in this page of CSS Dixieland.

From private HTML documents in the World Wide Web there are at least other two distributions of Free-DOS or of software for it.

Odin distribution:
A boot-strappable floppy disk, which contains the current kernel and a few 'basic' programmes for working with Free-DOS. The Odin distribution is also included in a directory of the compact disk distributions listed above.

Fuzoma distribution:
A boot-strappable floppy disk, with the main purpose of enabling old computers to be used as learning tools for children. Uniform Resource Locator below.

FUZOMA Educational Software
Enabling old computers as learning tools for children
http://superkeen.com/peacecorpsweblog/learning-software/

 

Commercial or non-commercial uses

Free-DOS is used by several commercial companies:

Dell includes Free-DOS with the n-series desktop computers. The firm has been criticised for making those computers more expensive than identical computers with Windows systems installed in them. Of course, such a criticism assumes Windows to be somehow better than DOS, and therefore Windows of justice more expensive. A regrettable and false assumption, which is precisely what the enthusiasts of DOS are prepared to contest: to flame anyone who dare suggest that DOS be not a better system than Windows. In addition, Dell often offers Free-DOS systems installed in computers with advanced features such as dual core processors, which Free-DOS cannot use in their full potential, although theoretically a DOS extender could use dual core processors.

Hewlett Packard provides Free-DOS as an option to dc5750 desktop computers, and to Mini 5101 netbook and Probook laptop portable computers.

ASUS uses Free-DOS to let users boot-strap ASUS main board driver compact disk to create the SATA device driver disk, needed for Windows versions before Windows XP SP2.

SpinRite 6 of Gibson Research Corporation, a hard disk drive maintenance and recovery programme, includes Free-DOS.

Seagate, in the Sea Tools for DOS, loads the Free-DOS kernel.

Solid-State Drive Firmware Update Tool of Intel loads the Free-DOS kernel.

 

Free-DOS is also used by many non-commercial, independent projects (one of them is Fuzoma, mentioned above).

Technical characteristics of Free-DOS

Compatibility: MS-DOS and Windows 32 console

Free-DOS is mainly compatible with MS-DOS. Of the Free-DOS kernels mentioned above, some emulate MS-DOS version 5.x while others emulate MS-DOS version 7.x, and the version number can be changed (for some executables that very foolishly expect a certain MS-DOS version, like if MS-DOS were the only DOS system in existence). A few executables made for MS-DOS are not immediately executable in Free-DOS, but some work round is often possible for executing them. SCANDISK.EXE is one of such executables, which by virtue of the Life Cycle Policy of Microsoft is now legally free for personal use (but not for distribution). Free-DOS includes CHKDSK, DOSFSCK, RECOVER, SPFDISK, and some other programmes that, considered as a whole, can offer similar functionality to what SCANDISK offers. Warning: using them incorrectly WILL destroy data. The documentation must be read ALWAYS, even before attempting to execute them.

Free-DOS has several improvements relative to MS-DOS, mostly involving support of new standards and technical developments that did not exist when Microsoft ended support for MS-DOS in 1994, such as internationalisation, Advanced Power Management TSR (Terminate and Stay Resident in RAM), integrated ASPI, or USB (Universal Serial Bus). For USB, see another section below in this page. Free-DOS itself can use FAT 12, FAT 16 or FAT 32, but some programmes included in Free-DOS can only work with FAT 12 or FAT 16, not with FAT 32 (MS-DOS gave support to FAT 32 since version 7.1 of 1996, released with Windows 95 B, other DOS systems with support for FAT 32 are PTS-DOS 32 and some versions of DR-DOS and PC-DOS). See also the notes in this page about File Allocation Table.

Free-DOS supports .COM DOS executables, standard .EXE DOS executables, .BAT batch scripts (plus .BTM batch scripts, via 4DOS.COM), and Borland 16-bit DPMI executables (DOS Protected Mode Interface). It is also possible to run 32-bit DPMI executables using DOS extenders. With the use of HX DOS Extender, many Windows 32 console application programmes function properly in Free-DOS, as do some Graphic Interface programmes, such as QEMU or Bochs.

Compatibility: Windows 1.x, 2.x, 3.x

Windows 1.x, 2.x, 3.x are not properly speaking 'operating systems', they may be better considered graphic interfaces, originally executed on top of MS-DOS.

Free-DOS easily runs Microsoft Windows 1.x or Windows 2.x, and as for Windows 3.x (3.0, 3.1, 3.11, plus 3.2 for the Chinese market) and their corresponding versions of Windows For Work Groups, which have support for Intel 80386 and later compatible processors, they can be run in 80386 Enhanced Mode since the 'build 2037' of the Free-DOS kernel.

Compatibility: Windows 95, 98, Millennium Edition

Contrary to the Window systems seen above, Windows 95, 98, Millennium Edition are not just graphic interfaces executed on top of MS-DOS or of another DOS system, they are operating systems in their own right, which boot-strap from MS-DOS. The MS-DOS 7.0 of Windows 95, or the MS-DOS 7.1 of Windows 95 B and of Windows 98, can be started as DOS session only. With Windows Millennium Edition, however, a DOS-only session is not normally possible.

Those versions of Windows (95, 95 B, 98, Millennium) use a stripped down version of MS-DOS as a boot-strap loader. Free-DOS cannot be used as a replacement boot-strap loader, but it can be installed and used beside those systems using a boot-strap manager programme, such as the METAKERN included with Free-DOS. Problems running Windows from other systems result from the efforts of Microsoft to make their software un-executable in non-Microsoft DOS systems. This is true even for IBM-Microsoft PC-DOS.

Caldera versus Microsoft: the settlement
By Graham Lea, published in BBC News in January 2000
http://news.bbc.co.uk/2/hi/business/600488.stm

 

Compatibility: Windows NT, 2000, XP, 2003, Vista, 2008, Seven, Eight

Those operating systems are based on Windows NT, which in 1994 was originally intended as a server, more than as a desktop operating system.

They do not make use of MS-DOS as a core component of the system. Instead, they have a single programme known as CMD.EXE, which is all that has been left of DOS in them, as an atrophied relict emulator of the good old MS-DOS. CMD.EXE appears as a dialogue box 'command prompt' inside Windows. In old Windows versions it can occupy the whole screen by Alt + Enter, but in the new versions of NT-based Windows it remains limited to a part of the screen.

Those Windows systems can use FAT data set systems (FAT 12, FAT 16, FAT 32), which are used by MS-DOS and by Windows 95, 95 B, 98, Millennium Edition. However, Windows NT and its derived Windows versions typically use NTFS (NT File System) by default. Newer versions of Windows use only NTFS. Free-DOS can coexist with Windows NT in a separate partition of NTFS, or in the same partition of FAT systems. The Free-DOS kernel can be boot-strapped by adding it to the Windows NT Boot Loader configuration script, BOOT.INI

Compatibility: React OS

Much of what has been explained for the Windows NT series is also valid for the React Operating System. The Free-DOS kernel can be boot-strapped by adding it to the React OS Boot Loader configuration script, FREELDR.INI

LBA, data set systems, drivers, executables, other features

LBA hard disks: depending on the BIOS used, as many as four LBA hard disks are supported by Free-DOS, each of up to 128 Gigabytes in size (even of 2 Terabytes, in an ideal scenario). Care is recommended when using disks of sizes beyond 32 Gigabytes, because so far there has been little testing of Free-DOS in them. Some BIOS (firmwares) support LBA, but they produce errors with disks of bigger size than 32 Gigabytes. A driver such as OnTrack or such as EzDrive resolves this problem.

File Allocation Table: FAT 12, FAT 16 or FAT 32 are all fully supported by Free-DOS, even boot-strapping from any of them. By comparison, stand-alone versions of MS-DOS supported FAT 12, later also FAT 16, but never FAT 32. The support for FAT 32 in MS-DOS began only with MS-DOS 7.1, which was part of Windows 95 B, in the year 1996 (PTS-DOS 32 and some versions of DR-DOS and PC-DOS also support FAT 32). Three out of the five Free-DOS kernels contained in the official full distribution of Free-DOS 1.0 are compatible with MS-DOS 7.1, those three kernels work with FAT 12, FAT 16 or FAT 32. The other two kernels are compatible with MS-DOS 5.0, those two kernels work with FAT 12 and FAT 16, but not with FAT 32. In Free-DOS, as in other systems, FAT 12 is used only for floppy disks, FAT 16 or FAT 32 for hard disks or other storage volumes. The current version of FAT 16 is FAT 16 B, since the mid 1980's.

Warning: Some important executables included in Free-DOS, such as DEFRAG.EXE, work with FAT 12 or FAT 16 but not with FAT 32, therefore any volumes on which those executables must be used should not be formatted as FAT 32, but better as FAT 16 for hard disks or similar volumes (for floppy disks always FAT 12). An alternative solution might be to format the hard disks (or other storage volumes of high capacity) as FAT 32, then create during the DOS session a virtual volume in Random Access Memory (which is formatted as FAT 16), then copy to the RAM volume whatever directories or data sets need to be processed by DEFRAG.EXE or another executable unable to work with FAT 32, and after processing those directories or data sets, finally replace them in their original locations or in new ones.

That solution, however, requires enough Random Access Memory for a virtual volume of sufficient space, it is only a partial solution (valid for a few directories, difficult or impossible for an entire hard disk), it is rather complicated, and it is prone to disaster of losing valuable data if a power interruption or another accident occur in the process. Such a solution ought to be applied only if completely unable to work in FAT 16, for instance in a huge hard disk with LBA access. FAT 16 is definitely preferable with hard disks of small capacity, and may be possible or recommendable with hard disks of medium capacity. Only for hard disks of big capacity should FAT 32 be considered, especially if being limited of Random Access Memory for the creation of a virtual RAM volume with the necessary space.

Long Names (VFAT file system): Free-DOS can be used with the DOSLFN driver, which supports Long Names, but most old DOS programmes cannot support Long Names even with the driver loaded. The EDIT.COM text editor of MS-DOS can do it, which makes possible the creation, renaming or modification of ASCII documents with Long Names, directly from the text editor, although it can also be done from the DOS command line. Also EDIT.COM of MS-DOS can work with long names after having loaded DOSLFN, but EDIT.EXE of Free-DOS cannot do it. Free-COM COMMAND.COM, the default command interpreter of Free-DOS, has a DIR command with the /LFN switch for listing long names, if any, with their short name equivalents. 4DOS.COM, however, needs a real VFAT data set system for handling long names, it does not normally work with just a long name driver in FAT 12, FAT 16 or FAT 32

FFS, FS, EXT2FS, NTFS: Free-DOS has no plans of support for FFS (version two is now typical of BSD), neither for FS (version three is currently typical of Minix), nor for EXT2FS (typical of Linux), or for NTFS (typical of NT-based Windows), but there are some external third-party drivers available for that purpose. The LTOOLS collection (a counterpart to the MTOOLS collection of Unics systems) can be used to access EXT2FS, so as to copy data to or from EXT2FS storage volumes. However, it is important to note that the LTOOLS collection works with Linux but not with Minix, nor BSD, nor most other Unics systems, due to the fact that Minix, BSD and most of the other Unics use by default a data set system (FS or FFS), different from the data set system used by Linux (EXT2FS). See in the CSS Dixieland page on Unics a solution for working with Free-DOS from Minix or BSD, using a Free-DOS storage volume or partition (slice), and making it visible to BSD (or to another Unics) by a mount point formatted as DOS. Or from Minix, by using the executables 'dosdir', 'dosread', 'doswrite'. NTFS support in DOS is provided by software such as NTFSDOS or NTFS4DOS.

Some of the most important software available in Free-DOS

HIMEM, EMM386, memory managers for XMS (Extended Memory), or for EMS (Expanded Memory, Lotus-Intel-Microsoft 3.2 or 4.0 specifications). More details on those important memory managers are given farther below in this page.

-Several text editors or viewers, EDIT, EDLIN, PG, others:

EDIT.EXE, default text editor of Free-DOS. EDIT.EXE is a clone with some added features of EDIT.COM, the default text editor of MS-DOS, but EDIT.EXE of Free-DOS has three important limitations:

EDIT.EXE cannot open documents over 64 Kilobytes (while EDIT.COM of MS-DOS can open well beyond the Megabyte, if having enough Random Access Memory and enough storage space for temporary swap copy).

EDIT.EXE uses mostly Windows key strokes (while EDIT.COM of MS-DOS uses traditional DOS and Word Star key strokes, which means uninterrupted fluency for fast typists used to work in DOS).

EDIT.EXE cannot work with long names, even if having loaded in Random Access Memory a long name driver such as DOSLFN.COM (while EDIT.COM of MS-DOS will create or will open documents with long names, if using a long name driver).

EDLIN, line text editor, small but powerful if correctly used.

PG, advanced text viewer, similar to LIST.COM of Vernon D. Buerg and to the command LIST of 4DOS.COM command interpreter.

 

There are other text editors in Free-DOS, including a DOS port of GNU Emacs called Freemacs (Free Emacs), and a variant of Vi called Vim (Vi Improved), also ported to DOS. Emacs and Vi are the two text editors most commonly used in Unics systems. The Freemacs port to DOS lacks the interpreter of LISP programming language that is included in the original GNU Emacs for Unics (and in the X Emacs variant for Unics), but Freemacs uses MINT language instead. The original Vi is still commercially protected, for which reason several free variants were developed by different programmers in the course of many years, such as Nvi (New Vi, used in BSD and more recently also in Minix), Calvin, Elvis, Vile, X Vi, the above mentioned Vim, and some others. View is a read-only interface of Vi, Ex is a line editor interface of Vi. Ed is another line editor. The simple Ee (Easy editor), not derived from Vi, tends to be used by beginners in Unics, who may prefer to avoid the cryptic commands of the much more powerful Emacs, Vi, and their respective variants.

The documentation of Vim for DOS is exhaustively complete (the best documented text editor in Free-DOS), but it is a verbatim copy of the Vim for Unics. It has not been modified for DOS, which means that many features are unusable in DOS. It is necessary a working knowledge of Unics for efficient work with the Vim for DOS, for being aware of what can and what cannot be done in DOS. That is a typical problem of many softwares ported from one operating system or architecture to another, the lack of an adapted documentation. Besides, Vim asks for a voluntary donation to a philanthropic project in Africa. Freemacs does not expect such contributions, but by compensation, the 'documentation' of Freemacs does not explain anything for working with the editor. The typist is on his own, trying to discover the meaning of a list of cryptic commands.

The other text editors in Free-DOS are of rather dubious value. Ospedit is unworkable, and Setedit has a tendency, when opening more than one editing window, to copy text from one document to the bottom of another document. That is clearly a programming error, and cannot be corrected by the typist. It can only be avoided by opening just one window at a time, which seriously limits the efficiency of the editor for complex work with various documents. Setedit is a good editor in other aspects, thus it can be used with some care.

The Basic language interpreter Bywater Basic can be used as a simple line editor. The IDE of Free-Pascal, Arachne Internet client, and some other executables, can be used as page editors. Those softwares are not intended primarily as text editors, and therefore their resources for working with text are limited, but if necessary, it is good to know how to work with them. Even the COPY CON: command can be used for creation of simple text documents. Instructions for that are given in the Appendix near the bottom of this page, as 'COPY CON:'.

Conclusion: there is no 'best editor', in Free-DOS, in Unics, or in any other operating system. If having more than one editor, chances are that all of them will find partisans, even to the point of indulging in never ending 'holy wars'. From the simple COPY CON:, to the complex Vi or Emacs and their variants, and everything in between, it all depends on the preferences and working style of the individual computer operator. Those of us who work with text extensively, well know the virtues and defects of all those softwares.

FDAPM, APM info, control, suspend, poweroff, boot, ACPI throttle, HLT energy saving. FDAPM also permits to diminish the speed of a processor, in order to use old DOS programmes that would run too fast in a modern processor. Typical speeds of the 1980's were in the range of Megahertz, but as of 2016 they are measured in Gigahertz, which makes it impossible, for instance, to play old DOS games, no matter how good the player. SLOWDOWN, SLOWINT1 or CPUCACHE of Mister Bret Johnson, included in Free-DOS, can also be used for that purpose.

Several boot-strap managers exist. For computers that have more than one operating system available, a boot-strap manager allows to choose either Free-DOS or another of those systems at the time of boot-strapping. However, a boot-strap manager IS NOT a virtual machine (like for instance VM Ware is), therefore a boot-strap manager does not allow to change from one system to another in the active session. The computer must be re-started for changing to another operating system (in Free-DOS, FDAPM can be used for re-starting).

XOSL, fully graphic boot-strap manager (all other boot-strap managers available in Free-DOS are partly graphic or entirely driven by command line).

SPFDISK and XFDISK, partly graphic partition and boot-strap managers.

FDISK, partly graphic or command line partition and boot-strap manager. Warning: the Boot Easy boot-strap manager included with FDISK presents problems. Its use is strongly discouraged by the author of FDISK. Any of several other boot-strap managers available in Free-DOS can be used instead.

BOOTMGR, command line boot-strap manager, with many features.

GRUB, boot-strap loader, with several ancillary executables.

METAKERN with METABOOT and their ancillary executables, boot-strap loaders. They work by replacing KERNEL.SYS (or another appropriate Free-DOS kernel) by a combined kernel that includes the Free-DOS kernel and the boot-strap sector of another operating system (typically another DOS). There are two different methods for doing those operations, the documentation must be read CAREFULLY. Either method assumes a good knowledge of DOS systems. Not for DOS beginners.

For external volumes such as floppy, compact, or digital video disks, Free-DOS has software for various purposes, part of which is listed below.

XDMA and XDVD, UDMA drivers for hard disk or for DVD player.

XCDROM, driver for CD-ROM.

LBACACHE, cache for hard disk or floppy disk.

SHSUCDX, used to access compact disk (in lieu of the MSCDEX of MS-DOS).

MPXPLAY, mp3, ogg, wmv interface player, with built-in AC97 and SB16 drivers.

Software for other uses comes next. The list is far from complete.

SHSURDRV, creates several RAM volumes of fixed size, up to 4 Gb each

SRDISK + SRDXMS, create only one RAM volume but resizeable, up to 4 Gb

JLM, possibility of writing 32-bit protected mode drivers Jemm Loadable Module.

CUTEMOUSE, mouse driver with scroll wheel support.

7ZIP, INFO-ZIP, BZIP2, ZIP, UNZIP, archivers, compressors-expanders.

GRAPHICS, screen shot, for grey scale hardcopy in ESC/P, HP PCL, Post Script printers.

FDUPDATE, update installer. Mister Mateusz Viste indicates that FDUPDATE is not currently used in Free-DOS. Instead, the far superior FDNPKG is used at present. The Uniform Resource Locator of FDNPKG is part of Source Forge:

FDNPKG
Update installer for Free-DOS, in lieu of FDUPDATE
http://fdnpkg.sourceforge.net/

 

FDSHIELD.COM, tries to prevent malicious executables, scripts, or operator errors, from tampering with the boot-strap sector or the operating system, destroying data, or playing other 'jokes' of bad taste. FDSHIELD scans for possible viri, worms or Trojan horses by monitoring some potentially risky or threatening activities, which can be defined by command line switches when loading FDSHIELD into Random Access Memory. Cache writes must be flushed to storage volume often, because FDSHIELD may halt the session with no more than 20 seconds of warning, losing possibly valuable work. Known safe software, if foreseen to be needed for the DOS session, must be loaded or executed before loading FDSHIELD. That warning includes FDISK, FORMAT, SYS or similar low level access executables, and most 'Terminate and Stay Resident' software.

FDSHIELD cannot be unloaded, the session must be re-started without FDSHIELD if necessary. FDSHIELD is the work of Mister Eric Auer, and its very well explained documentation has been written by Mister Walt Gregg. IT MUST BE READ COMPLETELY BEFORE USING FDSHIELD, otherwise undesirable things might happen. Fortunately, malicious codes for DOS systems are not as common in 2016 as they were in the 1980's and early 1990's, but some may still lurk in vintage software. A novice computer operator in need of performing frequent downloads or updates through a network or another medium, should protect his system with FDSHIELD, TBAV, VSAFE, VWATCH, or another anti-malicious software (of them, only FDSHIELD is included in Free-DOS, the others were commercial).

BitTorrent client.

Many text mode programmes ported from Linux to DOS, thanks to DJGPP Delorie.

Translators or interpreters for computer languages:

-For Assembly:

WASM Wolfware Assembler, very well documented (not to confuse with Watcom Assembler, which is not available in Free-DOS).
FASM Flat Assembler, acceptably documented.
ASM Arrowsoft Assembler, poorly documented.
NASM Netwide Assembler, no documentation at all.

-For Basic:

Bywater Basic interpreter, similar to Microsoft QBasic (there is another implementation of Basic programming language called 'BWBasic', unrelated to Bywater Basic). Bywater Basic implements a superset of the X3.60 specification of 1978, the ANSI Standard for Minimal Basic, and a significant subset of the X3.113 specification of 1987, the ANSI Standard for Full Basic. It also offers shell programming facilities as an extension of Basic. Bywater Basic seeks to be as portable as possible. It does not support the function PEEK() or the command POKE to address memory locations, because those features are system specific. For the same reason, VARPTR or DEF SEG are not supported either. Line numbers are optional in Bywater Basic. The Bywater Basic source is written in C language. Bywater Basic can be used as a line text editor, for creation or modification of text documents.

Free-Basic translator, a 32-bit Basic compiler for many platforms, similar to Microsoft Quick Basic. Free-Basic has ports for DOS, Linux, Windows, and other operating systems. The DOS port needs DOS Protected-Mode Interface (using CWSDPMI, HDPMI16 or HDPMI32, available in Free-DOS). Free-Basic only supports Latin character set, and does not support Unicode. It includes GDB.EXE, the GNU debugger. Free-Basic does not support the command POKE to address 16-bit absolute memory locations, because that feature is system specific, but the statement POKE and the function PEEK() are supported. For the same reason, DEF SEG is not supported either, but VARPTR is supported by Free-Basic (by comparison, Bywater Basic does not support any of them). Line numbers are optional in Free-Basic. It accepts source of up to 2 Gigabytes in size. Free-Basic allows in-line Assembly, Intel syntax. The Free-Basic source is written in Free-Basic (therefore it can translate itself). Mister Von Godric has created FBIDE, an Integrated Development Environment for Free-Basic.

-For BAT (interpreted) batch scripts:

Free-COM COMMAND, command line interpreter, supports completion of names.
Free-COM COMM8086, command line interpreter, for Intel 8086 or compatible.
DOG, command line interpreter, with two-letter command names inspired on Unics.

-For BAT (interpreted) or BTM (translated) batch scripts:

4DOS, enhanced command line interpreter, with many features and excellent documentation. 4DOS is the most advanced command line that exists for DOS. Note: Arachne Internet client does not show volumes, directories or data sets under 4DOS, because that function is done by the executable WWWMAN.EXE (not by CORE.EXE). Free-COM can be used for the purpose, or also shelling to DOS and using normal DOS commands, then returning to Arachne by entering 'exit' at the prompt, but Arachne works well under 4DOS in most other aspects.

-For C language:

Pacific C translator, with Integrated Development Environment.

Watcom C translator, very used at present (there is a Watcom Assembler, which as of the latest information available to us, is not included in Free-DOS).

DJGPP translator, produced by D. J. Delorie and also very used at present.

The inclusion of Watcom C and of DJGPP in this list has been possible thanks to the advice offered by Mister Mateusz Viste, of Free-DOS, to CSS Dixieland.

-For Hyper Text Mark-up Language, interpreters Arachne, Lynx and HTMLHELP:

Arachne, graphical Internet user agent, on-line or off-line viewer. Arachne is the most advanced Internet user agent for DOS (Caldera Web Spyder is derived from Arachne). It uses WWWMAN.EXE (included in the distribution) for showing and accessing from inside Arachne the directories and data sets that exist in different storage volumes (floppy disks, hard disks or their partitions, USB devices, compact disks, RAM volumes, et cetera). However, WWWMAN.EXE cannot work with 4DOS.COM command interpreter, therefore for using Arachne as a data set manager, it is suggested to start Free-COM COMMAND.COM as primary or as secondary command interpreter. Alternatively, it is possible to shell to DOS from inside Arachne, look at the directories or data sets by normal DOS commands, and return to Arachne by entering 'exit' at the prompt.

Arachne has full support for the protocols HTTP-HTML, Mailto (POP3, SMTP), Finger and FTP, plus a limited support for Gopher. By means of external software, Arachne can perform Telnet and IRC sessions. Arachne interprets a good part (though not all) of HTML 4.01 and also of CSS 1.0 instructions, in data sets of up to about 1 Megabyte, or it can show ASCII plain text in data sets of up to about 3 Megabytes. Arachne has full support for images in GIF (Compuserve) format, partial support for BMP format (the Windows variant, not the IBM variant). Arachne uses DJPEG.EXE (included) to convert from JPG to BMP or to GIF, and JPNG2BMP.EXE (included) to convert from PNG to BMP.

Arachne can use PLANY.EXE (included) for sound through Sound Blaster in audio formats: VOC (Sound Blaster), MOD, 8SVX, IFF (Amiga), AU (Sun, NeXT, DEC), SND (Sounder, Soundtools), WAV (Windows). It can also use SPKRWAV.APM (not included) for sound through the computer speaker, QV.EXE (not included) for MP3 audio or MOV, AVI video, VMPEG.EXE (not included) for MPG video. Using MAILMAN.EXE (included), Arachne can convert electronic post messages to HTML. It can detect UUencode (Unics), BINHEX (Macintosh), and work with any MIME 1.0 type using a built-in DGI. Arachne does not support Java Applets, nor Java Script. The user agent is well documented, and with an active community of users who help other users by means of a posting list of free subscription.

DOS Lynx, text-only (not graphic) Internet user agent, on-line or off-line viewer for CSO (PH QI), Finger, FTP, Gopher, HTTP-HTML (WWW), NNTP (Usenet), POP3, SMTP, WAIS, X.500, and other protocols. Being originally from Unics, DOS Lynx needs extensive reconfiguration for Free-DOS. DOS Lynx needs a packet driver, even for opening local documents, and oddly enough no network packet driver has been included in the distribution of DOS Lynx. Only a fake packet driver called Nullpkt is indicated in the documentation for opening local documents, but not included in Free-DOS. Besides this serious limitation, DOS Lynx needs almost 600 Kilobytes of Low Memory, which may imply the need of boot-strapping the DOS system with less than 40 Kilobytes, out of the 640 Kilobytes of maximum executable programme size in the Megabyte of Low Memory that can be directly accessed by DOS in Real Mode. It means that most other softwares cannot co-exist with DOS Lynx in Random Access Memory.

HTMLHELP (stored as HELP.COM or HELP.EXE), off-line textual HTML viewer, can read directly from a document previously compressed by Zip algorithm. Limited to documents of maximum 64 Kilobytes. It only supports a few HTML entities.

-For Gopher Protocol:

Gopherus is the best user agent for accessing Gopher documents from DOS. Its colours can be fully customised, if using polychrome screen and video card. They can even resemble the classic phosphor cathodic ray tube screens of the 1980's. Gopherus follows the official Gopher Standards RFC 1436 (The Internet Gopher Protocol) and RFC 4266 (The Gopher URI Scheme). Gopherus needs a packet driver loaded in Random Access Memory. There are ports of Gopherus for DOS, BSD, Linux, and Microsoft Windows Operating Systems.

-For MINT (similar to LISP):

Freemacs (Free Emacs) text editor.

-For Pascal:

Free-Pascal translator, with Integrated Development Environment. Free-Pascal is poorly documented in Free-DOS (and the I. D. E. is almost undocumented), but for the experienced programmer Free-Pascal offers many features. Those features are only mentioned in the distributed documentation, the details are left for download from the Free-Pascal Internet host-server. The documents assume a DEEP knowledge of Pascal programming. They are not tutorials for the beginner. They are available in the formats HTML (Hyper Text Mark-up Language), ASCII (American Standard Code for Information Interchange) 7-bit plain text, PDF (Adobe Portable Document Format) or PS (Post Script) at the Uniform Resource Locator:

Free-Pascal
Translator for several platforms, with Integrated Development Environment and Assembly support
http://www.freepascal.org/

 

Free-Pascal is available for the microprocessors Intel 80386 or compatibles, AMD 64, Motorola Power PC and Sparc, and for the operating systems BSD (several variants), Linux, Macintosh (Classic and Darwin), IBM OS/2 and Microsoft Windows. An old version called FPK-Pascal is available for Commodore Amiga. A port to Be OS is being made, and to some BSD variants. There is a port included in Free-DOS, using the Go32 version 2 DOS extender of D. J. Delorie. The dialect of Free-Pascal is almost like that of Borland Turbo Pascal and of Delphi Pascal, with some similarity to Macintosh Pascal. Free-Pascal is written in Pascal and can translate itself. The resulting executables made by Free-Pascal are of HUGE SIZE by default, but they can be made about a fourth or a fifth of that size by using any or all of the following switches in the command line:

-Og (Small size. Slower execution, but still fast in DOS)
-Op1 (Intel 80386, 80486 or compatibles. Default is Pentium)
-Sg (Allowing LABEL or also GOTO instructions in the source)
-Xs (No symbols in executable. No easy debug, but small size)
-XX (Smart linking, and consequently small size)

Free-Pascal supports in-line Assembly, by default with AT & T syntax (as in GNU-Pascal), but Free-Pascal can be instructed to accept Intel syntax (as in Borland Turbo Pascal), and it can translate from a Pascal source to a workable Assembly source for GAS (GNU Assembler), MASM (Microsoft Assembler), NASM (Netwide Assembler), TASM (Borland Turbo Assembler), or WASM (Watcom Assembler, not to confuse with Wolfware Assembler). Of those assemblers, only NASM (Netwide Assembler) is available in Free-DOS, but without documentation. Free-Pascal can produce executable machine code, native in DOS or in IBM OS/2 operating systems. As said above, Free-Pascal is an excellent choice for the experienced programmer, but also a ban for the beginner. There are Pascal tutorials in Internet, albeit attention must be paid to dialectal differences. Pascal has not so many dialects as Basic, but some of them it has. Free-Pascal was started by Herr Florian Klaempfl, Germany.

Programmers looking for portability might do better in choosing GNU-Pascal (not distributed in Free-DOS), rather than Free-Pascal. The reason is that GNU-Pascal follows several Official Standards:
-'Portable Operating Systems Interface for Computer Environments' (often abbreviated as POSIX) of the Institute of Electrical and Electronics Engineers (IEEE).
-ISO 7185 and ISO 10206 of the International Standards Organisation (ISO).
-Most of Borland Turbo Pascal 7.0 (proprietary, not official standard).
By contrast, Free-Pascal follows only Borland Turbo Pascal, which is not an official standard, it is only a proprietary dialect created by a private corporation. GNU-Pascal supports in-line Assembly, AT & T syntax. GNU-Pascal, however, is not written in Pascal but in C language, therefore it cannot translate itself. GNU-Pascal was started by Herre Jukka Virtanen, Finland.

GNU-Pascal
Translator for many platforms, with Assembly support. Official Standards IEEE POSIX, ISO 7185 and ISO 10206
http://www.gnupascal.org/

 

Basic (since the 1960's) and Pascal (since the 1970's) are two programming languages used until today. They have respectively passed of fifty and forty years of age as of 2016, and they continue with enthusiasts. Another option worth considering is the Ada language. In 1843 Lady Ada Augusta Countess of Lovelace enlarged a description (written by an Italian mathematician) on the Analytic Calculator of Mister Charles Babbage. Lady Ada was thus the first person to offer a detailed explanation of what is now known as 'coding' or 'programming'. Her work was not carried beyond the pure theory (the first practical language came exactly a hundred years later, the 'Plan Kalkul' of Herr Konrad Zuse in 1943), but with her pioneer effort, Lady Ada is now considered the first computer programmer in History. Ada, the Universal Programming Language, was created in 1979 by the United States Department of War, in a similar way to the creation of Cobol twenty years earlier. In 1981 Ada became official standard for all military applications in the United States.

Ada is based on Pascal, combined with other languages, and considered the most advanced programming language ever created. It was intended as a lingua franca of programming, applied also to scientific or commercial purposes and to computing systems. Since the 1990's Ada is easily available in Internet in the usual form of translators, debuggers, official specifications, tutorials, and other tools that programmers need for efficient work. One advantage is that Ada has only a few versions and they are backward compatible: Ada 83, Ada 87, Ada 95. By comparison, Pascal has some dialects, and Basic has many dialects, which are not compatible at all. Ada includes support for object oriented programming, protected types, and many other features. Like Pascal, Ada forces the programmer to a 'military discipline' that some people dislike, but which encourages correct habits. As of 2016 there is a free GNU-Ada, some Web documents entirely devoted to the Ada language, and other resources that facilitate Ada to the serious programmer. The main hyper link is given below.

Ada Power
Resources for Ada, Universal Programming Language
http://www.adapower.com/

 

-For Rexx:

Regina Rexx interpreter

Emulators of DOS in other operating systems:

DOSBox: dialogue box to call DOS in Windows 95, 95 B, 98 or Millennium, and to emulate DOS (by CMD.EXE) in Windows NT series or related systems.

DOSEMU: emulator of DOS in BSD, GNU Hurd, Linux, or other Unics systems.

Universal Serial Bus

Free-DOS version 1.1 includes resources that do not exist in version 1.0, of which the most useful is perhaps the support for Universal Serial Bus. It is, however, only a partial support. Its programmer, Mister Bret Johnson, has been unable to obtain permission for including in the official Free-DOS distribution the USB drivers for DOS that Panasonic Japan has had available for years at its Web document in Japanese language. The drivers are publicly available, but Panasonic intends them for being used in Panasonic products. Nonetheless, Mister Johnson has written an extremely long and well composed document, included in the Free-DOS 1.1 distribution, which explains in detail all that there is to know about USB. A courageous soul might thus embark into the difficult task of programming USB drivers for DOS, thus hopefully siding with Mister Johnson and helping the Free-DOS Project.

Many modern mother boards contain BIOS settings for Legacy USB support, which allows USB devices to be used in operating systems that lack support for them (such as Free-DOS version 1.0). This applies to mice or other pointing devices or to keyboards, and some BIOS can even support storage devices. Some external DOS USB drivers for storage devices work in Free-DOS with some effort and luck, such as DUSE, USBASPI or USBMASS. There is also DOSUSB, which offers an API and supports storage devices, printers, or serial adapters. An alternative to running DOS programmes for USB devices is running DOSBox, mentioned above, which recognises USB devices from the host operating system to act as if they were legacy port devices. For instance joy sticks with game ports, printers with parallel ports, or USB flash memory volumes, would act in DOS as if they were a hard disk. However, DOSBox requires to be executed from an operating system with a graphic interface and with support for USB, thus difficult in Free-DOS, because it would take us back to the problem of USB drivers for DOS and because the only graphic interface in Free-DOS is the rather simple GEM.

Information on all known possibilities for Universal Serial Bus to work in DOS is contained in the following documents:

Boot Disk
Four Methods for USB Volume Drives to work in DOS
http://www.bootdisk.com/usb.htm

 

Boot-strapping

Free-DOS can be boot-strapped from a floppy disk, from a hard disk, from a live compact disk, or from a USB flash memory volume.

Free-DOS can also be run using virtualisation software such as Virtual PC or Virtual Box, or using emulation software such as Bochs or QEMU.

To use the Windows Boot-strap Menu the following line can be added to BOOT.INI:

[volume:[path]]FDOSBOOT.BIN="FreeDOS"

To boot-strap using GRUB, the following lines (or something similar) can be added to MENU.LST:

# Any title that you want
title Free-DOS
# 'x' is device, 'y' the partition (slice) where Free-DOS is located
root hd(x,y)
# Boot-straps the boot-strap loader of Free-DOS, optionally keeping
# the name of the kernel as KERNEL.SYS (the name can be changed)
chainloader /kernel.sys

How to Create a Bootable Free-DOS Floppy Disk
Published by Linfo, July 2005
http://www.linfo.org/freedos_floppy.html

 

Install Free-DOS without CD, floppy, USB or any other removable medium
By Marc Herbert, October 2004
http://marc.herbert.free.fr/linux/freedos_no_removable.html

 

Memory management

Free-COM, the default command interpreter of Free-DOS (stored with the name of COMMAND.COM), can move portions of itself into extended memory in order to free low memory for programmes, which can then find available for them up to 620 Kilobytes. This is useful for old DOS programmes that can only use low memory (they cannot use extended or expanded memory).

The main memory management programmes included with Free-DOS are HIMEM.EXE for providing extended memory (XMS), and EMM386.EXE for providing expanded memory (EMS), for old software executed in real mode. For preventing conflict with MS-DOS, EMM386.EXE can be renamed for instance FDEMM386.EXE, or it can be moved to another directory and be called thence at boot-strap. HIMEM.EXE does not present such a conflict, because in MS-DOS it is not an executable, but a driver called HIMEM.SYS

EMM386 also supports VCPI, which allows DPMI kernels and DOS extenders to coexist with it. Free-DOS also contains an UDMA driver for fast disk access, which is also compatible with other DOS systems. The LBAcache disk cache stores recently accessed disk data in XMS for fast access and less direct disk access.

Free-COM command interpreter

Full list of commands for COMM8086.COM
and for COMMAND.COM version 1.15 of 2006

Command line interface interpreters of Free-DOS.

This information refers to Free-COM COMM8086.COM for Intel 8086 or compatible processor, and to Free-COM COMMAND.COM for Intel x86 or later compatible processors. Regarding COMMAND.COM, part of the information refers to version 0.82 pl 3ak of August 2004, version 0.83, or version 0.84 pre 2 of August 2006.

After permission kindly granted by their respective legal holders, the full official distribution of Free-DOS includes two other command interpreters and a full featured command line editor:

4DOS.COM, advanced command interpreter with many resources.

DOG.COM, command interpreter with keywords inspired on Unics.

CMDEDIT.EXE, command line editor with aliases and key assignment.

Sections in this page

  Introduction: Installation, features, prompt
  Free-COM COMM8086.COM
  Free-COM COMMAND.COM
  Command Line Editing: History
  Command Line Usage: Switches, Options
  Environment Variables
  EBNF, Extended Backus-Naur Formula
  Internal Commands of Free-COM
  Appendix
  Version history of Free-COM
  Download Free-COM
  CVS Resources
  Bugzilla bug hunter
  Kernel-supported Swapping
  Hyper links and references to Free-COM

 

Introduction: Installation, features, prompt

Free-COM is composed of two independent executables, by default stored in Free-DOS with the names of COMMAND.COM and COMM8086.COM, although the names can be changed. Free-COM is a command line interface, which can be used as a primary or as a secondary command interpreter, also known as a shell. The command interpreter is one of the most important components of an operating system, after the kernel and the Input-Output algorithm (in Free-DOS the Input-Output algorithm is contained within the kernel, in most other DOS systems it is separated).

Free-COM has been spawned as part of Free-DOS, one of the most advanced and sophisticated DOS operating systems that exist or have existed, and which aims to implement everyone of its parts licenced for free use, under the GNU General Public Licence or under other licences spousing a similar spirit. The Uniform Resource Locator of Free-DOS is:

http://www.freedos.org/

The above Uniform Resource Locator contains a sample description on "How to compile Free-COM in ten steps", informing of the procedure and options for translating the source programme of Free-COM into its executable. A Free-COM executable with default options is included in every distribution of Free-DOS.

The main duty of Free-COM is to prompt the human operator for entering commands at the command line, a line also known as the "prompt", because the command interpreter prompts (requests) the operator for giving commands (instructions), to which the computer must take some action.

The command line is the most efficient, flexible and fast way for interacting with the computer. A maven of the command line can perform impressive feats, much beyond what is possible by using funny graphic interfaces. Paraphrasing and inverting a well known advertisement of Apple Macintosh in 1984, much in the spirit of the futuristic story by George Orwell, the command line is FOR US (enthusiasts and deep connoisseurs of computers), while the graphic interface is 'for the rest of them' (the mass of ignorant people who use computers, perhaps on a daily basis or almost so, but who do not know how computers work).

When Apple released its graphic-interface Macintosh platform in 1984, the command line was the predominant way of interacting with a computer. A few graphic interfaces already existed before 1984, such as the Alto graphic interface of Xerox at Palo Alto Research Centre, which inspired OS/2 (graphic interface released by IBM in 1994), and some other graphic 'shells', but they were used by only a handful of people. The Windows graphic interface of Microsoft Corporation did not exist (it began in 1985, as a component of MS-DOS). By contrast, when Free-DOS version 1.0 was finally released in 2006, the graphic interface was already ubiquitous in the world of computers, and the command line had gradually become the domain of a handful of computer experts or enthusiasts.

Free-DOS includes the GEM Graphic Environment Manager (originally from DR-DOS) for those people who feel more comfortable interacting by means of a graphic interface, and some other graphic interfaces can also be used in Free-DOS, but the focus of Free-DOS is centred on the command line, as well as the focus of GNU Hurd, of most BSD systems (except PC BSD, which is graphic), of some Linux distributions, of some other Unics systems, and of a few other systems. Like the lovers of Free-DOS, also the lovers of those systems know the power that is hidden inside the command line.

The commands written at the command line are interpreted, then either they are processed directly by the internal commands of Free-COM, or they are executed as external commands, this is, as programmes that are not part of Free-COM, but which Free-COM can call for execution.

Non-internal commands, which cannot be processed directly by Free-COM, are called external commands because Free-COM will search for programmes equally named as they have been typed into the command line.

If specifying only the name of that programme, without specifying the type, then the priority (search order) of Free-COM will be COM, EXE, BAT inside the current directory, and again COM, EXE, BAT in each directory defined in the PATH environment variable, and finally the ALIAS list.

For instance, let us suppose that the data sets FROBU.COM, FROBU.EXE and FROBU.BAT be all in the current directory. By entering only:

FROBU [ENTER]

Then FROBU.COM will be executed. If wishing to execute FROBU.EXE or FROBU.BAT instead, then the type .EXE or else the type .BAT must be included at the command line, or from a batch process script. The same holds true for every directory included in the PATH environment variable, or for every conversion (expansion, usually) of an ALIAS to an executable command.

Besides implementing certain internal commands, Free-COM also offers some features that enhance the work with the computer.

Free-Com has been developed by many collaborators. It is separate from the DOS-C kernel of Free-DOS, and may or may not work properly under it. Every effort is being made for compatibility between the two, Free-Com and the DOS-C kernel of Free-DOS.

Installation

To use Free-Com, execute either COMM8086.COM or COMMAND.COM, or add this line near the end of FDCONFIG.SYS or equivalent start configuration:

SHELL=[ [vol:] \path] \shell name   /switches

For example, with Free-Com named COMMAND.COM, located in the FREEDOS directory of the C: volume, and optionally specifying by the /P switch a batch start process script named FDAUTOEX.BAT, then the line is:

SHELL=C:\FREEDOS\COMMAND.COM /P=FDAUTOEX.BAT

The /P switch also makes the shell permanent. As for the batch start process, without the /P switch it would receive the default name of AUTOEXEC.BAT, meaning that it could not coexist in the same directory of the same volume with another batch process equally named, but intended for another DOS system.

Features of Free-COM

Environment handling with prompt and path support

Support to load in high memory

Support to create aliases

Non-complete support for several languages

Batch processing

Flow control (IF, FOR, GOTO, labels)

Input or output with redirection and piping

Directory utilities

Command-line history, with features similar to the DOSKEY programme of MS-DOS, and with completion of names by the Tab key.

Long names, if having previously loaded a driver such as DOSLFN.COM

User Prompt

Free-COM knows two modes:

-Interactive mode

-Batch processing mode

The second one performs batch process scripts, which are more or less a sequence of commands written in a text document. Such documents may contain any external commands, internal commands, or calls to other batch process scripts. In a few instances, such as the definiton of variables, a command written in the batch process script is slightly different from a similar command written directly at the command line (at the prompt).

In interactive mode Free-COM prompts the human operator to enter a command. The line is interpreted, parsed, and finally either rejected because of an error, or executed.

There is below a short information on Free-COM COMM8086.COM, the rest of the page refers to Free-COM COMMAND.COM

Free-COM COMM8086.COM

Free-COM command interpreter of Free-DOS for Intel 8086 or compatible processor

Free-COM COMM8086.COM accepts the following switches:

COMM8086 [[vol:]path] [device] [/E:nnnnn] [/L:nnnn] [/U:nnn] [/P] [/MSG] [/LOW] [/Y [/[C|K] command]]

[vol:]path
Specifies the volume and directory containing COMM8086.COM

device
Specifies the device to use for command input and output

/E:nnnnn
Sets the initial environment size to nnnnn bytes, where nnnnn should be between 256 and 32768

/L:nnnn
Specifies internal buffers length in nnnn bytes, where nnnn should be between 128 and 1024 (requires /P as well)

/U:nnn
Specifies the input buffer length in nnn bytes, where nnn should be between 128 and 255 (requires /P as well)

/P
Makes the new command shell permanent, it cannot exit by the EXIT command

/MSG
Stores all error messages in memory (requires /P as well)

/LOW
Forces the command shell to keep its resident data in low memory

/Y
Steps through the batch program specified by the /C or the /K switch

/C command
Executes the specified command and returns

/K command
Executes the specified command and continues running

Default name of the command interpreter

As a secondary shell, COMM8086 can be directly executed with that name or it can be renamed. However, as a primary shell, the kernel of Free-DOS will by default look for a command interpreter named COMMAND.COM at the top level of the volume being boot-strapped. This default behaviour can be modified from FDCONFIG.SYS or equivalent start configuration, as explained above, but in this case with a line such as:

SHELL=C:\FREEDOS\COMM8086.COM /P=FDAUTOEX.BAT

Assuming in that example that COMM8086.COM be located inside the directory FREEDOS of volume C:, and making COMM8086.COM a permanent shell (it cannot be exited without removing the /P switch and boot-strapping again, but it can call a secondary shell). If not finding COMM8086.COM where indicated, then the kernel will ask for the full path to that or another command interpreter by the message:

'Bad or missing command interpreter. Enter the full shell command line'.

At this point any command interpreter can be chosen if knowing its location and name, by telling the kernel the full path where that interpreter be stored (the volume and full path, if in other than in the current volume), specifying also the .COM type (extension), and optionally passing arguments to the main executable of the interpreter, then pressing ENTER. Start batch processes such as .BAT or .BTM cannot be invoked from this command line of the kernel, but the chosen interpreter may find and execute a batch process, if available, and from that initial batch process others may optionally be called. Free-COM can only execute .BAT batch processes, not .BTM ones. The difference is that .BAT is interpreted line by line, while .BTM is translated into memory as a whole (4DOS.COM command interpreter can be used for .BTM batch processes).

Assuming COMM8086.COM being located in the current directory of the current volume, then it can be started as a secondary shell by entering:

COMM8086.COM

And pressing the ENTER (RETURN, NEW LINE) key. If having COMM8086.COM located in another directory or in another volume, then the above command line should be modified accordingly. For example, assuming COMM8086.COM being located at the top level of the floppy disc in the A: volume drive, the line would be:

A:\COMM8086.COM

And pressing the ENTER key. In any case, arguments can be passed to the executable of the chosen command interpreter. For instance, the COMMAND.COM of MS-DOS allows a minimum size of 160 bytes, but the Free-COM of Free-DOS starts at 256 bytes. Although the following line is unnecessary because it specifies a default value, it is given as a safe working example. It extends the previous example by specifying an initial environment size of 256 bytes:

A:\COMM8086.COM /E:256

It is also possible to have a start configuration for a command interpreter, and for many other options. The kernel will look at boot-strap for an ASCII plain text called FDCONFIG.SYS, or secondarily for CONFIG.SYS, and if finding any of them in that order, at the top level of the boot-strap volume, then it will follow the configuration instructions given there. From FDCONFIG.SYS or CONFIG.SYS one or more batch start processes may also be called. The default name is AUTOEXEC.BAT, but from FDCONFIG.SYS or CONFIG.SYS that name can be changed to for example FDAUTOEX.BAT, so as to prevent conflict with another start batch process, intended for another DOS system, which might be present in the same volume and directory. Alternatively, the path to the correct batch start process may be given from FDCONFIG.SYS or CONFIG.SYS

The following line is typically near the end of FDCONFIG.SYS or equivalent start configuration. It calls from the current directory of the current volume COMM8086.COM as the primary shell. The /MSG switch instructs the command interpreter for storing all error messages in Random Access Memory, thus giving faster access than if storing them in fixed disk (hard disk), and much faster than if storing them in floppy disk. The /MSG switch should be used only if having sufficient memory available for the error messages. The /P switch is necessary when using the /MSG switch. Optionally the /P switch specifies here a batch start process named FDAUTOEX.BAT

SHELL=COMM8086.COM /MSG /P=FDAUTOEX.BAT

Computers with very limited RAM may not be able to afford the use of their tiny memory for storing messages from the command interpreter. In such a Spartan scenario, it is better to avoid the /MSG and /P switches altogether. As for the batch start process, without the /P switch it would receive the default name of AUTOEXEC.BAT, meaning that it could not coexist in the same directory of the same volume with another batch process equally named, but intended for another DOS system.

Computers with very limited RAM obviously cannot create a RAM volume. If they lack fixed disk (hard disk), and possess only one floppy disk drive, then this really is the most heroic scenario, but Free-DOS can cope with that. The system can be boot-strapped from the floppy, and the command interpreter will VERY OFTEN prompt the human operator for swapping floppies in the only drive available, because the shell needs access to its own executable when retaking control of the operating system, after the release of control by another executable.

An operation such as copying from one floppy to another is a pain. A few sectors or clusters are copied from the first floppy to RAM, then a prompt to switch to the second floppy and press any key to continue, then those sectors or clusters are copied from RAM to the second floppy, then a prompt to switch to the first floppy and press any key to continue, and the sequence is thus repeated with all the data sets that have to be copied, expanded along sectors of 512 bytes standard size (although sector size can be changed to 256 or 128 bytes IF REALLY NECESSARY at the time of formatting the floppy).

A person working with a tiny-RAM, floppy only-system, single-floppy drive, should not feel frustrated. He should treasure his old machine as a valuable legacy from by-gone yester eras. Not 'jester' eras, because after all, that is the way things were with most microcomputers in the second half of the 1970's and first half of the 1980's, and there is the assurance of the well known EXPERT Mister Bill Gates, of Microsoft Corporation, who in the early 1980's boldly declared that 'No body will ever need more than 640 Kilobytes'. Of course, that lack of foresight happened before he chose to castigate the World with the mastodontic Windows System, which now needs several Gigabytes.

Free-COM COMMAND.COM version 1.15 of 2006

Free-COM command interpreter of Free-DOS for Intel x86 or later compatible processors
Part of the information refers to version 0.82 pl 3ak of August 2004, version 0.83, or version 0.84 pre 2 of August 2006

Free-COM COMMAND.COM accepts the following command line syntax:

[':'] ['?'] ['@'] ['*'] {command [{argument | redirection}] : '|'} redirection ::= ('<' | '>' | '>>') datasetname

The first optional '?' must not be mixed with the command '?!'

Description:

The colon ':' marks the line as a label, which allows Free-COM to ignore the line completely. No interpretation is tried of this line, neither are any redirections created.

The interrogation '?' forces Free-COM to enable the trace mode for this line. In trace mode Free-COM prompts the human operator whether or not to execute the resulting command.

The optional at '@' disables the echo status for this line. If the echo status be enabled, then the line is shown immediately before being executed. See the ECHO command.

The asterisk '*' is available only if aliases have been compiled into Free-COM. If present, then the alias expansion is skipped.

If commands be chained with the pipe '|' symbols, then those commands will be executed as a pipe. For instance, the command line:

cmd1 | cmd2 | cmd3

Forms a pipe consisting of the three individual commands 'cmd1', 'cmd2', 'cmd3', where the standard output stream of 'cmd1' is connected to the standard input stream of 'cmd2', and the output of 'cmd2' to the input of 'cmd3'.

DOS can be made to swap tasks, using programmes such as DOSAMATIC or HOMEBASE (included in the Bensley distribution hyper linked above), but because DOS is not normally a task-swapping environment, then pipes are simulated as a data set, and the above pipe with three commands will look like this:

cmd1 >%TEMP%\cmd###1.tmp

cmd2 <%TEMP%\cmd###1.tmp >%TEMP%\cmd###2.tmp

cmd3 <%TEMP%\cmd###2.tmp

The data sets are temporary ones, and will be removed as soon as they be no longer required, meaning that the 'tempfile #1' will be removed after the 'cmd2' have terminated, and the 'tempfile #2' upon termination of 'cmd3'.

Redirections tie the standard input or output stream to a data set or to a device. For instance:

cmd arg <indoc >>outdoc

Redirects the standard input stream of 'cmd' to the document 'indoc' and the standard output stream to the document 'outdoc'.

The double output redirection indicated by the two 'greater than' symbols >> specifies to append at the end of an existing document, instead of overwriting that document.

Command Line Editing: History

Free-COM offers two methods to enter command lines interactively:

1. Standard input: it calls a DOS function
2. Enhanced input: processes each key for its own

Which method Free-COM must use is defined at the time of compiling from the source programme to the executable programme.

If the echo state had been enabled, then the human operator receives a PROMPT at the command line. If the echo state had been disabled, then no visible or audible prompt is given to indicate to the human operator a request for activity, but commands entered at the command line will work anyway.

In any case (standard or enhanced input, with or without echo), the ENTER key always terminates the editing of the command line, and lets Free-COM start its interpretation of the line so far entered.

The standard input does not support full command line history, but in some circumstances it will retrieve the last command line, by pressing the F3 key. The standard input does not offer completion of names either. Below are shown the functions of keys in the standard input of Free-COM.

Standard input of Free-COM
Key Function
F1 Get next character from last line, if available
Cursor right Get next character from last line, if available
F3 Get last line, if available
F5 Put current line in last-line buffer, then restart editing a blank line
F6 or Ctrl+Z Insert pseudo-character EOF, End-Of-File, to end a document
Back space Erase the character at the left of the cursor
Cursor left Erase the character at the left of the cursor

The enhanced input supports full command line history and completion of names. Below are shown the functions of keys in the enhanced input of Free-COM. In the first table the keys with identical function in the standard as well as in the enhanced input, in the second table the keys with different functions from the standard to the enhanced input, and in the third table the keys that only work in the enhanced input.

Enhanced input of Free-COM
Keys with identical function in the standard as well as in the enhanced input
Key Function
F1 Get next character from last line, if available
F3 Get last line, if available
F5 Put current line in last-line buffer, then restart editing a blank line
Ctrl+Z Insert pseudo-character EOF, End-Of-File, to end a document
Back space Erase the character at the left of the cursor
Enhanced input of Free-COM
Keys with different functions from the standard to the enhanced input
Key Function
Cursor right Move the cursor one place to the right
Once reaching the end of the line, then get
next character from last line, if available
Cursor left Move the cursor one place to the left
Enhanced input of Free-COM
Keys that only work in the enhanced input
Key Function
Cursor up Replace current input line with next line from history buffer
Cursor down Replace current input line with previous line from history buffer
Home Move the cursor to the start of the line
End Move the cursor to the end of the line
Delete Erase the character at which the cursor is located
Esc Erase all the current line
Insert Switch between insert mode and overwrite mode
Tab Try to complete the current word as name of an existing data set
Ctrl+C Erase all the current line, and enable the echo state for
informing the operator that he is at the Free-COM command
line, and not stuck inside a non-interruptible programme

Command Line Usage: Switches, Options

Command line:

COMMAND.COM [ [D:] path [ console/device: ] ] [{ options }] [ '/' ( K | C ) «commandline» ]

Starts a new instance of Free-COM command interpreter. Parametres:

D:path
The volume and path where Free-COM must look for its own transient portion when it re-takes control of the operating system, after the exit of another programme. Free-COM releases a portion of itself in order to free memory for other programmes. Up to 620 Kilobytes of low conventional memory can thus be made available to them, which is very welcome by old programmes that run in real mode and cannot use extended or expanded memory. Some may use the INT 15h hardware interrupt. Since MS-DOS 3.x the 'd:path' parametre is only normally needed for setting the COMSPEC environment variable. Free-DOS implements that functionality as well.

If present, the first non-option argument 'path' specifies the location in which Free-COM resides. This location is later stored into the COMSPEC environment variable. In Free-DOS, as well as in MS-DOS version 3.x or later, the option is not necessary to find the shell invoked during the boot-strap process, but it may be used to let the system boot-strap a primary shell from one location, and later use a shell of the same version from another location.

It is not advisable to create before this point a RAM volume by means of an executable programme, because Free-COM needs to load certain informations somewhat early during boot-strap, before the execution of FDAUTOEX.BAT or equivalent start batch process, which is when normally Free-COM is copied into the RAM volume. A driver such as SRDEMS.SYS, SRDEMS3.SYS or SRDXMS.SYS can be loaded before Free-COM, because the corresponding executable of those drivers is SRDISK.EXE, which is loaded later, from FDAUTOEX.BAT or equivalent.

For convenience, Free-COM checks if at the indicated location there really exist a copy of Free-COM, and makes sure that the copy be accessible. If non-existing or non-accessible, then that location is ignored. The standard requires to specify only a relative path, but Free-COM also accepts an absolute path. Moreover, it accepts as valid a name of the command interpreter different from COMMAND.COM, which means that another programme called COMMAND.COM may exist by that name in the same directory. Therefore, Free-COM is not necessarily named COMMAND.COM

If present, the second non-option argument 'console' specifies the console that Free-COM shall enable. This setting is system-wide and it is not limited to Free-COM or just to this particular process tree. In its result, the argument is identical to the CTTY command.

console/device:
An alternate device for all Input or Output operations, if other than the default console.

Free-COM knows the following options:

/?
Issues a help screen, then exists.

/!
Enables or disables debugging support, if it had been compiled into Free-COM.

/Y
Enables trace mode or single step mode. The mode is deactivated when the command line prompt have been reached.

/D
Disables parsing of FDAUTOEX.BAT or equivalent, which then will not be read even if the /P option be present. This switch is usually set by the kernel, when the F5 key have been pressed at the boot-strap menu, if any, or during a boot-strap without menu.

/F
Enables autofail of Critical Errors, which means that all Critical Errors will be automatically answered with 'Fail', instead of asking the human operator what to do by showing him the dialogue message:

Abort / Retry / Ignore / Fail

It may not be advisable to enable autofail. Some programmes may behave unpredictably if giving to them 'Fail' as a response. It may be better to see the dialogue message and decide what to do for each particular case. Autofail can be used in well known situations that do not normally require personal intervention, but not when experimenting unknown software.

/P
Loads a primary copy of Free-COM as permanent. With the /P switch, Free-COM cannot be exited by the EXIT command.

/P makes the command interpreter permanent, so that the EXIT command will not exit from it. It can be used in the primary shell for specifying the name of the start batch process, if other than AUTOEXEC.BAT, or it can be used in secondary shells for making them permanent during the current working session.

Also with the /P switch, Free-COM executes FDAUTOEX.BAT or equivalent start batch process before executing any other command. The /P switch may have an argument to specify an alternate name for the start batch process, if being other name than AUTOEXEC.BAT

For example, naming the start batch process as FDAUTOEX.BAT can be done by either of the commands below. Using colon ':' or equal '=' as separator between the switch and its value, makes no difference:

COMMAND.COM /P:FDAUTOEX.BAT
COMMAND.COM /P=FDAUTOEX.BAT

/E:nnnnn
The environment size in bytes, in the range from 160 to 32768 bytes (160 bytes to 32 Kilobytes). This number will be rounded up the nearest 16 bytes. The default is 256 bytes.

/E sets another size of the environment segment, in which all the environment variables are stored. This option has no effect at present, because no part of Free-COM is loaded into the High Memory Area. It all goes into the low conventional memory area. Therefore the SHELLHIGH instruction in FDCONFIG.SYS or equivalent start configuration, is currently executed in equal manner as the SHELL instruction.

/MSG
Installs the message server. It is extremely rare to use the message server nowadays, therefore this option forces to load permanently into Random Access Memory any error messages coming from Free-COM that might exist in storage volume. This allows for faster access to error messages, but it also occupies memory, therefore it may not be advisable for computers with very limited memory capability, which may not afford to use that memory for storing the messages.

/SWAP
Toggles between defaulting to swap or not to swap. Due to different default values of this internal flag, it is recommended to prefix always the option with the plus sign '+' to enable swapping, or else with the minus sign '-' to disable swapping.

/C {string}
Executes the command in {string}, then exits.

/K {string}
Executes the command in {string}, then exits.

The /C or /K switches are special cases, they do not behave as other options do. The 'string' of characters at the right side of /C or of /K, except for an optional argument sign, specifies a command to execute.

Boolean options, which can only be enabled or else disabled, may be prefixed by the plus sign '+' to enable the option, or else by the minus sign '-' to disable it.

For example, using the /C switch for executing the DIR command:

/C DIR /S
/C=DIR /S
/CDIR /S

Any of the above three lines behaves in exactly equal manner, it executes the DIR command with the /S switch (lists directory and all its sub-directories).

If the /C or /K switches be used in conjunction with the /P switch, then FDAUTOEX.BAT or equivalent start batch process is executed prior to executing the specified command.

Difference between the /C and /K switches:

The /C option does not enter the interactive command line (the shell prompt) after having executed the specified command, unless the /P option be also present. The /K option enters the interactive command line anyway, without need of specifying the /P option.

Environment Variables

Environment variables can be freely assigned using the SET command. For instance, executing:

SET var1=tecxsgk;jsdgsdflfsjdflkasjf/lasjflas

Assigns that non-sense to the variable called 'var1'

At a later time, the value of that variable can be used by writing:

%var1%

Thus, by writing the name of the variable enclosed without spaces by two percent signs, the stored string of characters is returned:

tecxsgk;jsdgsdflfsjdflkasjf/lasjflas

WARNING: Environment variables are fully expanded into plain text before the command line be parsed further. If a variable contain an odd number of speech quotes, then the remaining command line must contain the closing speech quote in order to operate properly. Also see this:

SET var=text del

IF text==%var% GOTO label:

The second line looks uninteresting, but once that the environment variable called 'var' have been expanded, then the line has morphed into:

IF text==text del GOTO label:

Not that funny anymore, because the IF command interprets only the string 'text==text' as a condition, but 'del GOTO label:' is executed as a command. Something important may be erased as the result of that command.

For its own purposes, Free-COM uses some environment variables. They are changed using the SET command, from the command line or from a batch process. Certain variables can also be changed using some other command, as it will be explained below when applicable.

COMSPEC Command Specification
Free-COM loads some information on demand, and stores it in the Free-COM executable. The value of the COMSPEC environment variable contains the name of the external data set that Free-COM shall use.

DIRCMD Directory Command
The human operator may define his default preferences for the DIR command. Any preferences specified within DIRCMD will prefix any preferences entered from the command line or from a batch process. Therefore, by typing:

DIR [arguments]

Free-COM will behave as if the operator had typed:

DIR %DIRCMD% [arguments]

COPYCMD Copy Command
It contains default preferences for the COPY command. The above explanation for DIRCMD is valid for COPYCMD as well.

PROMPT Command Line Prompt
Free-COM prompts the operator to enter commands at the command line. Free-COM will parse them for interpretation, and if being valid commands for Free-COM, then it will execute them, either by calling internal algorithms in the case of recognising one of the internal commands of Free-COM, or by calling an external executable programme of that name in the case of not recognising the received command as an internal one. The prompt can be customised to personal preferences by changing the content of the PROMPT variable.

Besides the SET command, the variable can also be changed using the PROMPT command. The document of the PROMPT command gives a detailed description of the format of the prompt string.

PATH Path to find external executables
When Free-COM be commanded to execute an external command, and if no path to that external command be given, then Free-COM searches for the command in a number of paths. The paths are enumerated by the PATH environment variable, separating them by a semicolon ';' without spaces at either side.

Without a PATH environment variable, or with that variable empty (blank), then Free-COM will only search the current directory of the current volume.

Besides the SET command, the variable can also be changed using the PATH command. The document of the PATH command gives a detailed description of the format of the search path.

There are a number of automatic variables that do not follow the above mentioned syntax. The content of those variables is generated automatically. Unlike normal variables, automatic variables are constructed of exactly two characters, the first one is a single percent sign '%' and the second one is the variable identifier:

%?
Expands to the current error level, which is the exit code of the previously executed external command.

%0
Used only in batch processes. It is the name of the process being currently executed.

%1 to %9
Used only in batch processes. They represent from the first to the ninth argument passed to the batch process being currently executed. If less than nine arguments had been passed to the process, then the rest will return an empty string.

There is not such a thing as '%10', but ten or more arguments can be passed by shifting values. The process of shifting values first assigns an initial value to %1, another to %2, and so on up to %9, then it returns to %1 and assigns a new value to it, another new value to %2, and so on up to %9 with another new value, then it will repeat the process ad nauseam, indefinitely, up to the last received instruction or to the memory limit of the computer.

For using the tenth or further arguments refer to the SHIFT command.

FOR %v IN (...) DO [command [switches]] %v
The variable represented as '%v' in the above line may use any letter. The percent sign must be written before the letter that names the variable. The FOR command creates a new variable, which is valid in the [command [switches]] following the DO keyword.

The FOR command is not supposed to be changed using the SET command.

Example to find the string 'Dixie' in any data set located in the current directory of the current volume:

FOR %a IN (*.*) DO FIND "Dixie" %a

The upper or lower cases used above for the commands FOR, IN, DO and FIND are merely illustrative, the line is not case sensitive. However, the FIND programme will search for the string 'Dixie' with case sensitivity. It will not find any strings such as 'dixie' or 'DIXIE', or any combination of upper and lower case.

The /I switch can be given to the FIND programme, telling it to ignore case during the search, thus finding a string without regard to upper or lower case:

FOR %a IN (*.*) DO FIND /I "Dixie" %a

The procedure may be combined in uncountable ways. For example, to show also the number of the line where each instance of the string 'Dixie' be found, then to append all results to a document called DIXIE.TXT located in the current directory of the current volume:

FOR %a IN (*.*) DO FIND /I /N "Dixie" %a >> DIXIE.TXT

The redirection must be done by the appending process, which uses two 'greater than' symbols >>

Only one 'greater than' symbol cannot be used, because then the FIND programme would overwrite DIXIE.TXT at every passing, and as a result DIXIE.TXT would show that only one line has been found by the FIND programme.

%%
Two percent signs do not make a variable, they just expand to a single percent sign. Therefore for getting a single percent sign '%' the construction '%%' can be used.

Automatic variables have one percent sign only, which may lead to confusion within the FOR command. For instance, in:

SET aryan=noble
FOR %a IN (*.*) DO ECHO %aryan% %a

%aryan is interpreted as [%a]ryan

There will be no echo of the string 'noble' on screen, as it had been intended erroneously, because the '%a' in '%aryan' is understood as the final '%a' that closes the FOR command, and the intended final '%a' that after '%aryan%' ends the line, is simply disregarded.

EBNF, Extended Backus-Naur Formula

EBNF, Extended Backus-Naur Formula, is a convention used to facilitate the reading and understanding of synopses of commands. EBNF affects the character setting of the text in four types, depending on different meanings: italic characters, terminal-type characters, characters quoted inside single speech marks, and bold characters. If not having some of those character types available (for example in plain text), then the nearest approximation should be used. EBNF also specifies operator symbols. The two sets of conventions are explained below.

Extended Backus-Naur Formula for synopses of commands
Type of the character setting
EBNF Name Meaning Example
Non-terminal symbols italic Place holders for arguments, which are explained in the description varname
Terminal symbols terminal Characters to be entered at the command line or displayed by the computer ECHO
Terminal symbols 'string' The speech quotes remove the metafunction of the enclosed characters, in order to specify EBNF operators as terminal symbols Pipe '|'
Operators bold Operators that construct portions together Pipe |
Extended Backus-Naur Formula for synopses of commands
Operator symbols
Symbol Name of symbol and its meaning
  | Pipe, vertical bar. Use alternatively either the left or the right token, but not both
  (   ) Parentheses. They enclose tokens, limiting the range of the pipe | mentioned above
  [   ] Square brackets. They enclose optional tokens, thus they may appear one time or not appear. They also limit the range of the pipe | above
  {   } Curly brackets. They enclose repetitive tokens, which may appear one or more times. They also limit the range of the pipe | above
  { : } Colon surrounded by curly brackets. As the normal curly brackets, but any repetitive tokens are delimited by the token or tokens at the right of the colon. For instance:
  { record : '+' }
Is equivalent to:
  record [{ '+' record }]
And applies to:
  record
  record + record
  record + record + record
  record + record + record + record
  ... ad nauseam
  << >>
  « »
Lesser and greater. Quotation. Either of these sets of symbols represents a place holder for an arbitary string of terminal symbols, whose further syntax is described by the enclosed text in English.
  ::= Double colon and equal sign. It assigns a meaning (right side) to a non-terminal symbol (left side). For instance:
  DIR [ { option | datasetname } ] option ::= / ( A | B | C )
Only one occurrence allowed here. Any occurrence of 'option' at the right side of the ::= construction, or where no ::= construction be present at all, must be replaced by the right side of option ::=

Unless modified by any of the above operators, a sequence of tokens specifies that each token must be present exactly one time in exactly that order.

For the sake of clearness, spaces are inserted between tokens. Those spaces do NOT mean that a space be allowed at that place, or in other words, the spaces are not supposed to be necessarily included. Likewise, the fact that no dash '_' be present does NOT mean that at that place no dash be allowed.

It is assumed that the reader be capable of finding the places where optional spaces or dashes be valid, by reading the examples or also by experimenting. The examples should be read first, any experimenting must be done foreseeing as much as reasonable the probable results of the experiment.

Internal Commands of Free-COM

Internal Commands implemented by Free-COM version 0.82 patch level 3
This list needs updating for Free-COM version 0.84 pre 2

Internal commands are processed by Free-COM directly, which means that they are available without presence of any external executables or batch processes. In fact they hide external commands equally named, therefore if having for example a batch process called DIR.BAT and executables called DIR.COM and DIR.EXE, then by commanding simply:
dir

Only the internal dir command will be executed. If wishing to execute one of the others instead, then it is necessary to specify name and type in full, one of DIR.BAT, or else DIR.COM, or else DIR.EXE

The synopses of the internal commands are described in the style of the Extended Backus-Naur Formula EBNF explained above.

Complete list of commands

A list of command key words is given below. Another list with explanations for each command and with internal links follows immediately after this one.

alias
Shows or changes an alias

beep
Produces a beeping sound of about two seconds through the internal computer speaker

break
Shows or sets Extended Break Checking, to stop a running programme

call
From a batch process, calls a nested batch process or an executable

cancel
Terminates all running batch processes (QUIT terminates only one)

cdd
Changes current volume and directory, across volumes

chdir or cd
Changes current directory inside a volume

cls
Clears screen, wiping out all information

copy
Copies one or more data sets to or from another volume or directory

ctty
Changes terminal device for input (usually the console) to another device

date
Shows or changes the current date (follows COUNTRY.SYS, if loaded)

dir
Shows the data sets that exist in a directory

dirs
Shows the directories that are listed in the LIFO directory stack

echo
Shows on screen or printer a line of text or a blank line. ECHO is also a command in FDCONFIG.SYS or equivalent start configuration

environment_keep_free
Keeps free space in the segment of RAM containing environment data

erase or del
Erases data sets in a volume or directory, removing entries from the Allocation Table

exit
Exits command interpreter if not being the primary and if not loaded with /P

feature_aliases
Command aliases, a word can replace another word or a whole line

feature_auto_redirect_to_con
Automatically switches from the CON: console device to the screen

feature_batch
Commands can be given in a batch process and executed in sequence

feature_boot_keys
Uses the F8 or also F5 keys for processing or bypassing configurations

feature_call_logging
Every start of a Free-COM instance is logged into a text document

feature_dirstack
Directory stack, an ordered history of directories visited

feature_enhanced_input
Enhanced editing of the command line

feature_filename_completion
Completes names that match those of existing data sets

feature_history
Manages command line history

feature_installable_commands
Installable Commands interface, specification MUX-AE

feature_last_dir
Changes to the most recent directory visited before the current one

feature_load_messages
Loads messages permanently into Random Access Memory

feature_nls
Uses National Language Support for characters other than 7-bit ASCII

for
Repeats a command according to a given variable

goto
Unconditionally goes to specified line label (conditionally with IF)

history
Shows command line history, an ordered history of previous commands

if
Conditional execution of a command, or a branching to another line

lfnfor
Turns ON or OFF the use of LFN in FOR and in the completion of names

loadfix
Loads external executable above first 64 Kilobytes of low Random Access Memory

loadhigh or lh
Loads external executable into High Memory Area of Random Access Memory

memory
Shows the internal use of RAM by the command interpreter itself
Not to be confused with MEM.EXE, which is an external executable

mkdir or md
Makes a new directory

path
Shows or sets the path to search for batch processes or executables

pause
Pauses a batch process, and asks to press a key to continue it

popd
Changes to most recently pushed directory (top of LIFO directory stack)

prompt
Shows or sets the prompt line of the command interpreter

pushd
Makes the current directory the most recent in the LIFO directory stack

quit
Terminates current batch process (CANCEL terminates all of them)

rem
Explanatory remark inserted by the programmer into a batch process

rename or ren
Gives new name or type to one or more data sets, inside the DOS 8.3 convention

rmdir or rd
Removes an empty directory (all data sets must first be erased, or DELTREE used)

set
Shows or sets environment variables (options read by executables)

shift
Shifts values in a batch process (for over nine automatic variables)

time
Shows or changes the current time (follows COUNTRY.SYS, if loaded)

truename
Shows the registered name of a data set (original or modified name)

type
Scrolls content of data set on screen or printer (MORE can be used to pause)

ver
Shows version information of Free-COM and of Free-DOS

verify
Shows or sets level of verification to make exact copy of a data set

vol
Shows label of a volume (LABEL.EXE can be used to change the label)

which
Searches for and shows the executable of a specified programme. WHICH is an internal command, but WHICH.EXE is an external executable. WHICH.EN WHICH.EXE WHICH.HLP WHICH.LSM

The commands explained

Links pointing from one command to another, point to destinations inside this section. They are all also listed in the command key words above.

ALIAS

Shows or changes an alias.

Requirements: FEATURE_ALIASES

Synopsis alias [aliasword[=definition]]

alias shows a list of the current aliases, if any.

alias aliasword=definition creates the alias.

alias aliasword= removes that alias.

ALIAS
ALIAS name = [ «string» ]

The first format without any argument displays all defined aliases.

The second format assigns the specified string to the alias with the specified name. If the string be empty, the named alias is removed.

Once an alias be defined, a command line of the form:
name { argument }

Is replaced by:
<<string>> { argument }

That mechanism is called alias expansion, because the alias name expands to the specified «string»

To avoid alias expansion the command must be prefixed by one asterisk, as in:
*name arguments

First Example

ALIAS dir=dir /w

After having defined that alias, then the command:
dir

Will display wide directory listing from now, until new modification of alias.

Second Example

ALIAS

Displays all currently defined aliases. With the previous example it would be:
DIR=dir /w

Third Example

ALIAS dir=
Removes the previously defined alias dir, thus DIR will display the standard output again, as it had been by default.

BEEP

Produces a beeping sound of about two seconds through the internal computer speaker.

Requirements: CMD_BEEP

Synopsis beep

beep produces a beeping sound.

BEEP

Produces a beeping sound. At this time Free-COM supports audible beeps only.

BREAK

Shows or sets Extended Break Checking, to stop a running programme.

Requirements: CMD_BREAK

Synopsis break [ON|OFF]

break without arguments, shows the current status ON or OFF

break [ON|OFF] turns the extended Ctrl+C check ON or OFF.

The default is OFF, Free-DOS only checks Ctrl+C during screen output, printing, or keyboard operations. When the option be ON, then Ctrl+C will be checked during storage volume operations as well. Ctrl+C is used to end an executable and return control to the operating system.

BREAK [ ON | OFF ]

Shows or sets the Extended Break status.

By pressing Ctrl+Break or Ctrl+C a user may signal the currently running programme to halt. DOS checks for Ctrl+Break or Ctrl+C each time that a programme issue a console input or output request. When Extended Break Checking be enabled by the line BREAK=ON, then DOS will check for Ctrl+Break each time that a programme issue a request.

There is not a polling method by time. DOS will not make the check without a request previously made by the running programme. It means that the real breaking action depends on the programme, and not on DOS. Most programmes will exit, returning operations to the prompt of the command interpreter. Some programmes may have been written for just cancelling the current action, but remaining active. In such fastidious situations, the only option may be to restart the operating system.

CALL

From a batch process, calls a nested batch process or an executable.

See also: LOADFIX , LOADHIGH

Optional requirements: FEATURE_KERNEL_SWAP_SHELL

Synopsis call [/S|/N] [vol:][path]name [batch parameters]

/S forces the swapping of Free-COM.

/N avoids the swapping of Free-COM.

[vol:][path]name of the batch process to be called.

[batch parameters] passed to the batch process being called.

CALL runs another batch process, then returning to the previous batch process. Another batch process could instead be called just by its name, without the CALL command, but in that case there will be no automatic return to the previous batch process. The return could be specifically commanded from the second batch process, taking care for not entering into an infinite loop.

When the called batch process be completed, then the processing of the original batch process will be continued. Batch processes can be invoked directly from another batch process without the CALL command, but in that case the processing of the original batch process will not be continued afterwards.

CALL [/Y] programme [ «arguments» ]
CALL [/Y] [ /S | /N ] programme [ «arguments» ]

Calls a batch process or an executable.

If the programme be a batch process with the .BAT type, then CALL nests that batch process within the batch process from which the CALL has been made.

It is possible to invoke a batch process from another without using the CALL command, but in that case there would be no automatic return. Without CALL, the invoked batch process would terminate all already running batch processes.

The invoked batch process may itself CALL (nested) or invoke (not nested) the parent batch process or any other batch process.

A batch process may invoke or may CALL itself, potentially entering into a loop from which the only exit may be to break the execution of the batch process. DOS will ask confirmation for this.

If present, the arguments are passed unchanged to the invoked programme, whether another batch process or an executable.

Options

Batch processes are defined in the Appendix. Unless stated otherwise, all options of this command follow the standard rules for options, explained in the Appendix

/S: If the called external programme be not a batch process, then Free-COM will first swap itself out of memory, and then it will run the external executable, in order to free as much memory as possible for that executable.

That process will require more time after exiting the external executable, thus returning control to Free-COM, especially if Free-COM must be reloaded from a floppy.

Command line history and some other internal settings are lost.

The /S switch is available only if Free-COM had been compiled with some support for swapping.

/N: If the called external programme be not a batch process, then Free-COM will NOT swap itself out of memory, it will directly run the external executable.

There may be insufficient memory for that executable, but the return of control to Free-COM will be faster.

Command line history and the other internal settings are preserved.

Free-COM never swaps itself out of memory before running a batch process.

The /N switch overrides (supersedes) the /S switch.

/Y: Enables trace mode during execution of the command.

To swap Free-COM out of memory while running an external executable will be the default behaviour in the future, but always giving the option of keeping Free-COM in memory, which may be preferable for running small executables in a floppy-only system.

CANCEL

Terminates all running batch processes (QUIT terminates only one).

Synopsis cancel [n]

CANCEL [ n ]

Terminates all currently active batch processes, and if present, it assigns the specified number n to the error level.

CANCEL is a hidden internal command. Definition in the Appendix

CDD

Changes current volume and directory, across volumes.

See also: CHDIR , DIR , MKDIR , PUSHD , RMDIR

Requirements: CMD_CDD

Synopsis cdd [vol:][path]

cdd - without volume, CDD changes to last directory visited (as CHDIR).

cdd [vol:] without path, only the current volume is changed.

cdd [vol:][path] with volume and path, the two are changed.

CDD
CDD [ volume : ] path
CDD -

The behaviour of the CDD command is similar to that of the CHDIR command, but CDD changes the current volume and the current directory, thus it changes the current working directory, while CHDIR only changes the directory but not the volume. More information in the CHDIR command, immediately below.

CHDIR or CD

Changes current directory inside a volume.

See also: CDD , DIR , DIRS , MKDIR , PUSHD , RMDIR

Requirements: CMD_CHDIR

Optional requirements: FEATURE_LAST_DIR

Synopsis chdir [vol:][path]

chdir - without volume, CHDIR changes to last directory visited inside the current volume.

chdir [vol:] without path, the current directory is shown.

chdir [vol:][path] with volume and path, changes the current directory of that volume to the specified path.

chdir \ changes to the top level (to the root directory).

chdir .. changes one level upwards in the directory tree.

chdir ..\path changes one level upwards, then downwards to the specified path.

CHDIR
CHDIR [ volume : ] path
CHDIR -

The first variant shows the current working directory as absolute path.

The second variant changes the current directory of the given volume. If no volume be specified at the command line or batch process, then the current directory of the currently selected volume is changed. The CHDIR command does NOT change the currently selected volume, that change can be done by the CDD command, explained immediately above. The change of volume can also be done by typing its letter, followed by colon (:), and pressing the ENTER key.

The third variant changes back to the last visited directory AND volume. The commands CHDIR (or CD), CDD or PUSHD, save the current working directory in the LIFO stack, before performing the specified directory change. The command CHDIR '-' (or CD '-') restores that saved directory. The CHDIR '-' (or CD '-') command is available only if the feature LAST_DIR had been enabled during compilation of Free-COM.

Definitions of current directory, current working directory, current volume, LIFO, and other definitions, are in the Appendix

There are no options for the CHDIR (or CD) command.

First Example

CHDIR \freedos\help

Changes the current working directory of the current volume to the path \FREEDOS\HELP

Second Example

CHDIR c:\freedos\help

Changes the current working directory to the C: volume, and inside it to the path C:\FREEDOS\HELP

Third Example

CHDIR ..

Assuming that we have issued that command from \FREEDOS\HELP as current working directory, then the command interpreter changes to the directory immediately above in the directory tree, which is \FREEDOS in this case.

Fourth Example

CHDIR -

If issuing that command from \FREEDOS as current working directory, then we shall go back to \FREEDOS\HELP, because that was the previous directory before issuing the CHDIR - command.

The two dots (..) after the command, indicate the directory immediately above. Only one dot (.) indicates the current directory.

Because the CHDIR - command also saves the previous directory, then any subsequent issues of the command:
CHDIR -

Will switch between those two directories, until changing to another directory. Therefore the CHDIR - command is useful for going quickly from one directory to another and back to the first directory many times, which in a complex directory structure is a help, as a kind of 'task swapping' (or more properly, as a short path). Real task swappers for DOS do not exist in the sense that they exist for Unics or VMS, because DOS systems are for single tasks, but there are a few executables that simulate a limited task swapping environment in DOS. Any DOS 'task swapper' works by the trick of running the other executables from itself. They are seen by the computer processor as a single process, but the human operator can 'switch tasks' within the limit of Random Access Memory. Two 'task swappers' available for DOS are DOSAMATIC and HOMEBASE, included in the Bensley distribution hyper linked above.

CLS

Clears screen, wiping out all information.

See also: ECHO , TYPE

Requirements: CMD_CLS

Synopsis cls

cls clears the screen.

CLS

Clears the screen and resets colours to white characters on black background.

COPY

Copies one or more data sets to or from another volume or directory.

See also: ERASE , RENAME

Requirements: CMD_COPY

Synopsis copy [/A|/B] [vol:][path]name [[/A|/B] +[vol:][path]name] [...] [dest] [/V] [/Y]

[vol:][path]name the source data set to copy.

[dest] the destination data set, data sets, or directory. If it contain asterisk (*) then this is replaced by that part of the name with the same part as the source.

/A copies as ASCII text. If it precede a name in a list of names, then data sets will be copied as ASCII texts from this one onwards.

/B copies a binal data set (the default). If it precede a name in a list of names, then data sets will be copied as binal data sets from this one onwards.

/V verifies that the copies be written correctly, comparing to the originals.

/Y suppresses the overwrite confirmation, thus destination data sets with the same name as the source will be overwritten without notice.

/-Y asks for confirmation before overwriting destination data sets with the same name as the source.

COPY does not copy empty directories or empty data sets (of zero bytes), but XCOPY can be used to copy them XCOPY

DISKCOPY can be used to copy entire volumes DISKCOPY

To move a data set to another directory it can first be copied and then erase the original, but MOVE can alternatively be used MOVE

The COPYCMD environment variable can set the /-Y switch as default, to make COPY, MOVE or XCOPY ask for confirmation before overwriting:

SET COPYCMD=/-Y

To cancel the /-Y switch for a particular operation, the /Y switch is used at the command line or batch process, thus overwriting without confirmation.

COPY [{ option }] source [{ option }] target [{ option }]

Copies the source data set to the target data set. See also "wild cards".

Before parsing its command line, COPY parses any options specified by the environment variable COPYCMD

Options

Unless stated otherwise, all options of the COPY command follow the standard rules for options, explained in the Appendix

/A Copy in ASCII mode

/B Copy in binal (binary) mode

The switches /A or /B alter the copy mode of the data set immediately preceding them and all the following ones, until changed again.

In binal mode the data set is copied and nothing is changed at all.

In ASCII mode the COPY command takes care of the two characters Carriage Return and Line Feed, ASCII Ctrl + M Ctrl + J, plus the pseudo character EOF, End Of File. An explanation is given below.

In DOS the end of the line is usually marked with two characters, Carriage Return and Line Feed, ASCII Ctrl + M Ctrl + J

In DOS the end of the line is sometimes marked with one character, Back Slash n, ASCII \n

In Unics, for example, the end of the line is always marked with one character, Line Feed, ASCII Ctrl + J

Free-DOS has the executable TRCH.EXE that can make the conversion between DOS and Unics conventions, both ways, or any other text processing needing to transcribe characters. There is international support by using the optional Cats library, available from the Free-DOS Project and from other locations. Unics has other programmes that can make the conversion, such as the MTOOLS collection.

Thus, the new line characters are in DOS a sequence of two different bytes, Carriage Return and Line Feed. When reading, those two bytes are transformed into a single character, as it is known in Unics systems. When writing, that single character is again transformed into the two-byte sequence.

So, if the two data sets be copied with different modes, the new line characters are transformed into either way.

If the EOF, End Of File pseudo character, be found when reading, then the remaining content of the data set would be ignored. That fact may be used as a simple way to hide text below the EOF. When writing, such a pseudo character is appended, after the last character have been written.

Data sets are by default copied in binal mode, whereas devices such as the CON: console are by default copied in ASCII mode, but no EOF is appended. EOF can be appended by pressing Ctrl + Z

Arguments

source: the source data set (at origin). If more than one source data set be specified, then the target must be a directory.

target: the target (at destination), which may be a data set or a directory. If the target be a directory, then the data set is put into that directory at destination, with the same name as the source data set. If exactly one source be specified, but no target, then the target defaults only to a dot (.), which represents the current directory.

CTTY

Changes terminal device for input (usually the console) to another device.

Requirements: CMD_CTTY

Synopsis ctty device

device the device to use, valid are the aux, com1, com2, com3, com4, con, lpt1, lpt2, lpt3, or prn devices.

CTTY device

With that command the console device can be changed. A console device performs all basic input and output operations. The CTTY change is more complete than input output redirections, because with redirections it might happen that not all of the output be caught afterwards, for instance the error messages. The second example below illustrates that case.

The specified device must not be a unidirectional device, such as a PRN (printer), because the console is a bidirectional virtual device, meaning that it must perform input AND output, while a printer is only for output.

To specify a second argument on the command line of Free-COM has the same effect.

Information about redirection or device is in the Appendix

ATTENTION: the CTTY command changes the terminal device only for the current DOS session, but for that session it affects the whole system, not only Free-COM itself. Thus the effect of CTTY does not only depend on the implementation status of Free-COM, but on the DOS kernel too.

Some executables access the screen or the keyboard directly, without using DOS functions. Such executables are NOT affected by the CTTY command. Typical executables of that kind are action games, which need a fast refresh of the screen and a fast input by a few keys of the keyboard (or by joy sticks).

First Example

CTTY aux

Changes the console to the AUX: auxiliary device, which is usually COM1:, the first serial communication port. If this port be connected to a terminal or to a terminal emulator, then the computer can be controlled from the terminal from now, until changing it again.

Second Example

CTTY nul
Any command sequence
CTTY con

The first command "CTTY nul" discards any output. If a programme attempt any input operation, then it gets none. Some programmes may not handle such a situation correctly. Therefore any output, even error messages, are discarded during the command sequence.

The second command "CTTY con" changes the console back to the screen and keyboard pair.

The usual input output redirections may be used to display a string of characters on the screen or to read keys from the keybord, for instance:

ECHO
This line appears on the screen > CON

PAUSE > CON
This PAUSE command will get its input even within the "CTTY nul" environment.

DATE

Shows or changes the current date (follows COUNTRY.SYS, if loaded).

See also: TIME

Requirements: CMD_DATE

Synopsis date [/D] [newdate]

/D only shows the date, without prompting for a new date.

date without new date, the current date is shown and Free-COM prompts for a new date. Pressing ENTER accepts the current date without changing it.

date /D without new date but with the /D switch, only the current date is shown, without prompting.

newdate is the new date (the day, number of month and year) like in:
dd.mm.yy or dd.mm.yyyy
dd-mm-yy or dd-mm-yyyy
dd/mm/yy or dd/mm/yyyy

The values for the day, number of month and year may be separated by points, by hyphens or by slashes. Either a year of four digits or of two digits may be used, but if using only two, then years from 80 to 99 are assumed to mean 1980 to 1999, and years from 00 to 79 are assumed to mean 2000 to 2079.

DATE [ /D ]
DATE [ /D ] date

The first variant shows the current system date, then enters a loop prompting the user for a new date. The loop terminates when the user enters a valid new date, or just when he presses the ENTER key, without modifying the date.

The second variant does not display the current date, instead it tries to change the date to the specified date. If succeeding, then the command terminates, otherwise it enters the loop explained above.

The parts of a date may be separated by at least:

Points (.)
Hyphens (-)
Forward slashes (/)

The colon (:) separator is used by the TIME command but not by the DATE. On the contrary, the hyphen (-) separator is used by the DATE command but not by the TIME. The point (.) or the forward slash (/) separators are used by both. It is therefore recommended to use colon (:) for TIME and hyphen (-) for DATE.

Other nationally used characters may be supported as well, besides points, hyphens or forward slashes.

For example:

21.6.1994
21-6-1994
21/6/1994

In the European format, any of the above dates refers to 21st June 1994, the happy date of marriage between P. A. Stonemann and Lady Jo Anne.

DATE supports partial formats:

One number
Specifies only the day.

Two numbers
Specifies the day and the month in the order used by the national date format taken from COUNTRY.SYS, which is MM/DD in the North American and Japanese formats, and DD/MM in the European format.

Three numbers
Specifies the day, the month and the year in the order used by the national date format taken from COUNTRY.SYS, which is:

MM/DD/[CC]YY in the North American format

[CC]YY/MM/DD in the Japanese format

DD/MM/[CC]YY in the European format

If the year part be less than 100, then it happens this:

-If it be equal to 80 or greater, then it is assumed to be a year from 1980 to 1999, the end of the XX century. This is because the Golden Era of DOS was in those years.

-It it be lesser than 80, then it is assumed to be a year from 2000 to 2079, most of the XXI century.

Years before 1980 or after 2079 must be expressed in full, with four ciphers.

About 1996 some European countries introduced the Gregorian International Date (ISO 8601), which is the same as the Japanese format. The Japanese format makes much easier the task of sorting literal dates. Free-COM may or may not support the Japanese format, depending on the National Language Support used by DOS. With COUNTRY.SYS present at top level directory of the current volume, the Gregorian International Date (ISO 8601) and the international code page will be used by Free-COM by inserting this line in FDCONFIG.SYS or equivalent start configuration process:

COUNTRY=046,850,\COUNTRY.SYS

Full names of months (symbolical names) are not supported by Free-COM.

Options. All options must precede any argument.

/D does not prompt the user for a new date.

DATE /D
DATE /D date

In the first variant the date is only shown.

In the second variant the date is tried to be changed, but the loop is not entered in case of failure, it just returns the prompt of the command line.

First Example

DATE /D

Only shows the current system date.

Second Example

DATE 21.6.1994
DATE 21-6-1994
DATE 21/6/1994

With any of the above commands:

If having the system configured for the North American format or the Japanese format in COUNTRY.SYS, then the entry is invalid. Free-COM will ask for another entry. Pressing simply the ENTER key will exit the loop, without changing the date.

If having the system configured for the European format in COUNTRY.SYS, then it sets the current date to 21st June 1994, the happy date of marriage between P. A. Stonemann and Lady Jo Anne.

DIR

Shows the data sets that exist in a directory.

See also: CHDIR , MKDIR , RMDIR

Requirements: CMD_DIR

Synopsis dir [vol:][path][name] [options]

vol:path\name name of a specific data set to show.

/a[:[-]attribs] shows only the data sets or also directories with the specified attributes. The minus sign is the negation of that attribute:

a | -a   archive (-a not archived)
d | -d   directories (-d data sets, not directories)
h | -h   hidden (-h not hidden)
r | -r   read-only (-r writable)
s | -s   system (-s not system)

The default is to show without sorting, as each data set first fragment appear.

/b brief format, only the name and type.

/l (letter lima) list shown in lower case.

/lfn (long file names) with Long Name driver loaded, it shows the DOS short name (8.3 format) at the left and, if any, the Long Name at the right. Long file names is an experimental feature in Free-COM. Unfortunately, the command interpreter 4DOS.COM needs a real VFAT data set system for handling Long Names, it does not normally work with just a Long Name driver in FAT 12, FAT 16 or FAT 32

/w wide format, only the name and type in each of five columns.

The DIRCMD environment variable can set preferences as default, to make DIR show the list in a certain manner, for instance:

SET DIRCMD=/P /W

That means to pause at each screenful and to show in wide format. To cancel each of those switches for a particular operation, the minus sign prefix to that switch is used at the command line or batch process, for example:

DIR /-W

It will cancel the wide format and use the original format only for that operation, but the pause at each screenful will still happen.

DIR [{ options | pattern }]

DIR shows the content of directories or also the attributes of data sets, whatever the pattern specify. If no pattern be specified at the command line, then the current working directory is shown. The information shown depends on the specified options. It is explained below.

A pattern may contain wild cards, which are expanded by comparing names of data sets as well as names of directories. To specify a directory is essentially equal to write:

directory\*.*

Patterns are performed in sequence, unlike options. It means that if two patterns be specified, then all entries matching the first pattern will be shown first, and all entries matching the second pattern will be shown second. The matching entries WILL NOT be shown intermixed. Free-COM does not like mixing of any kind.

Before parsing its command line, DIR parses any option specified by the DIRCMD environment variable.

Options

Unless stated otherwise, all options of the DIR command follow the standard rules for options. Explanations about wild cards and about options are in the Appendix

/A
Lists all data sets, including System data sets or Hidden data sets, and directories.

/A:[ A | D | H | R | S]
Lists only data sets or directories with the specified attributes.

/A:[ -A | -D | -H | -R | -S]
Does not list data sets or directories with the specified attributes.

More than one attribute can be specified, with or without the preceding minus sign (-). Specification of all the five attributes is equal to specification of the /A switch explained above, such as in:

DIR /A
DIR /A:A /A:D /A:H /A:R /A:S

The two command above are equivalent.

The attributes are:

A means archive data set

D means directory

H means hidden data set

R means read-only data set

S means system data set

If the same attribute be specified more than one time within the same /A switch, then the last attribute supersedes (overrides) the previous ones.

If more than one /A switch be specified, then the last /A switch supersedes (overrides) all previous ones.

/B
Shows in brief format, only the whole names (names and types) of data sets and directories. The lines showing the volume label, the serial number, the totals, or other informations, are suppressed.

The /B switch in combination with the /S switch shows the absolute path of data sets and directories.

/L
Shows data sets and directories in lower-case letters, not in capital letters. Mathematical ciphers or other characters make no difference.

/O:[ D | E | G | N | S | U ]
Shows in a certain order. The default order is to group directories first, and to sort data sets and directories by name. That default order will be applied if commanding the /O: switch without arguments. The arguments after the /O: switch specify the order for showing data sets and directories. That order may be:

D sorts by the last modification date, with the earliest first

E sorts by data set type

G groups the directories first

N sorts by data set name

S sorts by size, with the smallest first

U does not sort, the list remains unsorted, overriding the default order

Each sort order except U (unsorted), may be prefixed by a minus sign to reverse the sorting order. the U argument effectively cancels any previous setting or specified sorting order, useful for example to override an /O switch given from the DIRCMD environment variable.

If the same sorting order be specified more than one time within the same /O switch, then the last sorting order supersedes (overrides) the previous ones.

If more than one /O switch be specified, then the last /O switch supersedes (overrides) all previous ones.

WARNING: The entries are cached within memory before showing them. If Free-COM run somewhat short on memory, then the entries are sorted only in chunks, and if very short of memory, then any sorting operation is completely disabled. DIR can usually sort well over a thousand entries.

/P
Pauses the screen after issuing one screen-full. Almost any key of the keyboard can be pressed to continue.

/S
Recursively shows the contents of directories.

/W
Shows in wide format, five whole names (names and types) of data sets and directories per line. The lines showing the size, the date, or other informations, are suppressed.

/Y
Shows years in four ciphers, not only in two ciphers (same as the /4 switch).

/4
Shows years in four ciphers, not only in two ciphers (same as the /Y switch).

/LFN
(Long file names) With Long Name driver loaded, it shows the DOS short name (8.3 format) at the left and, if any, the Long Name at the right. Long name is experimental feature in Free-COM, not supported by all versions. It does not accept the wide format, the /W switch must not be present. Unfortunately, the command interpreter 4DOS.COM needs a real VFAT data set system for handling Long Names, it does not normally work with just a Long Name driver in FAT 12, FAT 16 or FAT 32

An explanation about handling Long Names in DOS systems is in the Appendix

First Example

DIR

Shows the content of the current directory, but ignores System data sets or also Hidden data sets.

Second Example

DIR a* bb* *.txt

First it shows all data sets that begin with the 'A' letter.
Second all data sets that begin with 'BB', two consecutive 'B' letters.
Third all data sets with the .TXT type.

Third Example

DIR /w a* b*
DIR a* /w b*
DIR a* b* /w

Because the relative location of options is not significant, then all those examples behave in the same way. Any of them shows all data sets starting with the 'A' letter or else with the 'B' letter, and shows the matching data sets in wide format, also called short format.

DIRS

Shows the directories that are listed in the LIFO directory stack.

See also: CHDIR , POPD , PUSHD

Requirements: CMD_DIRS

Synopsis dirs

dirs shows the directory stack

DIRS

Shows all directories that have been stacked with the PUSHD command into the LIFO directory stack.

Definitions of current directory, current working directory, current volume, LIFO, and other definitions, are in the Appendix

ECHO

Shows on screen or printer a line of text or a blank line.

ECHO is also a command in FDCONFIG.SYS or equivalent start configuration.

See also: TYPE

Requirements: CMD_ECHO

Synopsis echo[.] [on|off] [message]

echo without arguments, simply shows the on or off status.

echo. from batch process, shows a blank line on the screen or printer.

echo [on|off] turns on or off the lines shown from a batch process. With echo ON command lines in the batch process are shown as they are run. With echo OFF they are simply not shown, but the commands that they contain are not affected.

echo message shows a message on the screen or printer.

Commands can also be suppressed by starting them with the "at" (@) symbol. For example:

@REM this line is not shown because it starts by "at", independently of ECHO

ECHO [ ON | OFF ]
ECHO «string»
ECHO.

When executing a batch process, each line is by default shown on the screen before being executed. The first variant of ECHO enables or disables that behaviour. To disable the echoing of commands is equal to prefix each line of a batch process with the 'At' symbol (@).

Batch processes are defined in the Appendix

If ECHO be invoked with no arguments at all, then the current echo status is shown, either ON or OFF. When entered into an interactive command line, the echo status controls whether or not the PROMPT string be shown.

The second variant shows the specified string. Due to the syntax of the first variant, the string may not expand to the single words ON or OFF without another character.

The third variant shows an empty line. No space must be inserted between ECHO and the dot (.) that immediately follows.

First Example

ECHO

Shows the current echo status, therefore responding for example:

ECHO is on

Second Example

@ECHO OFF

Disables the echo status. The 'At' symbol (@) disables the echo status only for the line where it appears, but the command ECHO OFF disables the echoing of all the next lines of a batch process. Inserting the 'At' symbol (@) and ECHO immediately after it, then the line is not itself echoed to the console. It is, therefore, usually put in the first line of a batch process.

No space must be inserted between the 'At' symbol (@) and the ECHO that immediately follows.

Third Example

ECHO This is a text

Shows the line "This is a text" on screen.

ENVIRONMENT_KEEP_FREE

Keeps free space in the segment of RAM containing environment data.

If defined on compilation of Free-COM, then Free-COM will try to keep the unused space in the segment of RAM containing environment data, as being equal to or greater than the ENVIRONMENT_KEEP_FREE variable. The default value is 256 bytes.

ERASE or DEL

Erases data sets in a volume or directory, removing entries from the Allocation Table.

See also: DIR , UNDELETE , XDEL

Requirements: CMD_DELETE

Synopsis erase [vol:][path]name [options]

vol:path\name the name of a data set to erase. A period may be used to specify all data sets in the current directory, the same as using *.*

/p prompts to confirm, before erasing the data set.

ERASE [{ options | pattern }]

Erases data sets. If pattern match a directory, then all data sets within that directory will be erased. When all data sets have been commanded to be erased, a warning prompt is issued to confirm or reject the erasing operation.

Options

Unless stated otherwise all options of this command follow the standard rules for options, explained in the Appendix

/P: Prompts the human operator to confirm, before erasing a data set.

/V: Shows which data sets are erased.

First Example

ERASE YOYODYNE.BAT FROBULAT.COM

Erases the data sets YOYODYNE.BAT and FROBULAT.COM

Second Example

ERASE /P *.BAK

Erases all data sets with the .BAK type, but before erasing each data set it prompts the human operator to confirm or reject it.

Third Example

ERASE LASTYEAR.* /V Erases all data sets with the name LASTYEAR, regardless of their type, and shows which data sets are erased.

Fourth Example

ERASE .

Erases all data sets within the current directory, issuing first a warning prompt to confirm or reject.

EXIT

Exits command interpreter if not being the primary, if not loaded with /P

Synopsis exit

exit exits the current instance of the command interpreter.

EXIT

Terminates the currently running shell, unless Free-COM be the primary shell.

If Free-COM be not the primary shell, then the EXIT command terminates the currently running shell, unless Free-COM had been started with the /P switch. In this case, the EXIT command works like the CANCEL command.

FEATURE_ALIASES

Command aliases, a word can replace another word or a whole line.

See also: ALIAS

This feature is available only if defined during compilation of Free-COM.

With this feature, Free-COM supports command aliases.

New aliases are defined using the command:
ALIAS name=«string»

Aliases are removed using the command:
ALIAS name=

When Free-COM is interpreting a command line, then the very first word (the command) is matched against all defined aliases. The word is separated from its arguments by white spaces and cannot contain any path delimiters, such as back slashes (\) or colons (:)

If the command match an alias, then the name is substituted by the string associated to the aliases. For example, after defining the alias ls by:
ALIAS ls=dir /w /o

Then Free-COM will interpret the command line:
ls /a

Exactly as if one had typed:
dir /w /o /a

To prevent the alias expansion, an asterisk is prefixed before the command. For example:
*ls /a

Really tries to execute the command:
ls /a

Which is an internal command in Unics, but usually an external command in DOS.

Aliases may be used to hide or to re-place internal commands, as in:
ALIAS dir=xdir

Which effectively hides the internal command DIR and will always execute the command XDIR, usually external.

Aliases may be nested, so if both alias definitions mentioned above be in place, then the command:
ls /a

As implied above, aliases are expanded when needed, and not when they are defined.

Aliases are stored for each instance of Free-COM individually, and are inherited by secondary instances from the parent.

Compile-time options:

* ALIAS_DEFAULT_SIZE: The size reserved for all aliases per Free-COM instance. The default is 1024 bytes, 1 Kilobyte.

FEATURE_AUTO_REDIRECT_TO_CON

Automatically switches from the CON: console device to the screen.

Defines how many loops may pass before switching the console CON: to the screen. The default is five loops.

FEATURE_BATCH

Commands can be given in a batch process and executed in sequence.

Requirements: IMPLICIT

The batch script processing is always enabled.

Compile-time options:

BATCH_NESTLEVEL_MIN: Minimal supported batch nesting level. The default is five nesting levels.

FEATURE_BOOT_KEYS

Uses the F8 or also F5 keys for processing or bypassing configurations.

If the /P switch had been given to Free-COM from FDCONFIG.SYS or equivalent start configuration, then at boot-strap the F8 key asks for confirmation of each configuration line, while the F5 key bypasses all the remaining lines of configuration. This feature is available only if defined during compilation of Free-COM.

If the /P switch be present, then Free-COM waits three seconds at start for the F5 key or for the F8 key. The F5 key bypasses AUTOEXEC.BAT, FDAUTOEX.BAT or another start batch process. The F8 key enables trace mode, asking for confirmation of each line in whichever of those start batch processes.

F5 is equal to pass the /D switch to Free-COM.

F8 is equal to pass the /Y switch to Free-COM.

FEATURE_CALL_LOGGING

Every start of a Free-COM instance is logged into a text document.

This feature is available only if defined during compilation of Free-COM.

With this feature, every start of a Free-COM instance is logged into a text document.

Compile-time options:

LOG_FILE: The name of the log document. The default is:

C:\FREECOM.LOG

The volume in which the log document is created can be changed at run-time with the PTCHLDRV external executable.

FEATURE_DIRSTACK

Directory stack, an ordered history of directories visited.

See also: DIRS , POPD , PUSHD

This feature is automatically enabled if PUSHD be enabled.

The LIFO directory stack pushes or pops directories by the respective commands PUSHD and POPD. The DIRS command shows all directories pushed into the stack.

Definitions of current directory, current working directory, current volume, LIFO, and other definitions, are in the Appendix

More information is in the documentation of the mentioned commands.

Compile-time options:

DIRSTACK_DEFAULT_SIZE: The amount of bytes reserved to store items of the directory stack. The default is 256 bytes.

FEATURE_ENHANCED_INPUT

Enhanced editing of the command line.

See also: FEATURE_FILENAME_COMPLETION , FEATURE_HISTORY

This feature is available only if defined during compilation of Free-COM.

With this feature, enhanced command line editing features will be activated. Otherwise Free-COM uses the default buffered input DOS API function #0A

If this feature be disabled, neither command line history nor name completion will be available.

Besides the other features, various key bindings are recognised.

FEATURE_FILENAME_COMPLETION

Completes names that match those of existing data sets.

Requirements: FEATURE_ENHANCED_INPUT

This feature is available only if defined during compilation of Free-COM.

With this feature, and with the enhanced command line editing activated as well, then the tabulator key binding becomes available.

When pressing the tabulator key, the word in which the cursor is located, or the word immediately preceding the cursor, is separated from the rest of the command line, into a memory buffer (although visually, the word continues present at the command line).

That word is compared to names of data sets, looking for a match. That function of Free-COM is similar to the equivalent function of the DIR command, and when correctly used, it greatly helps to work with the computer. Therefore attention to this careful explanation.

For example, there is the following command line:

bar\f /a /b /c /1 /2

The switches /a /b /c /1 /2 are only an example, to illustrate how they will be kept in place after name completion. In the command line above, the cursor is located immediately after the "f", presenting this visual appearance, with the blinking dash (_) as the cursor:

bar\f_ /a /b /c /1 /2

Then the Tab key is pressed. Free-COM will try to locate any data sets or directories matching the pattern:

bar\f*.*

That means any data sets or subdirectories starting with the "f" letter, inside the "bar" directory. If none be found, then a beep sounds, meaning "None !", and the command line remains unchanged.

Otherwise, as many characters are appended to the name as are equal characters for all found matches, following these rules:

If only one match have been found, its name is appended to the command line.

If for example the data sets or subdirectories FOO, FUU.TXT or FUU be present in the directory BAR, then no name or characters are appended to the command line, because there are no equal characters following the already present "f" character.

If for example the data sets or subdirectories: FOO, FOO.TXT or FOO1.TXT be present in the directory BAR, then the two characters "OO" are appended, because all found matches share these two characters immediately following the already present characters. In that case the command line is expanded to:

bar\FOO_ /a /b /c /1 /2

With the blinking dash after the "O" representing the cursor.

The upper or lower case of all characters will match the upper or lower case of the retrieved names.

In the second and in the third cases above the completion of name has not been total, because more than one match has been found. Then a beep sounds. In this situation the Tabulator key can be pressed a second time, without any other key press in between, to show all available matches while keeping the command line unchanged.

If only one name match have been found, then the name completion has been total, and if the found match be a directory, then a back slash (\) is appended to it, allowing to go quickly to deep levels of the directory tree.

Free-COM has the following behaviour, which differs from most other command interpreters offering name completion: in the above mentioned command line examples, if the cursor had been put under the back slash (\), then the full string:

bar\f

Would have been tried to be completed as well, not only the "f" letter.

Compile-time options:

FILE_SEARCH_MODE: mode passed to the DOS API to acquire matching directory entries. The default mode is Read-Only, Archive, Directory.

FEATURE_HISTORY

Manages command line history.

See also: HISTORY

Requirements: FEATURE_ENHANCED_INPUT

This feature is available only if defined during compilation of Free-COM.

With this feature, and with the enhanced command line editing activated as well, then the command line history becomes available.

When commands be entered manually into the command line prompt of Free-COM, then old command lines are stored in the history buffer, and can be retrieved later using the key bindings of F3 or F1, plus the cursor Up or Down keys. Without such command line history, only one line is stored for possible later retrieval.

The following command shows all command lines stored in the history buffer:

HISTORY

The following one resizes the amount of bytes reserved to the history buffer for storing command lines, to a number of bytes. This operation erases all previously stored command lines:

HISTORY number

Each instance of Free-COM maintains its own command line history, which is initially inherited from the particular parent instance, if any.

Compile-time options: HISTORY_DEFAULT_SIZE: The amount of bytes initially reserved to the history buffer. The default is 256 bytes.

FEATURE_INSTALLABLE_COMMANDS

Installable Commands interface, specification MUX-AE

This feature is available only if defined during compilation of Free-COM.

With this feature, calls to the Installable Commands API, Application Programme Interface, are made before executing any command. The API is situated at MUX-AE, the Multiplexer interrupt 0x2F function 0xAE.

The interface is documented elsewhere, for instance in Ralph Brown Interrupt List, available in the Internet.

FEATURE_LAST_DIR

Changes to the most recent directory visited before the current one.

See also: CDD , CHDIR , POPD , PUSHD

This feature is available only if defined during compilation of Free-COM.

With this feature, every change of the current directory using an internal command data sets the previous directory and enables the minus sign (-) short cut for the commands CDD and CHDIR (or CD).

A sequence of four commands as example:

CHDIR \ CHDIR freedos\bin CHDIR - CHDIR -

In that sequence, the first command CHDIR \ changes to the top level directory of the current volume. The top level, also called root directory, is represented by the back slash (\). The second command CHDIR freedos\bin changes to the directory \FREEDOS\BIN of the current volume. Each of the third and fourth commands CHDIR -, or any subsequent CHDIR - commands, will change between the top level directory and the \FREEDOS\BIN directory.

FEATURE_LOAD_MESSAGES

Loads messages permanently into Random Access Memory.

This feature is available only if defined during compilation of Free-COM.

With this feature, the /MSG switch becomes available. The /MSG switch requires the /P switch as well.

When invoking an instance of Free-COM with the /MSG switch, then all messages coming from Free-COM are loaded "permanently" (for the session) into Random Access Memory. They will disappear by switching off, resetting or restarting the computer.

Without the /MSG switch the messages are loaded only on demand, and they are removed from memory when an external command be executed. This is done in order to conserve memory for other purposes.

Free-COM takes a time to load its own messages from a storage volume, especially from a floppy disc. Therefore this feature is usually helpful in a floppy-only system, but it requires to have sufficient available RAM. In a system with a tiny RAM, it may not be possible or not convenient to use it.

FEATURE_NLS

Uses National Language Support for characters other than 7-bit ASCII

This feature is available only if defined during compilation of Free-COM.

With this feature, Free-COM reads the information retrievable by the currently active National Language Support, using the #65 API functions.

Such information is used for characters other than 7-bit ASCII, and it also influences other presentations:

The format of date and time.

The currency string and its display format.

The characters used to delimit items in lists.

How to sort characters (the sorting order).

How to change from upper case to lower-case characters. This is possible with some National Language Supports, but not all of them.

FOR

Repeats a command according to a given variable.

Requirements: CMD_FOR

Synopsis for [ % | %% ]variable in (set) do command [options]

for %variable in (set) do command [options] used at the command line.

for %%variable in (set) do command [options] used in a batch process.

In both cases FOR runs a command for each data set in a set of data sets.

%variable or %%variable a name for the parameter that will be replaced with each data set name.

(set) the set of data sets. Wildcards * or also ? may be used.

command the command to run for each data set.

options passed to the command.

FOR repeats commands, allowing for different parametres through variables. Complex instructions can be programmed by using the FOR command correctly.

Example to show all .TXT data sets in the current directory, one after another:

for %f in (*.txt) more %f

FOR % letter IN ( { word | pattern } ) DO «any command»

Executes «any command» for several values assigned to the variable letter. The values are read strictly left to right from the words and patterns enclosed in parentheses, where patterns are words containing wild cards and are replaced by all matching data set names.

Any occurrence of a percent sign (%) and the specified letter is replaced by the current value of the FOR loop. The letter is case-sensitively matched, thus for example "A" and "a" look for different matches.

First warning:

Unlike most commands, Input Output redirections are passed forth to the command instead of applying them to FOR itself, for instance:

FOR %a IN (*.*) DO ECHO %a > notes.txt

The following kludge has been included to support FOR and its special variables:

-First, it is permissible to use many percent characters, but exactly the same number of percent characters must be used for a particular FOR variable.

-Second, before expanding any environment variables, the command line is checked for the skeleton line specified in the synopsis above, repeated here.

With such an expansion, then any environment variables within the command will be expanded a second time. In this case the Input Output redirections will be also applied to FOR, instead of passing them forward to the command.

-Fourth, the FOR command is never found as a part of the commands CALL, IF, or FOR itself, before expanding the environment variables.

Third warning:

In the Microsoft Knowledge Base it has been documented a programming error with the identity number 1050, which affects the COMMAND.COM of MS-DOS and of Windows 1.x, Windows 2.x, Windows 3.x, Windows 95, Windows 98, and Windows Millennium Edition.

Due to that programming error, the right parenthesis must be followed by at least one white space. That white space allows the "feature" to embed such characters within the words and patterns. For instance, the following command line executes the command two times, first replacing %a by a()a, and second replacing by b()b before the right parenthesis and white space:

FOR %a in (a()a b()b) DO command

First Example

FOR %z IN (*.*) DO copy %a a:

That command line is equal to:

COPY *.* A:

It performs a COPY xyz A: command for each data set in the current directory, copying all of them to the A: floppy disc.

Second Example

FOR %z IN (a?b*.TXT) DO CALL batch arg %z

That one executes the BATCH.BAT batch process for each data set in the current directory matching the pattern A?B*.TXT (where the "?" stands for any one valid character and the "*" for any sequence of valid characters, therefore for instance AABFROBU.TXT or AZBFROBU.TXT would be valid).

Within the BATCH.BAT batch process, the automatic variable %1 always expands to the constant argument arg, whereas the %2 expands to the data set name of the current loop.

Third Example

FOR %a IN (1 2 3 4 5) DO ECHO %a

That is equal to the command sequence:

ECHO 1
ECHO 2
ECHO 3
ECHO 4
ECHO 5

Because those words do not contain wild cards (the "?" or "*" said above), then they are not matched as data set names.

Fourth Example

FOR %g IN (1 2 3*) DO ECHO %g

That command line performs the commands:

ECHO 1
ECHO 2

And also performs the ECHO command for every data set in the current directory that lack data set type, and whose data set name start with "3" (cipher three). Thus, for example 3FROBU will be echoed, but 3FROBU.TXT will not be echoed because it has the .TXT type, and FROBU3 will not be echoed either because its name starts with "F" and not with the cipher (digit) three.

Using the FIND programme in combination with the FOR command

Syntax of the FOR command:

FOR %v IN (...) DO [command [switches]] %v
The variable represented as '%v' in the above line may use any letter. The percent sign must be written before the letter that names the variable. The FOR command creates a new variable, which is valid in the [command [switches]] following the DO keyword.

The FOR command is not supposed to be changed using the SET command.

Example to find the string 'Dixie' in any data set located in the current directory of the current volume:

FOR %a IN (*.*) DO FIND "Dixie" %a

The upper or lower cases used above for the commands FOR, IN, DO and FIND are merely illustrative, the line is not case sensitive. However, the FIND programme will search for the string 'Dixie' with case sensitivity. It will not find any strings such as 'dixie' or 'DIXIE', or any combination of upper and lower case.

The /I switch can be given to the FIND programme, telling it to ignore case during the search, thus finding a string without regard to upper or lower case:

FOR %a IN (*.*) DO FIND /I "Dixie" %a

The procedure may be combined in uncountable ways. For example, to show also the number of the line where each instance of the string 'Dixie' be found, then to append all results to a document called DIXIE.TXT located in the current directory of the current volume:

FOR %a IN (*.*) DO FIND /I /N "Dixie" %a >> DIXIE.TXT

The redirection must be done by the appending process, which uses two 'greater than' symbols >>

Only one 'greater than' symbol cannot be used, because then the FIND programme would overwrite DIXIE.TXT at every passing, and as a result DIXIE.TXT would show that only one line has been found by the FIND programme.

GOTO

Unconditionally goes to specified line label (conditionally with IF).

Requirements: CMD_GOTO

Synopsis goto [:]label

goto :label goes to another part of a batch process.

The flow of the batch process will unconditionally jump to the label and continue running thence. The GOTO command can be combined with the IF command for conditional control of the flow.

GOTO [ : ] label

Without the GOTO command, all commands of a batch process are executed in the sequence in which they appear: lines from top to bottom, and inside each line commands from left to right. The GOTO command controls the flow of lines by jumping unconditionally to the specified label. The jumping can be made conditional (branching) by combining the IF and GOTO commands. In either case, any commands following the specified label will then be executed, as far as eventually reaching another jumping or another branching.

A label is written as a colon (:) in the first column of a line (the first character), with the name of the label immediately behind, without spaces. A label encountered in the normal flow is completely ignored, even any redirection characters in that line are ignored. The label only works when being the target of a GOTO command. Consequently, a label not pointed by a GOTO, could also be used as a remark, or for temporary disabling of that line and all the following lines as far as the next active label.

That mechanism is used in lieu of the line numbering that appears in most early dialects of programming languages such as Basic, although line numbering could in theory also be used in a batch process if desired, simply by starting with a GOTO command pointing to a label representing a number, at the end of that line another GOTO command to another label representing a higher number, and so on for the whole batch process, for instance:

GOTO :10
:10 command line... GOTO :20
:20 command line... GOTO :30
:30 command line... GOTO :XX
...many labels and command lines...
:XX command line... GOTO :END
:END

It is obvious, then, that a batch process is the source of instructions of an interpreted programming language, which like any other programming language, it can be better used for certain purposes and inside certain limitations, while it is difficult or impossible to use it for other purposes or beyond those limitations. A collection of batch processes, such as a collection of aliases, greatly enhances the functionality, flexibility and efficiency of the command line, when using those batch processes or those aliases correctly.

Batch processes are defined in the Appendix

The label must be located in the same batch process as the corresponding GOTO command. In the case of a label appearing more than once, then the first occurrence takes precedence. Thus, there may be other labels of the same name pointed by different instances of the GOTO command, in which case the first label of that name, encountered after each GOTO, will be taken as valid label. However, it is considered bad practice to repeat label names. Each name should be unique within a batch process. It may be repeated in another batch process.

The GOTO command alone is an unconditional jump. As said above, conditional jumps (branches) can be constructed with the help of the IF command. The second example below illustrates that possibility.

First Example

GOTO ende
GOTO :ende

Either of the two lines above jumps unconditionally to the line starting with the label ":ende". Important: the colon (:) in the ":ende" located after the GOTO command is optional, but the colon (:) in the ":ende" located in the labelled line is mandatory.

Second Example

IF "%1"=="" GOTO emptyCommandLine

Conditionally jumps (branches) to the label called ":emptyCommandLine", if no argument have been passed to the batch process. That absence of argument is given by the string "%1"=="" (the repetition of speech marks is necessary). For instance:

@ECHO OFF
IF "%1"=="" GOTO :error
REM Do something sane here
GOTO :ende

:error
ECHO You must pass an argument to me !

:ende

Therefore if not having previously passed any arguments, then the above batch process will jump (branch) to the label ":error", and will print on the screen the warning "You must pass an argument to me !", but if having already passed some argument, then the batch process will jump (branch) to the label ":ende" and the programme will terminate.

HISTORY

Shows command line history, an ordered history of previous commands.

Requirements: FEATURE_HISTORY

Synopsis history

HISTORY
HISTORY number

The first format without any argument shows all command lines in the history buffer.

The second format resizes the memory pre-allocated for the history buffer, to the number of bytes specified by "number", thus giving space to more or to less command lines to be stored, and correspondingly taking that space of RAM out of other uses, or making it available for other uses.

The last command line can also normally be retrieved by pressing the F3 key.

IF

Conditional execution of a command, or a branching to another line.

Synopsis if [not] [errorlevel] number [string1==string2] [exist] [vol:][path]name command [options]

not makes the command to run if the condition be false. Otherwise the command will run if the condition be true.

if [not] errorlevel number command [options]

errorlevel number returned by an executable when exiting, which may contain information on the success of an operation. If the last executable have returned the specified number when it exited, then the condition is true.

if [not] string1==string2 command [options]

string1==string2 if the two strings of characters be equal, then the condition is true.

if [not] exist [vol:][path]name command [options]

exist [vol:][path]name if the specified data set be found, then the condition is true.

command to run if accomplishing the specified conditions.

options passed to the command if it be run.

IF [ NOT ] EXIST data set «command»
IF [ NOT ] ERRORLEVEL number «command»
IF [ NOT ] string '==' word «command»
IF [ NOT ] quoted-string '==' quoted-string «command»

Conditionally executes the specified «command»
If the keyword NOT be specified, then the condition is negated, meaning that the command will be executed only if the condition be evaluated to "false", but the command will not be executed if the condition be evaluated to "true".

IF EXIST data set «command»
The first line in the synopsis (without the NOT) will be evaluated to true if the specified data set exist and could be found. Wild cards are supported. In local data set (file) systems it is also possible to test for character devices.

IF ERRORLEVEL number «command»
The second line in the synopsis (without the NOT) will be evaluated to true if the error level be currently assigned to a number equal or greater than the specified number. Error levels are assigned when external executables terminate, or can be assigned by the CANCEL or the QUIT command.

For the purpose of compatibly with other command interpreters commonly used in DOS systems, Free-COM does not check if the specified error level be a number, but silently accepts any string of characters. Such acceptation allows to use the so-called "Benny levels", where it is possible to specify:

HA, HB, HC... HZ

Or to specify:

xa, xb, xc... xz

Instead of specifying:

1, 2, 3... 26

Some malformed batch processes use that syntax for the mapping of error levels to letters representing storage volumes or other devices, to be seen more visibly. The fifth example below illustrates that bad practice.

Batch processes are defined in the Appendix

IF string '==' word «command»
IF quoted-string '==' quoted-string «command»
The third and the fourth lines in the synopsis (without the NOT) will be evaluated to true when the string at the left side of the double equal sign, be case-sensitively equal to the string at the right side. Either side may be quoted by double speech marks, but if the right side be not quoted, then the first word will only be tested.

In every example below it will be observed that the key word THEN is not used, unlike in the Basic programming language. The IF... THEN characteristic of Basic, here becomes simply IF... followed by the relevant instructions.

First Example

IF NOT EXIST c:\command.com ECHO There is no COMMAND.COM in C:\

If COMMAND.COM could not be found by that name at the top of the C: volume, then the warning 'There is no COMMAND.COM in C:\' will be shown on screen. The command interpreter may have been renamed or moved to another directory or another volume. The system may still work, but the warning will be shown anyway.

Second Example

IF EXIST c:\fdos\nul GOTO fdos_directory_present

If the data set NUL exist in the FDOS directory of the C: volume, then the batch process will branch to the label "fdos_directory_present".

Because the data set name NUL also corresponds to the character device NUL: that always exists, then that test may be used to test the existence of the path C:\FDOS, because NUL: and all other character devices are virtually present in every directory of local data set (file) systems.

Third Example

IF %1==name ECHO First argument is "name"

If the first argument of the current batch process be 'name' (without the speech marks), then the phrase 'First argument is "name" (with the speech marks)' will be shown on screen.

The %1 may be expanded to any string, even with embedded white spaces or with an embedded double equal sign or metacharacters. Such behaviour is different from that of the previous example.

Fifth Example

«programme»

SET vol=

FOR %%Z IN (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF ERRORLEVEL H%%Z SET vol=%%Z

This is typical of Free-COM and some other command interpreters, while the following one is fully compatible to all known command interpreters:

«programme»

SET vol=

FOR %%Z IN (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF ERRORLEVEL H%%Z SET vol=%%Z

IF ERRORLEVEL 27 SET vol=

IF "%vol%"=="" goto error_no_volume_letter

IF ERRORLEVEL 1 SET vol=A

IF ERRORLEVEL 2 SET vol=B

IF ERRORLEVEL 3 SET vol=C

...

IF ERRORLEVEL xx SET vol=x

...

IF ERRORLEVEL 26 SET vol=Z

IF ERRORLEVEL 27 SET vol=

IF "%vol%"=="" goto error_no_volume_letter

A much longer batch process is that, but sure to be understood by any command interpreter. More than twenty-six volumes cannot exist, therefore the twenty seventh volume has no assigned letter and will thus go to the label "error_no_volume_letter", which may for example print a warning on screen.

LFNFOR

Turns ON or OFF the use of LFN in FOR and in the completion of names.

LFNFOR [ON|OFF]

LFNFOR COMPLETE [ON|OFF]

The default is OFF, so Free-DOS uses short names for the FOR command and in the completion of names. When COMPLETE come before ON or OFF, then LFNFOR turns ON or OFF the use of LFN in the completion of names.

If no arguments be named, then the current status ON or OFF is shown.

LOADFIX

Loads external executable above first 64 Kilobytes of low Random Access Memory.

See also: CALL , LOADHIGH

Synopsis loadfix [vol:][path]name [options]

vol:path\name the executable to load.

options passed to that executable.

LOADFIX executable [{ argument }]

Loads and executes an executable packed as .exe

Without the LOADFIX command, that executable might not start and the system would issue on screen the error message "Packed file corrupt"

The LOADFIX command is not available in the XMS-only variant of Free-COM, which uses extended memory.

Example:

LOADFIX frobu.exe

Loads FROBU.EXE above the first 64 Kilobytes of RAM, and executes it.

LOADHIGH or LH

Loads external executable into High Memory Area of Random Access Memory.

See also: CALL , LOADFIX

Synopsis loadhigh [vol:][path]name [options]

vol:path\name executable to load into high memory.

options passed to that executable.

LOADHIGH [{ option }] executable [{ argument }]

Loads and executes an external executable in the High Memory Area, also called UMB, Upper Memory Blocks.

The LOADHIGH command is used to load TSRs (software that Terminates and Stays Resident in RAM) into Upper Memory, such as drivers for mice or other pointing devices, in order to keep low conventional memory available for executables.

Example:

LOADHIGH lmouse.com

Loads LMOUSE.COM (Logitech Mouse) into High Memory (UMB), normally to stay resident for the rest of the DOS session.

The LOADHIGH command may be abbreviated as LH with other command interpreters.

MEMORY

Shows the internal use of RAM by the command interpreter itself.
Not to be confused with MEM.EXE, which is an external executable.

Requirements: CMD_MEMORY

Synopsis memory memory shows the internal use of RAM by Free-COM

MEMORY

Shows the usage of internal memory by Free-COM itself.

Example

MEMORY

May show something similar to this:

Environment segment  : max    1200 bytes, free     8 bytes
Context segment      : max    2304 bytes, free  2252 bytes
    Aliases          : limit  1024 bytes, current  5 bytes, 0 items
    History          : limit   256 bytes, current 34 bytes, 2 items
    Directory stack  : limit   256 bytes, current  5 bytes, 0 items
    Last dir cache   : used      0 bytes,                   0 items
    Swap information : used      0 bytes,                   0 items
Heap                 : free 482080 bytes

The internals of Free-COM are currently under heavy construction, thus the output might vary heavily from the example given above.

The environment variables are stored in the environment segment, which is the storage area. The Environment segment may be changed passing the /E option to Free-COM, and a value in bytes.

Free-COM stores several internal informations in the context segment. Such informations are:

    The aliases (shown or modified by the ALIAS command).

    The command history (shown by the HISTORY command, modified by pressing the cursor Up or Down keys at the command line and editing them). The last command can normally be retrieved also by the F3 key.

    The directory stack (shown by the DIRS command, accessed by the PUSHD or POPD commands).

    The last directory (accessed by the CHDIR - command).

    Some internal commands used by the low-level swap interface of Free-COM.

The heap is the storage area where Free-COM allocates memory for itself. This value is mainly useful for Free-COM programmers.

"max" specifies the maximum amount of bytes that can be allocated within the storage area.

"free" specifies the unused bytes within the storage area.

"limit" specifies the maximum amount of bytes that can be allocated for the particular information within the area.

"current" specifies the amount of bytes currently allocated for the particular information.

"items" specifies the number of items stored for the particular information, for example how many directories have been pushed onto the LIFO stack using the PUSHD command.

Definitions of current directory, current working directory, current volume, LIFO, and other definitions, are in the Appendix

MKDIR or MD

Makes a new directory.

See also: CHDIR , RMDIR

Requirements: CMD_MKDIR

Synopsis mkdir [vol:]path

mkdir [vol:]path makes a new directory in current or specified volume.

MKDIR path

Creates a directory of the specified name path. Any parent directories must already exist.

First Example

MKDIR C:\1

Makes a new directory called "1" at the second level, this is, immediately below the top level of the C: volume.

Second Example

MKDIR C:\1\2\3

Makes a new directory called "3" inside the directory "2", which is inside the directory "1", which is itself at the second level, this is, immediately below the top level of the C: volume.

For that example to work, the directories "2" and "1" must already exist in the specified path of the C: volume. If any of them do not exist in that path and volume, then MKDIR will not make the directory called "3" and will issue an error message.

PATH

Shows or sets the path to search for batch processes or executables.

Requirements: CMD_PATH

Synopsis path [pathlist]

path without arguments, it shows the current list of paths separated by semicolons (;)

path [pathlist] paths that Free-COM will search for batch processes or executables. Free-COM will look first in the current directory, then in each of the paths specified by the path command, in that order.

Example:
path c:\docsmain;c:\execmain
Sets the path c:\docsmain and the path c:\execmain
path %path%;c:\games
Adds the path c:\games to the existing list, keeping paths previously listed.

In the original distribution of Free-DOS many executables are in the \bin directory, although not all of them. The path to the \bin directory or the paths to other executables frequently used can be put in the path list for convenience. Most commands listed in this page are internal to Free-COM, they cannot appear in the path list, but a few have identical name with external executables (WHICH), or similar names that may be confusing (MEM, MEMORY). The external ones can be put in the path, if desired.

PATH
PATH [ = ] { path : ; }
PATH;

Shows or assigns a new search path.

The first variant shows the currently active search path.

The second variant assigns the specified paths to the search path. The leading equal sign, if present, is ignored.

The third variant empties the search path.

When Free-COM search for an external executable or a batch process, without a path specified for it, then Free-COM searches in all the directories specified in the search path. If the current directory represented by a dot (.) be not mentioned in the search path, then it is searched first.

First Example

PATH c:\fdos\bin;c:\tools;d:\others\bin;bin

If Free-COM must invoke an external executable, such as XCOPY, then Free-COM will search for XCOPY in the following directories, in the specified order. The first XCOPY found will be executed:

1. the current directory
2. C:\FDOS\BIN
3. C:\TOOLS
4. D:\OTHERS\BIN
5. BIN

Because the last directory specified, BIN, is a relative specification rather than an absolute one, then XCOPY will be searched in the BIN sub-directory, if any, of the current directory. The eventual lack in the directory tree of a directory or sub-directory listed in the PATH presents no problem, it will simply be ignored when reaching its name.

PAUSE

Pauses a batch process, and asks to press a key to continue it.

Requirements: CMD_PAUSE

Synopsis pause

pause pauses a batch process, and asks to press a key to continue it.

PAUSE
PAUSE «string»

Pauses the batch process in which the PAUSE command be inserted, and asks to press a key to continue it.

PAUSE prompts the user with the specified string, or if no string be specifed, then with the following message or similar:

"Press any key to continue"

First Example

PAUSE

Pauses the execution and shows the message "Press any key to continue", or similar.

Second Example

PAUSE Execution paused. Read the instructions, then press any key to continue.

Pauses the execution and shows as a message only the string:

"Execution paused. Read the instructions, then press any key to continue."

Third Example

PAUSE > nul

Pauses the execution, but does not show any message.

Definitions of batch process, and other definitions, are in the Appendix

POPD

Changes to most recently pushed directory (top of LIFO directory stack).

See also: CDD , CHDIR , DIRS , PUSHD

Requirements: CMD_CDD, CMD_POPD

Synopsis popd

popd changes to most recently pushed directory (top of LIFO directory stack).

pushd [directory]

pushd is very similar to chdir, except that pushd stores the current directory in the LIFO directory stack, before changing to another directory. pushd can be used several times, storing a stack of directories. popd can later be used to retrieve each of the directories that had been stored by pushd. dirs can be used to see the directories stored, with the earliest at the top and the most recent at the bottom. Using pushd without specifying a directory will only store the current directory, without changing it. An example sequence:

chdir c:\fdos\bin
Changes the current directory to c:\fdos\bin without changing directory stack

pushd c:\games
Changes the current directory to c:\games and adds it to directory stack

pushd c:\utils
Changes the current directory to c:\utils and adds it to directory stack

popd
Changes the current directory to c:\games and erases c:\utils from directory stack

popd
Changes the current directory to c:\fdos\bin and erases c:\games from directory stack

POPD
POPD *

The first variant changes the current directory to the directory in which the most recent PUSHD command have been executed.

The second variant clears all entries of the directory stack (it empties the directory stack), but does not change the current directory.

Definitions of current directory, current working directory, current volume, LIFO, and other definitions, are in the Appendix

PROMPT

Shows or sets the prompt line of the command interpreter.

Requirements: CMD_PROMPT

Synopsis prompt [string]

prompt [string] changes the appearance of the command line prompt.

Using path without specifying a string, the prompt will return to its default appearance.

The following character sequences can be used to customise the command prompt:

$$   The Dollar symbol $

$_   Line break

$B   The Pipe character |

$D   The date

$E   The ASCII Escape character

$G   The Greater than > symbol

$H   Back space

$L   The Lesser than < symbol

$N   The current volume

Options

Unless stated otherwise, all options of this command follow the standard rules for options, explained in the Appendix

PUSHD

Makes the current directory the most recent in the LIFO directory stack.

See also: CDD , CHDIR

Options

Unless stated otherwise, all options of this command follow the standard rules for options, explained in the Appendix. Definitions of current directory, current working directory, current volume, LIFO, and other definitions, are in the Appendix

QUIT

Terminates current batch process (CANCEL terminates all of them).

Synopsis

QUIT [ n ]

Terminates the currently active batch process, and if present, assigns the specified number "n" to the error level.

QUIT is a hidden internal command, explained in the Appendix

REM

Explanatory remark inserted by the programmer into a batch process.

REM can be used to disable a command without erasing the line. REM is also a command in FDCONFIG.SYS or equivalent start configuration.

Requirements: CMD_REM

Synopsis REM [remark]

REM [remark] inserts an explanatory remark, or disables a command without erasing the line.

Example in FDCONFIG.SYS or equivalent start configuration:

REM YOYODYNE.SYS disabled due to suspected incompatibility with FROBU.EXE REM DEVICE=YOYODYNE.SYS /A

Example in FDAUTOEX.BAT or another batch process:

REM YOYODYNE.SYS disabled due to suspected incompatibility with FROBU.EXE REM DEVLOAD.COM /high /verbose YOYODYNE.SYS /A FROBU.EXE /A /B /C

REM «string»

Options

Unless stated otherwise, all options of this command follow the standard rules for options, explained in the Appendix. Definitions of batch process, and other definitions, are in the Appendix

RENAME or REN

Gives new name or type to one or more data sets, inside the DOS 8.3 convention.

Requirements: CMD_RENAME

Synopsis rename [vol:][path]oldname newname

rename [vol:][path]oldname newname new name or type to one or more data sets, inside the DOS 8.3 convention. A Long Name driver can be used for names or types outside the DOS 8.3 convention

An explanation about handling Long Names in DOS systems is in the Appendix

vol:path\oldname the original (source) that needs to be renamed.

newname the new name for what hitherto have been the old name. A path for the new name must not be included, for moving a data set to another location the commands copy and erase can be used, or the executable move.

Wild cards (* or ?) can be used to specify several data sets to rename. If wild cards be used in the old name, then they must be used in identical relative location of the new name.

RENAME «source» «destination»

Renames the source data set or data sets to the names (or also types) given as destination. It accepts wild cards, the interrogation (?) mark or also the asterisk (*) mark.

The destination must not contain any path specification. The source data set is renamed within the directory where it be currently located, see the second example below. Any wild cards used within the destination will be replaced by the corresponding character of the source data set name, see the fourth example below.

Options

Unless stated otherwise, all options of this command follow the standard rules for options, explained in the Appendix

First Example

RENAME doc1.txt text2.txt

Renames doc1.txt to text2.txt

Second Example

RENAME path\doc1.txt doc2.doc Renames path\doc1.txt to path\doc2.doc

Third Example

RENAME path\doc*.txt *.bak

Renames all data sets located within the directory path that have the .txt type, and whose name begin by "doc", to data sets with identical name but with the .bak type.

For example doc.txt to doc.bak, docu.txt to docu.bak, doc1.txt to doc1.bak, and so on.

Fourth Example

RENAME *.dat a*.*

Renames all data sets located within the current directory that have the .dat type, to data sets in which the first character of their name will be replaced by the "a" letter. All the other characters of the name, plus the .dat type and the path, remain unchanged.

For example frobu.dat to arobu.dat, curio.dat to aurio.dat, basic.dat to aasic.dat, and so on.

Fifth Example

RENAME *.txt ??b*.bak

Renames all data sets located within the current directory that have the .txt type, to data sets in which the third character of their name will be replaced by the "b" letter. All the other characters of the name, and the path, remain unchanged, but the .txt type will change to .bak type.

Warning:

In the above example, if the source name consist of only one character, then the second question mark in the destination pattern is ignored. Thus for example the data set a.txt will be renamed to ab.bak

That is incompatible with the COMMAND.COM of MS-DOS version 6.22 (of April 1994), and maybe with other command interpreters as well, which insert a blank space as the second character.

By those interpreters, a.txt would be renamed to a .bak (with a blank space between the initial 'a' and the dot), thus making the data set simply inaccessible from DOS systems, except by using a Long Name driver such as DOSLFN created by Herr Henrik Haftmann (included in the official Free-DOS distribution), or the executables for handling Long Names in DOS, separately created by Mister Fubi Dan and by Mister Ortwin Glueck (not included in the official Free-DOS distribution, but probably available in the Internet for download).

In the case of MS-DOS version 6.22, the strange behaviour of inserting a blank space is characteristic of the RENAME (or REN) and the COPY commands, internal to the COMMAND.COM interpreter of that DOS system. Free-DOS is in many aspects the best DOS system that has ever been created, and its Free-COM command interpreter has not that problem.

An explanation about handling Long Names in DOS systems is in the Appendix

RMDIR or RD

Removes an empty directory (all data sets must first be erased, or DELTREE used).

See also: CHDIR , MKDIR

Requirements: CMD_RMDIR

Synopsis rmdir [vol:]path

rmdir [vol:]path removes an empty directory (all data sets must first be erased, or the deltree executable used)

RMDIR path

Options

Unless stated otherwise, all options of this command follow the standard rules for options, explained in the Appendix

SET

Shows or sets environment variables (options read by executables).

Requirements: CMD_SET

Synopsis set [variable[=value]] [/C] [/E] [/I] [/P] [/U]

set shows a list of current environment variables.

set variable only shows the value of that variable.

set variable= removes that variable from the environment.

set variable=value sets that environment variable to that value.

/C does not convert the variable name to upper case. It only works for new variables, not for existing ones, but the variable can first be removed and then created again with the /C switch.

/U converts the new value of the variable to upper case.

/E executes the command specified by the value and sets the variable to the first line of output.

/I forces to ignore all the remaining command line. The /I option has been temporarily included in Free-COM to allow for an easy way to show the current size of the environment segment, because it is one of the most frequently reported programming errors, but not easy to reproduce.

/P prompts the human operator for a string, and assigns that input to the variable. If the ENTER key be pressed without giving an input, then an empty value is assigned to the variable, which is immediately removed from the environment. Variables without value cannot exist.

SET [{ option }]
SET [{ option }] variable = «string»

The first variant (without any argument) shows all the currently defined environment variables in the following format, without any blank spaces before or after the equal sign:

name=«value»

The second variant (with variable name and its string) assigns a string of new value to the specified variable. If the variable already exist, then the old value is overwritten without notice, otherwise the variable is created.

Options

Unless stated otherwise, all options of this command follow the standard rules for options, explained in the Appendix

If present, all options must follow the SET command but must precede the variable name and its assigned string.

/C: forces to keep, as given, the exact upper or lower case of every letter in the name of the variable. By default all letters are in upper case (capital letters), in order to keep compatibility with other command interpreters or with other DOS systems.

/I: forces to ignore all the remaining command line. The /I option has been temporarily included in Free-COM to allow for an easy way to show the current size of the environment segment, because it is one of the most frequently reported programming errors, but not easy to reproduce.

/P: prompts the human operator for a string, and assigns that input to the variable. If the ENTER key be pressed without giving an input, then an empty value is assigned to the variable, which is immediately removed from the environment. Variables without value cannot exist.

SHIFT

Shifts values in a batch process (for over nine automatic variables).

Requirements: CMD_SHIFT

Synopsis shift [down]

shift makes %2 take the value that %1 had, and so the other variables.

shift [down] makes %0 take the value that %1 had, and so the other variables.

SHIFT
SHIFT DOWN

Either of the two variants above, shifts the values of automatic variables appearing in a batch process. The first variant one place "upwards" (towards the end of the argument window), the second variant one place "downwards" (towards the start of the argument window).

The SHIFT command can be used when more than nine automatic variables appear in the same batch process. For nine variables or less, it is not normally necessary to use the SHIFT command.

Within a batch process the automatic variables %0 to %9 are replaced by the process name and the first nine arguments. That sequence of replacements can be imagined as a window showing ten arguments of the batch process. The SHIFT command allows to move the window of ten arguments "upwards" (towards its end), or to move "downwards" (towards its start).

After each execution of SHIFT, the former variable %0 becomes hidden and inaccessible, the former variable %1 becomes variable %0, the former variable %2 becomes variable %1, and so with the other variables, the former variable %9 becomes variable %8, and the formerly hidden tenth argument appearing in the batch process becomes now accessible as variable %9

All that sequence of replacements is known as "upwards", or towards the end of the argument window.

The SHIFT DOWN command inverts the above sequence of replacements into what is known as "downwards", or towards the start of the argument window.

The SHIFT command can be called from inside the batch process as many times as wanted, but the SHIFT DOWN command will not allow to underflow the very first argument, meaning that arguments (values) that have become inaccessible, remain inaccessible. The SHIFT command is just a shifter of values, not a FIFO queue or a LIFO stack.

Batch processes, FIFO queues, LIFO stacks, and other concepts, are explained in the Appendix

First Example

There is a batch process called B.BAT including these commands:

@ECHO OFF
ECHO 0: %0
ECHO 1: %1
ECHO 2: %2

That batch process is executed from the command line using arguments, as in:

B.BAT 1 2 3 4 [ENTER]

The screen then shows:

B.BAT
1
2

Opening B.BAT with a text editor, a SHIFT command is inserted as the second line, resulting in the following modification:

@ECHO OFF
SHIFT
ECHO 0: %0
ECHO 1: %1
ECHO 2: %2

Again B.BAT is executed from the command line, using arguments as before:

B.BAT 1 2 3 4 [ENTER]

The screen now shows:

1
2
3

For persons who do not programme batch processes, the above difference may seem a small detail of no consequence. For programmers, it is a valuable resource that gives ample flexibility to batch process programming.

TIME

Shows or changes the current time (follows COUNTRY.SYS, if loaded).

See also: DATE

Requirements: CMD_TIME

Synopsis time [/T] [newtime{A|P}]

/T only shows the time, without prompting for a new time.

time without new time, the current time is shown and Free-COM prompts for a new time. Pressing ENTER accepts the current time without changing it.

time /T without new time but with the /T switch, only the current time is shown, without prompting.

newtime{A|P} is the new time (the hour, minute, second, hundredth of second and optionally Ante Meridian or Post Meridian) like in:
hh:mm
hh:mm:ss
hh:mm:ss.ss

'hh' is the hour in a 24 hour clock or in a 12 hour clock.
'mm' is the minute.
'ss.ss' is the second and the hundredth of a second.

A | P time Ante Meridian or Post Meridian if using a 12 hour clock.

TIME [ /T ]
TIME [ /T ] time

The first variant shows the current system ts (.)
Colons (:)
Forward slashes (/)

The colon (:) separator is used by the TIME command but not by the DATE. On the contrary, the hyphen (-) separator is used by the DATE command but not by the TIME. The point (.) or the forward slash (/) separators are used by both. It is therefore recommended to use colon (:) for TIME and hyphen (-) for DATE.

Other nationally used characters may be supported as well, besides points, hyphens or forward slashes. Specifying hour:minute:second.hundredth
Valid if inside the allowed range. The separator between second and hundredth of second IS A DOT (.) or better speaking A DECIMAL POINT, but not a colon (:)

Specifying more than four time parts:
Error. If TIME have been called without the /T switch, then it will prompt for another time.

If any of the above values be specified outside the allowed range, then it is an error. If TIME have been called without the /T switch, then it will prompt for another time.

The modifiers AM (Ante Meridian), or PM (Post Meridian), may optionally follow the last time part specified, without blank space or separated by one or by more blank spaces.

If present, the AM or PM modifiers alter the given time. From the twelve hour format to the twenty-four hour format, the time is altered as follows:

AM:
If the value "hour AM" be equal to 12, then 12 AM becomes 00 hours (midnight). The AM modifier is removed.

AM:
If the value "hour AM" be lesser than 12, then it is not modified. For example 6 AM is 06 hours. The AM modifier is removed.

PM:
If the value "hour PM" be equal to 12, then 12 PM becomes 12 hours (midday). The PM modifier is removed.

PM:
If the value "hour PM" be lesser than 12, then it is incremented by 12 units. For example 6 PM is 18 hours. The PM modifier is removed.

IMPORTANT:

The use of the twelve hour time format gives place to VERY SERIOUS confusion. The expression "12 AM" means 00 hours or midnight, the expression "12 PM" means 12 hours or middday, but certain people will misunderstand the correct meaning and assume the opposite.

Even worse, there are IDIOTS who say a time without specifying "AM" or "PM", neither "night", "morning", "afternoon", "evening", nor similar expressions, provoking in other persons the fastidious situation of arriving twelve hours too early or twelve hours too late.

At the individual level, the solution against those BASTARDS is insulting them heavily, directly to their STUPID faces. At the level of efficiency that is expected from the intelligence of a person who uses Free-DOS, the solution is TO AVOID THE DAMNED TWELVE HOUR FORMAT ALTOGETHER.

The time MUST be expressed in twenty-four hour format, in what is known as "European Time" or as "Military Time", without the minimal concession to IMBECILES.

In this radical position there is nothing against a Tradition of expressing Time, because the twenty-four hour format has been used for military purposes for many years, and in Europe for all purposes and for many years as well. It has therefore become part of Tradition.

Venerable Traditions must be respected, but foolish habits, kept just out of ignorance or of inertia, must not be respected and must be condemned. For persons who may still feel uneasy at the prospect of contravening an Old Tradition, they can as a last resort use the twelve hour format, but ALWAYS FOLLOWED BY THE "AM" OR "PM" MODIFIER. To use the twelve hour format without specific "AM" or "PM" modifiers IS STUPID AND WRONG, because it creates ambiguity. With modifiers there is no ambiguity in theory, although as it has been said, some people will confuse the meanings of "12 AM" or of "12 PM".

Options. All options must precede any argument.

/T does not prompt the user for a new time.

TIME /T
TIME /T time

In the first variant the time is only shown.

In the second variant the time is tried to be changed, but the loop is not entered in case of failure, it just returns the prompt of the command line.

First Example

TIME /T

Only shows the current system time.

Second Example

TIME 18:2

Sets the current system time to 18:02 in the twenty-four hour format, or to 6:02 PM in the twelve hour format. For setting it to 18:20 (or to 6:20 PM), the zero at the right must be specified:

TIME 18:20

TRUENAME

Shows the registered name of a data set (original or modified name).

Requirements: CMD_TRUENAME

Synopsis truename [[vol:][path]name]

truename [[vol:][path]name] shows the full path name of a data set or of a directory.

truename without volume, path and name, then it shows the full path name of the current directory.

TRUENAME path

Options

Unless stated otherwise, all options of this command follow the standard rules for options, explained in the Appendix

TYPE

Scrolls content of data set on screen or printer (MORE can be used to pause).

See also: DIR , ECHO

Related external commands:

MORE.EXE executables (MORE1.EXE, MORE2.EXE) MORE

MORESYS.SYS device driver MORESYS

Requirements: CMD_TYPE

Synopsis type [vol:][path]name

type [vol:][path]name shows the internal content of a text document.

TYPE { pattern }

Options

Unless stated otherwise, all options of this command follow the standard rules for options, explained in the Appendix

VER

Shows version information of Free-COM and of Free-DOS.

Requirements: CMD_VER

Synopsis ver [options]

ver by default it shows only the version of Free-COM.

ver [options] with each option it shows the following:

/W the warranty of Free-COM.

/D the distribution information of Free-COM.

/C the acknowledgement and list of contributors of Free-COM.

/R the version numbers of the kernel and of DOS.

VER [{ option }]

Options

Unless stated otherwise, all options of this command follow the standard rules for options, explained in the Appendix

VERIFY

Shows or sets level of verification to make exact copy of a data set.

Requirements: CMD_VERIFY

Synopsis verify [ON | OFF]

verify without argument it only shows the status, either ON or OFF.

ON | OFF turns the verification of a copy on or off. With ON, Free-DOS will use a time to make sure that copies be correctly written to the volume.

VERIFY [ ON | OFF ]

Options

Unless stated otherwise, all options of this command follow the standard rules for options, explained in the Appendix

VOL

Shows label of a volume (LABEL.EXE can be used to change the label).

See also: DIR

Synopsis vol [vol:]

vol shows the label of the current volume.

vol vol: shows the label of the specified volume.

VOL [ vol: [label] ]

Options

Unless stated otherwise, all options of this command follow the standard rules for options, explained in the Appendix

WHICH

Searches for and shows the executable of a specified programme.

Requirements: CMD_WHICH

Synopsis which [vol:][path]name

which [vol:][path]name shows the full path name of a data set or of a directory located in the PATH environment variable or in the specified path.

WHICH [{ executable }]

Searches for the specified executable (or executables) in the same way as if the executable itself would have been specified from the command line. If an executable be found, then its path is displayed in this format:

executable «tab» path

The "tab" stands for the ASCII 9 tabulator character. If the executable be not found, then only the executable name will be shown, but the tabulator and the path will not be shown.

The WHICH internal command will look for external executables. It will not find internal commands, installable commands, or aliases. Several of those may have identical names, but the only one found by WHICH will be the executable.

First Example

WHICH which

It returns the external executable WHICH.EXE if it be found, otherwise it returns nothing, because WHICH is also an internal command, and the WHICH command is unable to find other internal commands.

Second Example

WHICH command

It could display for instance:

command C:\COMMAND.COM

The first word "command" is the string of characters "command", it is not a place holder.

Appendix

FIFO and LIFO

Directories, or stored data sets, or commands, functions, data of a programming language, or other entities, can be grouped in an ordered sequence for the purpose of invoking them at a later time, in that exact sequence (direct sequence), or in an inverse of it (inverse sequence).

There are thus two kinds of grouping. The first kind of grouping is usually known as direct sequence, or as queue, or as FIFO, meaning "First In, First Out". The second kind of grouping is usually known as inverse sequence, or as stack, or as LIFO, meaning "Last In, First Out".

Those names are very illustrative of the way in which each kind of grouping works. If a number of persons form in column of one at the entrance of a cricket game (or for another purpose), then a queue of persons has been formed. When the turn of each person come for buying the ticket, without disrupting the column formation, then the natural way is to attend the person located first in the queue. Therefore, the FIRST person that had entered IN the queue, will be the FIRST person singled OUT of the queue and attended afterwards. First In, First Out. Hence the names "direct sequence", "queue", or "FIFO".

Contrary to that, there is the opposite kind of grouping. If sheets of paper be put one by one in horizontal position, each sheet resting on the previous sheet, then a stack of paper sheets has been formed. When one sheet of the stack need to be taken, without turning or lifting the stack, then the natural way is to take the sheet located at the top of the stack. Therefore, the LAST sheet that had been put IN the stack (or on the stack), will be the FIRST sheet taken OUT afterwards. Last In, First Out. Hence the names "inverse sequence", "stack", or "LIFO".

The POPD or PUSHD commands work with directories ordered in a LIFO stack, in an inverse sequence. PUSHD pushes a directory onto the stack, POPD pops first the last directory that had been pushed onto that stack (it may be the current directory, but not necessarily). However, the DIRS command lists in a direct sequence the directories that exist in the stack, with the first pushed directory appearing at the top, and the last pushed directory appearing at the bottom.

When working with a simple directory tree, then DIRS, POPD or PUSHD may not be necessary to use. But when working with a complex directory tree, then those commands become very convenient to use, if not strictly necessary.

Current Directory

The current directory is the default directory of a volume.

DOS stores a default directory for each volume. When a path be specified only with a volume specification, such as D:, then it is completed with this default directory of that volume to construct the absolute path to be used.

Current Working Directory

In opposition to the current directory, the current working directory is the absolute path constructed out of the currently active volume and the current directory of that volume.

Path Specification

In DOS an absolute path is constructed out of several components:

Volume

Directory, or levels of subdirectories down in the directory tree

The name of a data set or directory

The type of a data set or directory, if any

As in the example:

D:\DIR1\DIR2\NAME.TYP

The volume is a single letter from A to Z followed by a colon (:)

The remaining part of a path consists of similar components delimited by a single backslash (\). The last component is also called "name". Each of those components may be formed of a name up to eight characters long, and of a type up to three characters long. Name and type are delimited by a single dot (.) that separates them. Although the type may be absent, the name must have at least one character. Without a type, then the separating dot is not necessary.

The terms "name" and "type" are not limited to data sets in the usual sense, they may refer to any name visible in a directory, such as subdirectories or volume labels as well.

To ease the way of entering a path the user may specify a relative path, rather than an absolute one. In a relative path one or more components may be missing:

-If no volume be specified, which means that no colon (:) is entered, then the path is prefixed by the currently active volume.

-If a directory be not prefixed by back slash, or if no directory be specified at all, then the current directory of the volume is inserted immediately after the colon.

-Some executables may append an absent type to the very last name component.

Examples, assuming the current directories of Volume Current Directory:

C:\FREEDOS\HELP
D:\TEMP\TEXT

The currently active volume is C:

C:\
The top level (root) directory of the C: volume

.
(one dot) The current working directory, C:\FREEDOS\HELP

..
(two dots) The parent directory, C:\FREEDOS

D:
The current directory of the D: volume, D:\TEMP

D:.
(followed by one dot) The current directory of the D: volume, D:\TEMP

D:..
(followed by two dots) One directory above the current directory,
C:\FREEDOS\HELP\

It means that the final absolute path is:

C:\FREEDOS\BIN

Path specifications that do not conform to the above mentioned format lead to different behaviours with different executables, because there is no standard to scan, parse and interprete such patterns. Problems include:

Many back slashes

Many dots

CHKDSK, DOSFSCK, RECOVER or SCANDISK, inducing them to find errors within the directory structure and to restore the directory structure to a valid tree. Therefore the assumption that a directory of three dots (...) might mean "parent-of-parent" is incorrect, although it might be supported by some executables. The 4DOS command interpreter supports it, Free-COM does not.

Standard Rules for Options

Options (also called switches or flags) are usually prefixed in DOS by one forward slash (/), although executables originally made for Unics may prefix them by one hyphen (-) or two hyphens (--), but whatever those characters, always the following character identifies the option and it is called "option character", for instance:
/A

Some executables accept longer option names, in which several characters or a complete word, rather than a single character, identifies the option, such as:
/MSG
/SURFACE

Some options may be used in conjunction with an argument (also called value or parametre), composed of ciphers, letters or other symbols. The argument is appended to the option with one colon (:) or with one equal sign (=), as in:
/A:hr
/P=fdautoex.bat

Several options without argument may be merged together as a single option with ot without embedded slashes. For example, the following options may be all valid and perfectly equivalent:

/WS
/W/S
/W /S

However, because some commands accept longer option names, the third command above (/W /S) with embedded slashes and with separating space, is more secure and recommendable, although some experimenting can be done after having made a safety copy of all important data.

An option with argument may be the last one of such merged options.

Options without arguments enable or disable certain features. Therefore those options are sometimes called "Boolean options". Boolean options may be optionally prefixed by a plus (+) or minus (-) sign. So, the Boolean option "O" can be written in any of three ways:

/+O
The option is enabled.

/-O
The option is disabled.

/O
(neither plus nor minus sign) The option is toggled or flipped, which means that if the option be currently enabled, then it will be disabled, or if currently disabled, then it will be enabled.

Without user intervention a Boolean option is in most cases disabled by default, therefore these two commands are probably equivalent:

/+O
/O

However, some internal commands or some external executables allow the user to change the default settings of certain options, as it is the case of:

COPY
DIR

Input Output Redirection

In DOS the standard input or output can be redirected from or to a data set or a device. It is correct and it is the general praxis to use such Input Output streams, but some programmers cowardly ignore them for reasons of speed or of programme size.

Instead of polling the keyboard and request the user to enter characters interactively by the keyboard, the input stream may be redirected from a data set or from a device. In such case those characters are read from the data set or device. Usually the executable terminates when the data set or device have been read completely.

For example, be it assumed that there are different executables to invoke and that all of them accept the switches and values /D:1024 /S:512 /V /Y

Rather than typing all that string every time for every executable, or rather than creating aliases for the name of each executable followed by the string, a solution is to redirect input from a text document.

A document is thus created, for instance DSVY.TXT, containing only the line:

/D:1024 /S:512 /V /Y

After that, every invoked executable for which the above line be desired, is told to get its input from such a document, by the command:

FROBU < DSVY.TXT

In that example, FROBU, the Yoyodine Frobulator of GNU fame, will get the line "/D:1024 /S:512 /V /Y" at every invocation done with the "< DSVY.TXT" redirection, and will do whatever be supposed to do as if it had got the line typed at the command line, or from an alias, or from a batch process.

If not wishing to give that line to FROBU for a particular invocation, then it is simply invoked without redirection. Of course, a collection of small text documents with single lines may be ready for appropriate invocations.

If the output stream be redirected to a data set or to a device, instead of issuing the information onto screen, then the stream is dumped into the data set or device. Per convention each executable has two output streams: one is called standard output and issues normal information, the other is called standard error output and it is intended for error messages that the user should not miss.

Redirections are specified at the command line and affect exactly the command invoked therein, regardless of the command being an external or internal one, being an alias or being a batch process. The exception is the FOR command, which requires the redirection to be applied to the command specified behind the DO keyword, rather than to be applied to the FOR command itself.

If more than one redirection be specified at the the command line and if those redirections affect the same stream (one of input, output, or error), then the rightmost redirection supersedes any previous one.

Redirections are syntactically specified like this:

operator target
operator ::= '<' | '>' [ '>' ] [ '&' [ '>' ] ]
target ::= data set | device

Although it is not relevant where the redirections be put at the command line, it is common praxis to put them at the end.

The operators have the following redirections:

Operator <
Redirection: from Input

Operator >
Redirection: to Output, replacing. The target is overwritten

Operator > >
Redirection: to Output, appending. Added at end of target, if it already exist

Operator > & >
Redirection: to Error, replacing. The target is overwritten

Operator > > & >
Redirection: to Error, appending. Added at end of target, if it already exist

Operator > &
Redirection: to Output and Error, replacing. The target is overwritten

Operator > > &
Redirection: to Output and Error, appending. Added at end of target, if it already exist

First Example

cmd < in1 < in2

Input stream is redirected from data set IN2, because it is the rightmost one.

Second Example

cmd < in > & out

Input stream is redirected from data set IN, output and error streams are joined together and redireced to data set OUT. If the data set OUT already exist, then its old content is discarded and replaced by the new one. If the data set OUT do not exist, then it is created.

Third Example

cmd < in > > & out

As in the second example, but instead of replacing the old content of OUT, the new content is appended at the end of OUT, if OUT already exists. If it do not exist, then it is created.

Fourth Example

FOR %a IN (*.*) DO ECHO %a > out

As mentioned earlier, the command FOR is an exception. It passes forth the redirections to each invocation of the command specified at the right of the DO keyword. The above example overwrites the OUT document each time that the ECHO command be performed. Thus, instead of creating a list, only the last data set found is named in OUT.

Fifth Example

IF EXIST out ERASE out
FOR %a IN (*.*) DO ECHO %a > > out

That sequence eliminates the previous problem. First the IF command erases the OUT document if it already exist. If it do not, then there is no error message. Second the line starting with FOR appends every output of ECHO to the OUT document, creating a list, as originally intended. The difference in the FOR line is the presence of two (> >) symbols instead of only one.

Input Output Redirection by the Pipe (|) Symbol

Another form of redirection is known as piping. Hereby, the output stream of one command is connected to the input stream of another command. Pipes can combine any number of commands in this way. Some programmes like DOSAMATIC or HOMEBASE (included in the Bensley distribution hyper linked above) can be used for 'swapping' tasks within DOS, but due to the fact that DOS is not really a task-swapping operating system, pipes are simulated by spawning the first command with an output redirection, capturing the redirected information into a temporary data set (at the defined TMP or TEMP directory), and then issuing the second command with an input redirection from that temporary data set. After completing the second command, then the temporary data set is erased.

First Example

cmd1 | cmd2 | cmd3

Which is similar to this sequence:

cmd1 > %TEMP%\t1
cmd2 < %TEMP%\t1 > %TEMP%\t2
ERASE %TEMP%\t1
cmd3 < %TEMP%\t2
ERASE %TEMP%\t2

Second Example

The first command can have an input redirection, and the last command can have an output redirection, such as this:

cmd1 | cmd2 | cmd3 < in > out

Which is similar to this sequence:

cmd1 > %TEMP%\t1 < in
cmd2 < %TEMP%\t1 > %TEMP%\t2
ERASE %TEMP%\t1
cmd3 < %TEMP%\t2 > out
ERASE %TEMP%\t2

Third Example

The error stream can be piped as well:

cmd1 |& cmd2 | cmd3

Which is similar to this sequence:

cmd1 > &%TEMP%\t1
cmd2 < %TEMP%\t1 > %TEMP%\t2
ERASE %TEMP%\t1
cmd3 < %TEMP%\t2
ERASE %TEMP%\t2

There only the error messages of cmd1 are passed to cmd2, the error messages of cmd2 and cmd3 are issued to the screen.

Nested redirections

Batch processes may be nested. When external executables invoke other executables or another command interpreter, redirections may also be nested. As example, consider the BATCH.BAT batch process:

@ECHO OFF
ECHO 1
ECHO 2 > out_2
ECHO 3

Which is invoked via:

BATCH > out_1

When BATCH.BAT be executed, then the output stream will be redirected to the OUT_1 data set. Therefore the output of the first ECHO command will be redirected to OUT_1 as well. Because the second ECHO command has its own output redirection, then its output will be redirected to the OUT_2 data set. At the completion of ECHO, then the redirection will be closed and the former one will be restored. It causes for the output of the third ECHO command to be redirected to OUT_1 again.

Hidden Internal Commands

There are some special internal commands, which are neither directly visible nor accessible. They are hidden because of two main purposes:

First, because many of them are of internal nature and should not be experimented by the common user. Serious problems might happen if using them incorrectly. They are available having in mind the advanced human operator.

Second, because they are extensions to the normal batch language, and may therefore provoke conflict with a particular installation. Those commands are hidden by default in order to prevent such conflict, but they can be made directly accessible via the ICMD command.

Hidden internal commands can be accessed by prefixing the command with two colons followed by an equal sign:
::=

That token usually specifies a label within the batch language. Given the nature of labels, they may be comments as well. Due to the fact that a line started by a colon (:) is often used as a label in a batch process, most command interpreters will not see the second colon and equal sign (:=) that comes afterwards, therefore most command interpreters will simply ignore the line started by the colon, which is why the token has been chosen.

Free-COM will recognise the token and will execute the hidden internal command that follows it. Maybe with nefarious consequences. For example:

::=CANCEL 30

Not so nefarious, hopefully. It just terminates all currently active batch processes, and assigns the value "30" to the current error level.

Long Names (VFAT emulation)

There are in the Internet two sets of executables to handle Long Names in DOS systems. One set consists of five executables programmed by Mister Fubi Dan, the other consists of eight executables programmed by Mister Ortwin Glueck. They are not drivers, and cannot modify text editors or other executables. Their work is to create, rename, list, check, copy, move, erase or perform other operations on data sets with Long Names.

The executables of Mister Fubi Dan are undoubtedly better, faster, AND MORE RELIABLE, although they also occupy more storage space and take more resources from the computer. By contrast, the executables of Mister Ortwin Glueck MUST BE USED WITH CARE. Data sets must have a back-up before using Mister Glueck's executables, because big ones may be truncated during processing, therefore losing data. They will also take a long time to be processed. Mister Glueck is aware of the problem, in his documentation he disclaims any warranty and recommends to perform regular back-ups.

Alternatively to those executables, Free-DOS can be used with the DOSLFN.COM driver of Herr Henrik Haftmann, which enables long names, but most old DOS executables cannot handle long names even with the driver loaded. EDIT.EXE of Free-DOS cannot handle long names. The EDIT.COM text editor of MS-DOS can handle long names if having previously loaded the DOSLFN.COM driver from command line or batch process into low conventional memory, which makes it possible the creation, renaming or modification of ASCII documents with long names directly from the text editor, though it can also be done from the DOS command line as explained below. DOSLFN.COM cannot be loaded into the High Memory Area, but it can be disabled by the -D switch while being kept in memory, or else unloaded by the -U switch if needing memory for other purposes.

DOSLFN.COM should be loaded only if necessary, because it silently converts names to lower case, which may be undesirable. For example, HELP.HTM and help.htm are two different hyper text documents. The -S switch of DOSLFN.COM shows the status, the -T+ switch gives tunnel effect, and the -? switch shows a short help. For accessing Compact Disc the -C+ switch must be used, but DOSLFN.COM is incompatible with the MSCDEX.EXE of MS-DOS and must eventually be loaded after SHSUCDX.COM, if using that executable. DOSLFN.COM enables Long Names in the EDIT.COM text editor of MS-DOS as well as in the following commands of the Free-COM COMMAND.COM of Free-DOS: COPY, DIR, RENAME and TYPE.

COPY CON:

It is possible to create a text document directly from the console by using the COPY CON: command, without using any text editor. Let us create a document called EXAMPLE.TXT and write a few words in it:

COPY CON: EXAMPLE.TXT
Press ENTER, then write something, such as:
This is an example.
Press and hold the CONTROL key, then the Z key (for giving an "End Of File" character), then release both keys.
Press ENTER again.

To see that our document exists, we can use the DIR command:
DIR EXAMPLE.TXT

To read the document, we can open it with a text editor or viewer, or show its contents with the TYPE command:
TYPE EXAMPLE.TXT

Version history of Free-COM

Besides Free-COM COMMAND.COM, which is installed by default, Free-DOS includes three other command interpreters:
Free-COM COMM8086.COM
DOG.COM
4DOS.COM

Thus the widest possible choice is offered to those persons who have relied on Free-DOS as their system of preference. Free-COM COMM8086.COM is intended for Intel 8086 or compatible processor. Free-COM COMMAND.COM is intended for Intel x86 or later compatible processors. DOG.COM is a comparatively simple command interpreter, while 4DOS.COM is much more complex.

Free-COM COMMAND.COM is somewhere between the last two, regarding functionality. Free-COM endeavours to continue improvement without losing backward compatibility, and provides at least all the functionality that is commonly found in most command interpreters, but it must be comprehended that increasing the features of a command interpreter often comes at the cost of optimisation or of performance.

The list below shows the features or functions that appeared in each version of Free-COM.

In Free-COM version 0.82 was done:

  ALIAS (gives new names to commands or to whole lines)
  HISTORY (manages command line history)
  DIRS, PUSHD, POPD (manages directory stack)
  Installable Commands interface, specification MUX-AE
  Enhanced command line editing, completion of names
  CD, CDD, PUSHD (remembers most recent directory)
  Control Break handler
  Critical Error handler

In Free-COM version 0.83 was done:

  Error level command IF ERRORLEVEL H<letter>

In Free-COM version 0.84 was done:

  Internal commands

In Free-COM version 0.85 was done:

  Switches: IF /I

In Free-COM version 0.90 was done:

  Swapping, without secondary programmes such as KSSF.COM or VSPAWN.COM
  Backdoor to INT 2E hardware interrupt
  Support for DOS=HIGH in FDCONFIG.SYS or equivalent start configuration
  Redirection in conjunction with Swapping

In Free-COM version 0.91 was done:

  Code sharing of different modules

In Free-COM version 0.93 was done:

  Wild cards for the RENAME command
  Same pattern matching code of names for RENAME, COPY and DIR commands
  Switches: DIR /O (ordered output) DIR /A (attributes)

In Free-COM version 0.94 was done:

  Full National Language Support

In Free-COM version 0.95 was done:

  Input Output functions to replace by
    (stdio.h is based on NAME* while io.h is based on handle)

In Free-COM version 0.97 was done:

  Strict recognition of errors, based on _doserrno

Regarding the two tasks listed above (replace I-O and recognition of errors), the replacement for Input or Output operations shall precede the correction for reporting errors, because it is simply impossible to detect certain failures without heavy work rounds with the <stdio.h> functions.

In Free-COM version 1.0 has been done:

  Optimize Free-COM for size

It is being done for Free-COM after version 1.0:

  Other swap storage areas, for instance XMS or EMS
  Long names by the /DIR LFN switch

An explanation about handling Long Names in DOS systems has been given further above in this Appendix.

Download Free-COM

Free-COM can be downloaded from Source Forge in several ways and packages:
Source code files from the CVS repository.
Tarball and pre-compiled packages via HTTP.
Tarball and one pre-compiled package as Free-COM release.

Resources accessible via HTTP

The HTTP location contains variants of tarballs and of pre-compiled packages of Free-COM. The data sets found at the top level directory are the most current major releases of Free-COM, whereas the sub-directories contain Beta releases of a major release. The major release will come some time after the correspondig Beta releases that precede it. WARNING: the Beta releases are mainly intended for testing and finding possible problems. They are not stable and should not be used in a sensitive context without previous back-up of all important data. Free-DOS assumes no responsibility for any loss or damage provoked by Free-COM. The HTTP location is:

The packages themselves are named and include the following content:

COM___.ZIP (or Com___Beta__.ZIP)
Tarball (the tree of the source programme, but without the CVS information).

XMSSWAP.ZIP
The most commonly used pre-compiled release of Free-COM, complete with almost every feature except for the debugging feature. It uses only XMS swapping mechanism.

BINARY.ZIP
The most commonly used pre-compiled release of Free-COM, complete with almost every feature except for the debugging feature. It uses standard swapping mechanism.

PLAINEDT.ZIP
As BINARY.ZIP, but using the plain command line text editor of the kernel, instead of using the enhanced text editor.

DEBUG.ZIP
As BINARY.ZIP, but with debugging support. DEBUG.ZIP is much bigger than the standard release, and can generate an enormous output.

LOCALIZE.ZIP
As BINARY.ZIP, but intended for maintainers of .LNG, Language Description File.

SUPPL.ZIP
The SUPPL library, which is required for linking pre-compiled Free-COM, for use with Borland Turbo C++ version 1.01

DOCS.ZIP
A package with the original HTML documents.

Releases at Source Forge

The release section of Free-COM contains a source programme and an executable programme, both compressed in ZIP format. They are respectively equal to the tarball and to the BINARY.ZIP available at the anonymous FTP location. The main difference between the two locations is that old versions are kept at the HTTP location, but no Beta versions or side branches. The FTP location does not keep versions considered old, this is, thought to have been long ago superseded by new versions.

CVS Resources

There is at Source Forge a short description for accessing the CVS repository there located. Following those instructions, the main trunk of the specified module of the repository can be downloaded. For example, to download the MAIN trunk of Free-COM, also called HEAD:

cvs -z6 co freecom

Alternatively there is a hyper link called 'Browse CVS'. The Web CVS might be helpful for downloading a few data sets.

The CVS repository allows to branch the development of a module at some point, from the main trunk into side trees. At such trees the module can be further developed into branches, for example by adding new features or by other modifications, without disturbing the main trunk of the module (the primary release).

The branches may even become twigs, with only minor variations, but it is only when eventually one of those side developments prove its worth, that the changes are merged into the main trunk, and in that way what had been only a side development, perhaps a minor one, becomes part of the main development, of the primary release.

Branches are marked by tags that automatically evolve with the data set, unlike tags of the main trunk, which do not automatically evolve. By 'automatically' is is meant that when a data set from a specific branch be updated, then the branch tag automatically moves from the current version of the data set to the new version.

To try a branch, a new directory named for example 'freecom', can be made, then changing to it and execute the command:

cvs -z6 co -r tag freecom

Where 'tag' is the name of the branch that you want to download. It is not advisable to use the same directory to manage files for two or more different branches.

The Free-COM module has two active branches, plus a third branch generally considered obsolete (but maybe useful for some purpose, besides its historical importance). The three branches are:

expExec
Active branch. Stack-based execution context implementation.

expSpawn
Active branch. Module based Free-COM, based on expRes branch.

expRes
Inactive branch. Resource management implementation. In 2001 it merged into the main trunk.

Bugzilla bug hunter

Free-COM uses a method called "Bugzilla", available at Free-DOS for the purpose of helping to find, reporting and sharing information on possible errors present in any programmes contained within or distributed together with the Free-DOS operating system.

Persons using Free-DOS are requested to inform of any problems that they may find in any component of the system. That information may be sent by any means, Bugzilla is not strictly necessary. However, any reports regarding problems must be CLEAR, COMPLETE, and as much as possible HITHERTO UNKNOWN. 'Clear' is an objective description of the problem, avoiding any obscure or unrelated explanations. 'Complete' is a report including the HARDWARE and the SOFTWARE that has been used and that has triggered the problem:

Computer brand, model, peripherals installed, RAM available by default and free RAM after loading modules into memory. A copy of various outputs from MEM.EXE or similar programme may be helpful.

Configuration of components. A copy of FDCONFIG.SYS or equivalent start configuration, of FDAUTOEX.BAT or equivalent start batch process, or of other relevant configuration or batch processes, may also be VERY helpful, because it often happens that a software may present incompatibility with others.

The name AND VERSION of the programme suspicious of having provoked the problem, plus an indication of which optional switches have been used when calling the suspicious programme from the command line or from a batch process, or if the invocation had been done from inside the shell of another programme, or a driver loaded by DEVLOAD or similar programme.

Finally, 'hitherto unknown' means that the problem be presumably not part of a list of known problems that may affect that software. A possible way for checking that information is the Hyper Text document of Free-DOS in the World Wide Web, another is to subscribe to the appropriate list sent regularly by electronic post, and there are others. However, the task of finding a 'jurisprudence' of previous reports sent by other persons need not be an exhaustive work, because in fact it would not be wrong to send new information on a problem that may already be known, but only in part. Stick mainly to clearness and to completeness, as explained above.

Bugzilla is simply a standard way of facilitating the sending of that information in a uniform presentation, therefore making easy for other persons to reproduce the problem from other computers and thus being able to correct it. Bugzilla also tries to avoid unnecessary repetition of reports on problems that have been alredy found before. Finally, Bugzilla may suggest temporary solutions until finding a definitive one, which often involves reprogramming into a new version of that software, and its release to the public.

Bugzilla for Free-COM is available at the Following Uniform Resource Locator:

Free-DOS operating system
Bugzilla bug hunter, for sharing bug reports
http://www.freedos.org/bugs/bugzilla/

 

Kernel-supported Swapping in Free-COM COMMAND.COM

Written by Ska in 2001

Kernel-supported swapping in the binary-only package of Free-COM COMMAND.COM, default command interpreter of Free-DOS. This information refers to Free-COM COMMAND.COM, not necessarily to Free-COM COMM8086.COM, although there may be some applicability of it to that other command interpreter created for the Free-DOS project.

The sort of swapping explained here is the standard one. It is incompatible with XMS-only swapping. Read also the documentation for KSSF.COM (possibly as K-SWAP.TXT), and for VSPAWN.COM (as VSPAWN.TXT).

This technique is an experimental implementation of a general purpose swapping technique applicable to COMMAND.COM, which does not require any special support of the kernel.

It will therefore not support swapping under all circumstances. It is intended to work as a "boot-through" shell for memory hungry programmes, which normally do not require the function of a resident shell.

Supported Swappings

The swapping is activated via the CALL command in this way:
    CALL /s prg < input

Batch processes

Called batch processes accessing any shell functions or patching the master environment.

Swapping does not preserve the history of previous commands.

How to use KSSF ?

Immediately preceding COMMAND.COM in the SHELL line of FDCONFIG.SYS or equivalent start configuration. Example:
SHELL=C:\KSSF.COM C:\COMMAND.COM /E:2048

With Free-COM as primary command interpreter (unable to exit by the EXIT command), or for specifying the name of FDAUTOEX.BAT or another start batch process, or for using the /MSG switch in order to load error messages from COMMAND.COM into Random Access Memory.

KSSF.COM can be nested, for making a very close association between KSSF.COM and COMMAND.COM, and turning necessary to spawn COMMAND.COM via KSSF whenever wishing to use the Swapping Support from within the spawned shell.

The absolute path to the shell must always be used. Once that KSSF.COM have been loaded, the path to the shell cannot be changed.

Implementation

The code of the kernel spawning process 0 (primary shell) has been extended as loop. When process 0 finish, the kernel checks a special internal variable. If the variable one point to a valid argument structure, the programme mentioned here will be executed as process 0 and COMMAND.COM will be reinvoked. The only information passed from COMMAND.COM to the new process is the command line and the environment, no file descriptors are preserved. See below about Critical Error handler and Ctrl + Break handler.

The argument structure contains the following information:

#pragma -a-                /* members of structure, byte aligned */
typedef struct {
        uint16 envSegm;    /* segment to be passed as environment */
        char far *prg;     /* the programme called to be executed */
        char far *cmdline; /* command line arguments of programme */
        char far *shell;   /* shell to be executed, absolute path */
                           /* other internal Free-COM information */
}

envSegm is to be passed as environment segment to the programme and to the re-invoked shell.

The code to spawn process 0 passes NULL for fcb1 and for fcb2 pointers, there is no support for those programmes.

The command line is empty for the reinvoked shell.

If prg be equal to NULL, then no external programme will be invoked.

If shell be equal to NULL, then the shell will not be invoked, which means shutting down the computer.

The argument structure is made known to the system via an interrupt call. These are the specifications:

DOS-4B-FD: Set Segment of Argument Structure
AH = 0x4B
AL = 0xFD
BX = segment
DX = 0x4446 == 'FD' (magic number)
Return:
Carry == 1 on error (see below)
Carry == 0 on success
BX := _previous_ segment

DOS-4B-FE: Get Segment of Argument Structure
AH = 0x4B
AL = 0xFE
DX = 0x4446 == 'FD' (magic number)
Return:
Carry == 1 on error (see below)
if AX == 5 (Access Denied) --> BX := current segment
Carry == 0 on success
BX := current segment

If DEBUG had been enabled during compilation of KSSF && Carry == 0
AX := PID of KSSF

Only one process may use these functions, any other process gets error 1 (invalid function). Therefore the primary shell MUST invoke DOS-4B-F? to lock this function for other processes.

Secondary shells may use DOS-4B-FE/Carry/AX==5 to detect a context of the primary shell and reuse its critical error handler.

If segment == 0, then no segment has been assigned so far. The kernel interpretes this situation as prg == NULL && shell == NULL

COMMAND.COM performs a swap-out request as follows:

First, parse a:
CALL /S prg argument

As if it were a:
CALL prg arguments

But enable the flag swapOnExec

Second, eventually the interpreter reaches the "exec()" function, which executes an external command. At this point all of the remaining command line has been broken into the external programme name and its command line. If at this point the flag "swapOnExec" be true, then the argument structure is prepared and Free-COM terminates with a DOS-4C API command.

Third, whenever COMMAND.COM must read "the next input line", from whichever medium be currently active, then the flag is deactivated. Thus this switch is completely ignored, unless the CALL/S command be immediately followed by an external programme.

The shell provides two core functions, the Critical Error handler and the Ctrl + Break handler, which are not always included within every programme, therefore both must be installed as resident, even if the primary copy of COMMAND.COM unload on a swap request. That is why both handlers are installed when COMMAND.COM load the first time, and the previous handlers of COMMAND.COM settings are tweaked in such way that when COMMAND.COM terminate for swapping, then the addresses of the installed handlers are copied back to the system, and thus reused further, for the external programme and for the reinvoked shell.

COMMAND.COM knows two variants of the Critical Error handler:

Type 1: it displays the menu Abort / Retry / Ignore / Fail

Type 2: it is installed when the primary copy had been invoked with the
/F switch == AutoFail

In this case the handler will automatically return "Fail" for every Critical Error. This variant is much smaller, about 5 bytes rather than about 390 bytes, but it may cause unexpected and unretraceable behaviour.

COMMAND.COM installs a Ctrl + Break handler, which will always "Abort" the programme. This is required in order to make the handler independent from the context in which it is triggered, whether from within COMMAND.COM or from within a spawned programme. In most circumstances when the external programme had spawned by a swapped-out, COMMAND.COM will get the same PID as COMMAND.COM itself.

This swapping is derived from KSSF.COM, but instead of allowing the user to decide what shell to execute, this swapping faker uses a fixed data set name.

Usage:

VSPAWN [{ argument }]

VSpawn creates the name of the shell to execute itself, by replacing its own data set type (extension) with the .SWP type. All the arguments are passed to the invoked shell unchanged.

Most useful installation:

Make COMMAND.COM and TOOLS\VPSAWN.COM by executing the BUILD.BAT batch process.

Rename COMMAND.COM to COMMAND.SWP

Move TOOLS\VPSAWN.COM to COMMAND.COM

Execute COMMAND.COM

VSpawn automatically invokes COMMAND.SWP, then COMMAND.SWP determines that it has been invoked using the VSpawn feature and maintains the variable:
%COMSPEC%==*.COM

But uses *.SWP as resource data set.

Because the COMSPEC environment variable contains the *.COM type, which is the VSpawn wrapper, then all subsequent invocations of a secondary shell will use the VSpawn wrapper as well.

If COMMAND.COM detect the VSpawn feature being used, then it will default to swap when executing external commands. This can be suppressed, invoking external commands by:

CALL /N prg

Or by passing the option /SWAP to COMMAND.COM

If auto-swap be not active, then /SWAP enables it.

 

Hyper links and references to Free-COM

Free-COM is the original command interpreter of Free-DOS operating system. Comments, suggestions, reports on programming errors or other informations are welcome. Details can be read via HTTP or FTP, contact can be made writing by electronic post. Uniform Resource Locators and addresses provided below. Programmers, documentation writers, language translators, or other persons wishing to collaborate with Free-DOS, with Free-COM, or in other aspects of the project, are invited to contact the relevant address, or also to look at the resources provided by Source Forge, hyper link below.

Free-DOS
Command line operating system of 16 bits
http://www.freedos.org/

 

Free-COM command interpreter
Programming resources at Source Forge
http://freedos.sourceforge.net/freecom/

 

General Public Licence, Free Documentation Licence

Copyright (c) 1998 James Hall, leader of the Free-DOS Development Team:
jhall AT freedos DOT org

Copyright (c) 1994-2005 Tim Norman, creator of Free-COM for Free-DOS:
fd-freecom AT topica DOT com

Documentation Copyright (c) 2000, 2001 Steffen Kaiser, maintainer of Free-COM:
freecom AT freedos DOT org

Documentation Copyright (c) 2003 Robert Platt, synopses of Free-COM commands:
worldwiderob AT yahoo DOT co DOT uk

Free-DOS Development Team:
freedos AT sunsite DOT unc DOT edu

Free-COM development mailing list:
freedos-freecom AT lists DOT sourceforge DOT net

The string "AT" must be substituted by the character "@" and the string "DOT" by the character "." without surrounding spaces and in single horizontal line. This is to thwart automatic harvesting of links (often for spamming purposes).

 

Robot or human visitors to CSS Dixieland are recorded in raw access log. This is a passive register purely for statistical purposes, no cookies are stored in the client computer.

  Go to top of this page Go to page with index, history, exchange policy, contact CSS Dixieland: Start

Hosted by Neocities:
https://www.neocities.org/