FreeCOM and Releases/1.3/RC1: Difference between pages

(Difference between pages)
(Updated special keys lists with definitions)
 
(Copy/paste from old wiki (no text changes))
 
Line 1: Line 1:
'''FreeCOM''' is the standard FreeDOS command shell that replaces [[COMMAND.COM]] from standard DOS.
The '''FreeDOS 1.3 RC1''' distribution was released 3 February 2019.


The main duty of FreeCOM is to prompt the user to enter commands, which are interpreted, processed directly by FreeCOM or executed as executable files.
== History ==


Those commands processed by FreeCOM directly are called '''Internal Commands'''. Non-internal commands which cannot be processed by FreeCOM directly are called '''External Commands''', because FreeCOM will search for files equally named as typed-in.
FreeDOS 1.3 RC1 was made available in several formats:


Besides to implement certain commands FreeCOM offers other features.  
* FD13FLOP.IMG - Basic FreeDOS installation boot floppy image.
* FD13LITE.IMG - Plain DOS system only! USB stick image.
* FD13FULL.IMG - Plain DOS system and Full install USB stick image.
* FD13LGCY.ISO - Contains all the packages as FD13-FullUSB. However, it is a bootable CD image designed for older hardware.


== Command line usage ==
Two prototypes of LiveCDs are being provided with RC1. However, one will be discarded for FreeDOS 1.3 final, depending on feedback. Both types have some live FreeDOS packages at boot and support temporarily installing/removing more by using FDIMPLES. Also, both will automatically start networking support when used inside VirtualBox or VMWare. Otherwise, you will need to manually start it.


COMMAND.COM [ path [ console ] ] [{ option }] [ '/' ( K | C ) commandline ]
* FD13LIVE.ISO - FreeDOS LiveCD along with support for a Plain and Full installation. Requires 64MB of RAM (more recommended).
* FD13LIVE.ISO - FreeDOS LiveCD along with support for a Plain and Full installation. Requires 128MB of RAM.


If present, the first non-option argument specifies the location in which FreeCOM resides. This location is later stored in the environment variable COMSPEC. Since DOS3+ this option is no longer necessary to find the shell invoked during the boot process, but it may be used to let the system boot a primary shell from one location, but use a shell of the same version from a different location later on.
Further information about the two LiveCDs are detailed in the Release Notes, below.


One shallt not point to a RAMdisk at this time, because FreeCOM needs to reload certain information relatively early during execution, before AUTOEXEC.BAT had been executed, in which, normally, FreeCOM is copied into the RAMdisk.
== Changes ==


For convinience FreeCOM checks, if at the given location a FreeCOM exists and is accessable, if not, the given location is ignored. Also, the standard requires to specify a path only, but FreeCOM accepts an absolute filename, so accepting that FreeCOM is not necessarily named COMMAND.COM.
The FreeDOS 1.3 RC1 distribution is based on the package lists documented in [[Releases/1.3/Packages|FreeDOS 1.3 Packages]].


The second non-option argument, if present, specifies the console FreeCOM shall enable. This setting is system-wide and is not limited to FreeCOM or just this particular process tree. In its result, this argument is identical to the CTTY command.  
The contents of the LiveCD are BASE + FDI requirements + a few useful and simple utilities. Note that we will continue to fine tune packages in the LiveCD if needed for FreeDOS 1.3 RC2.


FreeCOM knows the following options:
== Release notes ==


{| class="wikitable"
The release notes were published in plain text format. Original version is shown below:
|+ FreeCOM command line options
|-
! Option !! Meaning
|-
| /? || Issues a help screen, then exists
|-
| /! || Enable/disable debugging support, if compiled to FreeCOM
|-
| /Y || Enables trace/single step mode, deacticated when the user prompt has been reached
|-
| /D || Disables to parse AUTOEXEC.BAT, even if the /P option is present (usually set by the kernel, when F5 had been pressed during bootup)
|-
| /F || Enables autofail of Critical Errors; then instead of displaying the '''Abort/Retry/Ignore/Fail''' dialog, Critical Errors are automatically answered with Fail
|-
| /P || Installs a primary copy of FreeCOM. The option may have an argument to specify an alternate name for the AUTOEXEC.BAT script, such as '''/P:FDAUTO.BAT'''. This primary shell cannot be terminated with the EXIT command and always executes the AUTOEXEC.BAT script before any other command.
|-
| /E || Sets another size of the environment segment (such as such as '''/E:1024''') in which all the environment variables are stored
|-
| /L || Sets the size of the internal command buffer (This option is ignored currently, the internal buffer always defaults to 512 bytes)
|-
| /U || Sets the size of the internal user input buffer (This option is ignored currently. The input buffer always defaults to 255 bytes, which is the maximum)
|-
| /LOW || Forces to load FreeCOM low (Currently this option has no effect, because no part of FreeCOM is loaded high)
|-
| /MSG || Installs the message server (Because the message server is not used nowadays, this option forces to permanently load FreeCOM's messages into memory)
|-
| /SWAP || Toggles, if to default to swapping or not; due to different default values of this internal flag, it is recommended to always prefix the option with '+' to enable or '-' to disable swapping
|}


The options /K and /C are special cases and do not behave as normal options does. They are exclusive and all characters at the right side of such option (except an optional argument sign) specify a command to execute, e.g.: /C DIR /s, /C=DIR /s, and /CDIR /s do behave exactly the same and execuate the command DIR /s.
### FreeDOS 1.3-RC1 Installation media.
 
If these options are used in conjunction with the /P option, the AUTOEXEC.BAT script is executed prior executing the specified command.
README.TXT
 
    The simple "before you choose and install" document.
In opposite to /K the /C option does not enter the interactive shell prompt after executing the specified command unless the /P options is present, too.
    (All zip archives contain a copy of this README file.)
 
   
Boolean options, which can only be enabled or disabled, may be prefixed by '+' to enable or '-' to disable it.
  verify.txt
 
    Contains MD5, SHA256 and SHA512 hashes for all of the different release
== Environment variables ==
    files.
 
   
Environment variables can be freely assigned using the SET command, e.g. executing:
FD13-Floppy.zip
 
SET var1=tecxsgk;jsdgsdflfsjdflkasjf/lasjflas
    * FD13FLOP.IMG - Basic FreeDOS installation boot floppy image.
 
..assigns this nonsense to the variable var1. Later on, the value of the variable can be used by writing: %var1%, thus, writing the name of the variable enclosed without whitespace by two percent signs. Warning: Environment variables are expanded fully into plain text before the command line is furtherly parsed. If a variable contains an odd number of quotes, the remaining command line must contain the closing quote in order to operate properly. Also see this:
FD13-LiteUSB.zip
 
  SET var=text del
    * FD13LITE.IMG - Plain DOS system only! USB stick image.
  IF text==%var% GOTO label
 
    * FD13LITE.VMDK - An Virtual Machine Disk description file to simplify
The second line looks uninteresting, but once the environment variable has been expanded the line has morphed into:
    attaching the LiteUSB image to a virtual machine (like VirtualBox and
 
    vmWare) as a hard drive.
  IF text==text del GOTO label
 
FD13-FullUSB.zip
..not that funny anymore, because the IF command interpretes only the string text==text as condition, but del GOTO label is executed as command.
 
    * FD13FULL.IMG - Plain DOS system and Full install USB stick image.
FreeCOM uses a number of environment variables for its own purpose:
    (Also, includes may extra packages that are not installed in the
 
    "Plain DOS" or even the "Full Install". These extras can be installed
{| class="wikitable"
    later using FDIMPLES or another package manager)
|+ FreeCOM environment variables
|-
    * FD13FULL.VMDK - An Virtual Machine Disk description file to simplify
! Variable !! Meaning
    attaching the FullUSB image to a virtual machine (like VirtualBox and
|-
    vmWare) as a hard drive.
| COMSPEC || FreeCOM loads some information on demand, these data are stored in the FreeCOM executable. The value of this environment variable contains the filename FreeCOM shall use. The contents can be changed with the SET command.
|-
  FD13-LegacyCD.zip
| DIRCMD || Default values for the DIR command. This variable must be changed using the SET command. Any options specified within DIRCMD are prefixing any entered ones.
   
|-
    * FD13LGCY.ISO - Contains all the packages as FD13-FullUSB. However, it
| COPYCMD || Default options for the COPY command.
    is a bootable CD image designed for older hardware. It uses the classic
|-
    El Torito Boot CD-ROM format. Some modern computers and virtual machines
| PROMPT || FreeCOM prompts the user to enter commands to run, the prompt can be customized by changing the contents of this variable. This variable can be changed using the SET or the PROMPT commands. Latter one includes a detailed description of the format of the prompt string.
    are known to have issues booting CDs that use this ancient specification.
|-
    Unless you have a computer that requires this type of bootable CD, we
| PATH || When FreeCOM is to execute an external command and this one does not contain no path, FreeCOM searched for the command in a number of paths. These ones are enumerated by the PATH environment variable. This variable can be changed using the SET or the PATH commands. Latter one includes a detailed description of the format of the search path.
    recommend using the LiveCD media.
|}
 
Two prototypes of LiveCDs are being provided with RC1. However, one will be
There are a number of automatic variables that do not follow the above mentioned syntax and which contents is automatically generated. Unlike the normal variables these automatic variables are constructed of exactly two characters, the first one is a single percent sign and the second one the variable identifier:
  discarded. Both types have some live FreeDOS packages at boot and support
 
temporarily installing/removing more by using FDIMPLES. Also, both will
{| class="wikitable"
  automatically start networking support when used inside VirtualBox or vmWare.
|+ FreeCOM automatic variables
  Otherwise, you will need to manually start it.
|-
   
! Variable !! Meaning
So, let your voice be heard on which (if any) LiveCD you prefer.
|-
| %? || Expands to the current errorlevel, which is the exit code of the previously executed external command.
FD13-LiveCD1.zip
|-
   
| %0 || In batch scripts only: the name of the script currently executed.
    * FD13LIVE.ISO - FreeDOS LiveCD along with support for a Plain and Full
|-
    installation. Requires 64MB of RAM (more recommended).
| %1 .. %9 || In batch scripts only: the first through nineth argument passed to the currently executed batch script. If less than nine arguments had been passed to the script, they return an empty string. To access the tenth argument please refer to the SHIFT command.
|-
    Pros: Lower RAM requirement and superior management. In fact, using less
| FOR %v in (..) DO .. || A loop over a set of variables, where %v may use any letter, the FOR command creates a new variable, which is valid in the any command following the DO keyword.
    than 64MB it is capable of bring up some portions of FreeDOS on a most
|-
    important first basis. The more RAM you've got -- the bigger your temporary
| %% || Expands to a single percent sign.
    DOS drive will be. Uses less space on the LiveCD leaving more room for
|}
    additional packages in the future. Also, it's also kinda cool to watch boot.
 
== Internal commands ==
    Cons: Complex multi-stage startup process requires a little longer to boot.
 
    Some systems may have issues activating the RAM drive under FreeDOS.
Internal commands will be processed by FreeCOM directly, they are available to the user without presence of any external files, in fact they hide External Commands named equally. The synopsises of the internal commands are described in a style derived from EBNF.
 
FD13-LiveCD2.zip
== User prompt ==
 
    * FD13LIVE.ISO - FreeDOS LiveCD along with support for a Plain and Full
FreeCOM knows two modes: interactive and batch processing.
    installation. Requires 128MB of RAM.
 
In interactive mode FreeCOM prompts the user to enter a command, the line is interpreted, parsed and, finally, either rejected because of an error or executed.
    Pros: Faster boot time. SysLinux & Memdisk handle creation of a RAM drive
 
    and may have wider system support.
In batch processing FreeCOM performs batch scripts, which are more or less a sequence of commands written to a file. Such files may contain any external commands, internal commands and calls to other batch files as well.
 
    Cons: Fixed DOS drive size and a very hard RAM requirement. Don't meet the
=== Command line syntax ===
    requirement and the system will lockup on boot. Got gigabytes of RAM? Oh
 
    well, it will mostly be unused. Pre-installed packages that generate COM
FreeCOM accepts the following command line syntax:
    executable files in the %DOSDIR%\LINKS directory have issues. However,
 
    they do install fine when running the FreeDOS live from the CD.
  [ ':' ] [ '?' ] [ '@' ] [ '*' ] { command [{ argument | redirection }] : '|' }
  redirection ::= ( '<' | '>' | '>>' ) filename
 
The first optional ? must not be mixed up with the command ?!
 
The colon marks the line as label, which causes to let FreeCOM ignore the line completely as no interpretation is tried on this line, neither are any redirections created.
 
The ? forces FreeCOM to enable the trace mode for this line. In trace mode FreeCOM prompts the user wether to execute the resulting command.
 
The optional @ disables the echo status for this line. If the echo status is enabled, the line is displayed right before it is executed; see ECHO for more details.
 
The asterisk * is available only, if aliases are compiled into FreeCOM; if present, the alias expansion is skipped.
 
If commands are chained with the | symbols, those commands are to be executed as a pipe. For instance the command line:
 
  cmd1 | cmd2 | cmd3
 
..forms a pipe consisting of the three individual commands cmd1, cmd2, and 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. Note: Because DOS is no multitasking environment, pipes are simulated with file and the three-command pipe will look like this:
 
  cmd1 >%TEMP%\cmd###1.tmp
  cmd2 <%TEMP%\cmd###1.tmp >%TEMP%\cmd###2.tmp
  cmd3 <%TEMP%\cmd###2.tmp
 
The files are temporary ones and will be removed as soon as they are no longer required, meaning the tempfile #1 is removed after cmd2 terminates and tempfile #2 upon termination of cmd3.
 
Redirections tie the standard input or output stream to a file or device, for instance:
 
  cmd arg <infile >>outfile
 
..redirects the standard input stream of cmd to the file infile and the standard output stream to outfile. The double output redirection specifies to append to an existing file rather than overwriting it.  
 
=== Command line editing ===
 
FreeCOM offers two methods to interactively enter command lines: standard input and enhanced input.
 
The first one just calls a DOS function, whereas the second one processes each key for its own. Which method FreeCOM uses is defined at compile time.
 
If the echo state is enabled, the user is prompted with the PROMPT string; otherwise no visible or audible prompt is issued to indicate an user activity request.
 
In either mode the ENTER key terminates the editing and lets FreeCOM start to interprete the entered line.
 
The standard input mode does neither support command line history, except the last command line in some circumstances, nor file completion. The following keys have a special meaning:
 
* F1 Get next character from last line, if available
* F3 Get last line, if available
* F5 Place current line in last-line buffer and restart editing on a blank line
* F6 Insert the pseudo-character End-of-file
* backspace delete character to the left
* cursor left delete character to the left
* cursor right Get next character from last line, if available
 
The enhanced input mode does support command line history and file completion. The following keys have a special meaning:
 
* F1 Get next character from last line, if available
* F3 Get last line, if available
* F5 Place current line in last-line buffer and restart editing on a blank line
* backspace delete character to the left
* cursor down Replace the current input line with the previous line from the history
* cursor left move cursor one character one position to the left
* cursor right Move cursor one position to the right; at the end of the line get next character from last line, if available
* cursor up Replace the current input line with the next line from the history
* delete Deletes the character on the cursor
* end Moves the cursor to the end of the line
* ESC Clear current line
* home moves the cursor to the beginning of the line
* insert Switch between insert and overwrite mode
* TAB Take the current word for a file and try to complete it
* ^C Clear current line and enable echo state. The echo state is enabled to ensure the user gets to know he is on the command line of FreeCOM rather than stuck in a non-interruptable program.
 
== Development ==
 
'''This section is out of date.'''
 
=== Features ===
 
FreeCOM implements the following features:  
 
* FEATURE_ALIASES - Command aliases
* FEATURE_AUTO_REDIRECT_TO_CON - Autoswitch CON: to monitor
* FEATURE_BATCH - Batch script processing
* FEATURE_BOOT_KEYS - check for F5/F8 keys on startup if /P is present
* FEATURE_CALL_LOGGING - Startup logging
* FEATURE_DIRSTACK - Directory stack
* FEATURE_ENHANCED_INPUT - Enhanced command line editing
* FEATURE_FILENAME_COMPLETION - Filename completion
* FEATURE_HISTORY - Command line history
* FEATURE_INSTALLABLE_COMMANDS - Installable Commands interface (MUX-AE)
* FEATURE_LAST_DIR - Change back to last directory
* FEATURE_LOAD_MESSAGES - Load messages permanently
* FEATURE_NLS - use DOS NLS
 
=== Status ===
 
'''This section is out of date.'''
 
FreeCOM's development currently targets the v1.0 version, which is to provide all functionality (features) of commonly known COMMAND.COMs at minimum, but probably at the cost of optimization and performance. Note: This list got updated 5/2006 based on observations with 0.82pl3 and 0.84 - some of the features listed as 0.82pl3 might actually have been added even earlier.  
 
Things to do:
 
* INT-2E support (to SET master environment etc)
* Strict error recognition, probably _doserrno based
* Input/output functions to replace stdio.h by io.h (aka replace FILE*-based I/O by handle-based one)
* Relocate parts of shell to HMA if DOS=HIGH
* Code sharing of modules (better maintainability, smaller code)
* Alternative swap storage areas, for example EMS
* Swapping to disk without any supporting secondary programs (KSSF.COM and VSPAWN.COM)
* Redirection / Pipes in conjunction with Swapping
* Optimize FreeCOM for size
* Long FileNames (DIR supports LFN and FAT32 statistics in FreeCOM 0.84)
 
Other things that should be done:
 
* Swapping to XMS without helper programs (done?)
* Wildcards for REN (done?)
* Same filename pattern matching code / wildcard handling for REN, COPY and DIR (done?)
* IF /I (case-insensitive) (done?)
* internal commands (done?)
* Aliases: ALIAS
* Command line history: HISTORY
* Directory stack: DIRS, PUSHD, and POPD
* MUX-AE interface for shell plugins
* Enhanced command line editing, file completion
* Last directory recognition: CD -, CDD -, PUSHD
* Control Break handler
* Critical Error handler
* IF ERRORLEVEL H{letter}
* Full support for DOS NLS (date/time/number format, sorting...)
* DIR /O and DIR /A

Latest revision as of 14:22, 8 March 2024

The FreeDOS 1.3 RC1 distribution was released 3 February 2019.

History

FreeDOS 1.3 RC1 was made available in several formats:

  • FD13FLOP.IMG - Basic FreeDOS installation boot floppy image.
  • FD13LITE.IMG - Plain DOS system only! USB stick image.
  • FD13FULL.IMG - Plain DOS system and Full install USB stick image.
  • FD13LGCY.ISO - Contains all the packages as FD13-FullUSB. However, it is a bootable CD image designed for older hardware.

Two prototypes of LiveCDs are being provided with RC1. However, one will be discarded for FreeDOS 1.3 final, depending on feedback. Both types have some live FreeDOS packages at boot and support temporarily installing/removing more by using FDIMPLES. Also, both will automatically start networking support when used inside VirtualBox or VMWare. Otherwise, you will need to manually start it.

  • FD13LIVE.ISO - FreeDOS LiveCD along with support for a Plain and Full installation. Requires 64MB of RAM (more recommended).
  • FD13LIVE.ISO - FreeDOS LiveCD along with support for a Plain and Full installation. Requires 128MB of RAM.

Further information about the two LiveCDs are detailed in the Release Notes, below.

Changes

The FreeDOS 1.3 RC1 distribution is based on the package lists documented in FreeDOS 1.3 Packages.

The contents of the LiveCD are BASE + FDI requirements + a few useful and simple utilities. Note that we will continue to fine tune packages in the LiveCD if needed for FreeDOS 1.3 RC2.

Release notes

The release notes were published in plain text format. Original version is shown below:

### FreeDOS 1.3-RC1 Installation media.

README.TXT
    The simple "before you choose and install" document.
    (All zip archives contain a copy of this README file.)

verify.txt
    Contains MD5, SHA256 and SHA512 hashes for all of the different release
    files.

FD13-Floppy.zip

    * FD13FLOP.IMG - Basic FreeDOS installation boot floppy image.

FD13-LiteUSB.zip

    * FD13LITE.IMG - Plain DOS system only! USB stick image.

    * FD13LITE.VMDK - An Virtual Machine Disk description file to simplify
    attaching the LiteUSB image to a virtual machine (like VirtualBox and
    vmWare) as a hard drive.

FD13-FullUSB.zip

    * FD13FULL.IMG - Plain DOS system and Full install USB stick image.
    (Also, includes may extra packages that are not installed in the
    "Plain DOS" or even the "Full Install".  These extras can be installed
    later using FDIMPLES or another package manager)

    * FD13FULL.VMDK - An Virtual Machine Disk description file to simplify
    attaching the FullUSB image to a virtual machine (like VirtualBox and
    vmWare) as a hard drive.

FD13-LegacyCD.zip

    * FD13LGCY.ISO - Contains all the packages as FD13-FullUSB. However, it
    is a bootable CD image designed for older hardware. It uses the classic
    El Torito Boot CD-ROM format. Some modern computers and virtual machines
    are known to have issues booting CDs that use this ancient specification.
    Unless you have a computer that requires this type of bootable CD, we
    recommend using the LiveCD media.

Two prototypes of LiveCDs are being provided with RC1. However, one will be
discarded. Both types have some live FreeDOS packages at boot and support
temporarily installing/removing more by using FDIMPLES. Also, both will
automatically start networking support when used inside VirtualBox or vmWare.
Otherwise, you will need to manually start it.

So, let your voice be heard on which (if any) LiveCD you prefer.

FD13-LiveCD1.zip

    * FD13LIVE.ISO - FreeDOS LiveCD along with support for a Plain and Full
    installation. Requires 64MB of RAM (more recommended).

    Pros: Lower RAM requirement and superior management. In fact, using less
    than 64MB it is capable of bring up some portions of FreeDOS on a most
    important first basis. The more RAM you've got -- the bigger your temporary
    DOS drive will be. Uses less space on the LiveCD leaving more room for
    additional packages in the future. Also, it's also kinda cool to watch boot.

    Cons: Complex multi-stage startup process requires a little longer to boot.
    Some systems may have issues activating the RAM drive under FreeDOS.

FD13-LiveCD2.zip

    * FD13LIVE.ISO - FreeDOS LiveCD along with support for a Plain and Full
    installation. Requires 128MB of RAM.

    Pros: Faster boot time. SysLinux & Memdisk handle creation of a RAM drive
    and may have wider system support.

    Cons: Fixed DOS drive size and a very hard RAM requirement. Don't meet the
    requirement and the system will lockup on boot. Got gigabytes of RAM? Oh
    well, it will mostly be unused. Pre-installed packages that generate COM
    executable files in the %DOSDIR%\LINKS directory have issues. However,
    they do install fine when running the FreeDOS live from the CD.