© Copyright 1998-2000
by
Ralf Quint
The Pacific
Coast Byte Factory
Los Angeles, California
U.S.A
eMail:Ralf@aztechvision.net
http://members.xoom.com/PCByteFactory/
Written for the FreeDOS project
http://www.freedos.org/
BACKUP and RESTORE for FreeDOS
These two programs resemble the programs of the same name of MS-DOS. They are supposed to be compatible to those versions, enabling the user to exchange backups between FreeDOS and any given DOS version. Unfortunately complete compatibility is no easy to achieve. As FreeDOS tries to achieve compatibility to MS-DOS 3.3, the compatibility to the BACKUP and RESTORE of this DOS version was the primary goal in the development of the program. Extended compatibility will be tried to achieve in future versions of the FreeDOS versions of BACKUP and RESTORE.
One of the biggest problems
in the development of BACKUP and RESTORE for FreeDOS was the fact that
no information on the used data format was available. Even different versions
of DOS were not able to read each others backup files, giving the user
sometimes big headaches after upgrades or system crashes, as previous backups
were not readable anymore. At least MS-DOS 6.22 came with a RESTORE program
(beside the MSBACKUP.EXE) that is able to read at least backup files from
DOS versions 2.x-5.x.
The basic hints about the
data format of the different MS-DOS version were found in an article of
the excellent German computer magazine c’t (http://www.heise.de/ct/)
in 1989. The presented information were expanded by own reverse engineering
and the demo programs, written in Borland Pascal, were improved to one,
much more sophisticated RESTORE program. All this work is the base for
the FreeDOS versions of BACKUP and RESTORE, written in C (Borland C++ 3.1/Turbo
C++ 3.0), as supposed for the FreeDOS development.
Some additional information
and testing tools have been available on Microsoft’s web site on this issue
(http://support.microsoft.com/download/support/mslfiles/PD0315.EXE).
Beside the information how to use BACKUP and RESTORE for FreeDOS, this document is intended to give the basic information about the used data structures, files formats and further issues.
Data format for the DOS versions 2.0 to 3.2x
The Backup for these DOS versions creates one control file (BACKUPID.@@@) for each backup disk and a single backup file for each backup'd file.
The format of the BACKUPID.@@@
control file is as follows:
Each of these backup files consists of the original file contents preceded by a 128-byte header and the original filename.
The format of the file header
is as follows:
*1 Note: | There is supposed to be a difference how MS-DOS 3.2 and IBM-DOS 3.2 handle the pathname entries. MS-DOS BACKUP writes the path name with a forward slash (/) and RESTORE accepts both forward and backward slash (\), while IBM-DOS accepts only the backward slash (\). The BACKUP program of FreeDOS writes only backward slashes and accepts both types in the RESTORE program. This avoids any further compatibility problems. On at least one system that i aquiered with MS-DOS 3.2 loaded, the backup files were written with the backward slash (\). |
Data format for the DOS versions 3.30 to 5.x
Each backup disk consist
of two files:
- | A control file holding name, attributes, date/time stamp and size with the filename CONTROL.??? with .??? in the range 000 to 255 (or 999 ? Sorry folks, but I had no interest in testing this ;-) ) |
- | A backup file (BACKUP.???) associated to the CONTROL.??? File, which is just one file copied after the other |
The format of the control
file is as follows:
followed by a number
of entries of one of the following types
It appears that at least
one directory entry has to be written to the CONTROL file in order to define
the source path of the backup-ed files.
Offset | Size | Contents |
0x0000 | 1 byte | 0x00, length of the entry record, excluding this byte |
Data format for the DOS versions 6.x
With the newer, more enhanced
versions of DOS emerging, unfortunately compatibility between the different
DOS versions became an illusion. Not only that MS-DOS and PC-DOS went different
ways after the split-up of the development between Microsoft and IBM, with
Digital Research/Novell there was a third player with an even more different
DOS version.
The Backup programs for
these DOS versions are actually licensed versions of the Norton (Symantec)
or Central Point (Symantec) backup programs. They use proprietary compression
formats (QIC-113), which are for copyright reasons not usable. Even though
the program became more sophisticated in their abilities, compatibility
to earlier DOS versions seems never to be an issue for their implementation.
The FreeDOS BACKUP & RESTORE and the Y2K issue
Both programs use the DOS provided data structures to represent the files date and time stamp. These timestamps can be considered Y2K safe. Any date output of these two programs is using the 4-digit format and accepts any date in this format. 2 digit years are considered to be an offset to 1980, so being interpreted as being 1980 to 2079.
Coding/Compiling
Requirements
The programs BACKUP and
RESTORE for FreeDOS have been developed using Borland C++ 3.1 and Turbo
C++ 3.0. They won't compile with the free available Turbo C 2.01 (yet),
mainly because of a heavy use of the C++ style '//' comments. The sources
themself are otherwise written in straight ANSI C (with the necessary DOS
extensions), there are no C++ code used. All source files use the .C extension,
all header files use .h extension, with the exception of the include files
for the "build" number, which have the extension .bld. They source distribution
for these programs provide the necessary .PRJ files (in BC/TC 3x format).
The important settings are summorized in the following table:
|
|
|
Tabs Size |
|
|
Memory Model |
|
|
Code Generation: CPU |
|
|
Code Generation: Floating Point |
|
|
Display Warnings |
|
|
|
|
start of the program(s) for the FreeDOS project |
|
|
first public release for the FreeDOS project |
These programs are basically
the translation of an existing program from Turbo/Borland Pascal to the
C language to meet the requirements of the FreeDOS project.
The information about the
data format is acquired from an article of the German computer magazine
c’t, published in 1989. This information is expanded by own re-engineering
of the data written and read by the original MS-DOS BACKUP and RESTORE
programs.
BACKUP and RESTORE for FreeDOS
are written in Borland C++ 3.1 and Turbo C++ 3.0 (© by Borland Inc,
now Inprise Inc).
MS-DOS™ of Microsoft Corporation
DR-DOS, Novell-DOS ™ of
Caldera/Lineo.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note: | BACKUP and RESTORE for FreeDOS were tested on the following DOS versions for their functionality according to the specification of this document. The FreeDOS programs are not compatible with the BACKUP/RESTORE programs of these DOS versions! |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Road map for future program versions