Documentation of TRACK0 0.1

Deutsche Version

TopTop
Description of Program
Assumptions
Installation/Deinstallation
Command Line Parameter
Definitions of Actions
Data in the Command Line
Options
Management of Track Zero
Frequently asked Questions
About TRACK0
Shareware hints
Order
History

TopTop
Description of Program
Assumptions
Installation/Deinstallation
Command Line Parameter

What can I do with TRACK0?
You can manipulate data in track zero of a media - mostly a hard disk. TRACK0 is built to read and write any data (e.g. a serial number) up to usually 30,674 Bytes. These data are not accessable by normal programs, so a user cannot read, change or delete this data, even not with FORMAT or FDISK.

Further possibilities of using TRACK0 are:

Begin of Page Begin of Chapter


TopTop
Description of Program
Assumptions

Further restrictions are listed at Management of Track Zero.

Begin of Page Begin of Chapter


TopTop
Description of Program
Installation/Deinstallation

Copy the program files in a directory you like. :-)

Because of safety reasons you should keep the necessary program files together with the backup of track 0, sector 1 on a write protected DOS-bootable disk.

Files of Program
File NameDescription
TRACK0.EXEWork statements in i80286-language (the program itself :-)
TRACK0.INIConfigurations in text format for language and country file. The register code will also be put here. This file will be created in the program directory by TRACK0 at first start.
TRACK0ll.NLSAll language dependent strings are kept in this file.
STATE_cc.NLSFiles with county information.
TRACK0ll.HTMLanguage dependent documentation of program, (compacted) HTML format.
TRACK0.JSLanguage independent Javascript for the HTML documentation.
TRACK0ll.GIFLanguage dependent image for the HTML documentation.
*.GIFLanguage independent images for the HTML documentation.
T0REGll.TXTLanguage dependent order form. May be deleted after registration. ;-)
Legend:
ll2-character-language-code according ISO 639.
cc2-character-country-code according ISO 3166 (or ftp://ftp.ripe.net/iso3166-countrycodes)
If you are short on space, all above mentioned files with one of these codes in their names can be deleted - except the ones with the desired language and country code.

To deinstall TRACK0 simply delete all files of the project.

Begin of Page Begin of Chapter


TopTop
Description of Program
Command Line Parameter
Definitions of Actions
Options

First of all some conventions about notation:

The full syntax of TRACK0 is:
TRACK0 [options] [/action={backup|restore|get|put|delete|show}] [/trans={filename|ERRORLEVEL|"string"}]

also available with short hand parameters:

TRACK0 [options] [/a={b|r|g|p|d|s}] [/t={filename|ERRORLEVEL|"string"}]

Begin of Page Begin of Chapter


TopTop
Description of Program
Command Line Parameter
Definitions of Actions
Data in the Command Line

The actions BACKUP and RESTORE are designed only to protect you against data loss.

/ACTION=BACKUP </trans=filename> [/Batch] [/Verbose] [/Range] [/Disk]
Creates a backup of that area of data TRACK0 usually uses: first hard disk, track zero, head zero, all sectors excluding the first (2 up to the maximum of 63). TRANS has to be set to a file name. If this file exist and the parameter /BATCH is not set, you will be prompted for overwriting it.

Example:

TRACK0 /ACTION=BACKUP /TRANS=a:\backup\hdd0.dat

would write the content of track zero, head zero, sector two until the maximum available sector number into the file named "a:\backup\hdd0.dat".

Because of securety reasons you should do this action first of all. If possible, put this file together with TRACK0 on a bootable DOS disk.

/ACTION=RESTORE </trans=filename> [/Batch] [/Verbose] [/Range] [/Disk]
Does the opposite of BACKUP: Writes the content of a file (a backup, I hope) into that area of the disk, TRACK0 usally uses (first hard disk, track zero, head zero, all sectors excluding the first). TRANS have to be set to the name of an existing file. If the size of the file does not match the size of area the file is to be written to, the program will abort.

If you don't set the option /BATCH you will be asked to continue.

Important: If you suppress the defaults of the program by setting /RANGE or /DISK, you may loose the MBR as well as the partition table and all your hard disk data in consequence. Please use these parameters only, if you know what you are doing!

/ACTION=SHOW [/Disk]
Shows information about occupied, empty and sectors that are used by TRACK0. Default.
Example for the screen output with the parameter /ACTION=show applied to a disk TRACK0 has never written data to
Track0 v0.0, (c) 1997-2000 by MSDatec
-------------------------------------------------------
registered for Peter Mustermann
summary of track 0 of disk 128:
63 sectors total
0 sectors used by TRACK0
46 sectors possible free: 18-63
46 sectors available for data (22,754 bytes)
MBR: signature ok
Example for the screen output with the parameter /ACTION=show applied to a disk TRACK0 has already written data to
Track0 v0.0, (c) 1997-2000 by MSDatec
-------------------------------------------------------
registered for Peter Mustermann
summary of track 0 of disk 128:
63 sectors total
7 sectors used by TRACK0: 10,13-18
3,041 bytes stored user data
stored with TRACK0 version 0
first write at 08/17/00 09:05:42 am
last write at 09/27/00 10:53:50 pm
6 sectors possible free: 4-9
13 sectors available for data (6,419 Bytes)
MBR: signature ok

/ACTION=GET </trans={filename|ERRORLEVEL}> [/Index] [/Errorcode] [/Batch] [/Verbose] [/Disk]
Reads previous written data from track zero, head zero and puts them to TRANS. TRANS may be either the name of a file (filename) the data are to be written to.

Example:

TRACK0 /ACTION=GET /TRANS=f:\pc\serial.txt

would write the previous written data (first hard disk, track zero, head zero) into the file f:\pc\serial.txt.

Or TRANS may have the value ERRORLEVEL. The DOS-errorlevel is put to the first byte of the previous written data then. If you want another byte than the first, use option /INDEX.

Examples:

TRACK0 /ACTION=GET /TRANS=ERRORLEVEL

The DOS-errorlevel would be put to the first data byte of the previous written data (first hard disk drive, track zero, head zero).

TRACK0 /ACTION=GET /TRANS=ERRORLEVEL /INDEX=123

The DOS-errorlevel would be put to the value of the 124th byte.

In order to distinguish the read value from an error you can determinate which DOS-errorlevel should be set on an error by using option ERRORCODE.

Example:

TRACK0 /ACTION=GET /TRANS=ERRORLEVEL /INDEX=123 /ERRORCODE=99

The DOS-errorlevel will be set to the value of the 124th data byte, if no error occour. In case of an error the dos-errorlevel will be set to 99.

/ACTION=PUT </trans={filename|"string"}> [/Batch] [/Disk] [/Fill] [/Verbose]
Fetch the data from TRANS and write them into free sectors of track zero, head zero. If TRACK0 has written data earlier there, they will be wiped with FILL first.
If the amout of data exceeds the available space, no changes are made and the program terminates with an error.

If TRANS is a reference to an existing file (filename), the data will be fetched from there. On the other hand you may specify the data on the command line ("string"), putting them in doube quotes.

Example:

TRACK0 /Action=put /Trans="serial: 12345678"

The data serial: 12345678 would be written to free sectors.

You will find details on this in Data in the command line.

/ACTION=DELETE [/FILL] [/Batch] [/Verbose] [/Range] [/Disk]
Previous written data are deleted by filling them with zeros. You may specify another fill value with FILL.

Attention: You may loose your partition table by using the parameter RANGE with odd values.

Begin of Page Begin of Chapter


TopTop
Description of Program
Command Line Parameter
Definitions of Actions
Data in the Command Line

If you put data into the command line, you must put double quotes around.
The program can handle with 255 characters, but the PSP (Program Prefix Segment) has space for 127 characters only. If the command line interpreter (e.g. COMMAND.COM) supports 127 characters as well, you can use 127 characters minus Lenth of Program Name minus 1 space minus 2 double quotes for data.

For the data in this string following rules apply:

If environment variables are given in the string, the will be expanded (even if the variable is null).

Example:
»abcde%test%xyz«
would be expanded to »abcde123xyz« if the environment variable has the value 123. If the variable had been empty, the text were expanded to »abcdexyz«.

Begin of Page Begin of Chapter


TopTop
Description of Program
Command Line Parameter
Options

/BATCH
/b
Surpresses confirmation questions. No default.

/DISK=Byte
/d=Byte
Number of drive according BIOS convention:
0first floppy disk drive
1second floppy disk drive
...
128first hard disk drive
129second hard disk drive
...
If /Disk is not given, 128 will be used - this is drive C: in most cases.

/ERRORCODE=byte
/e=byte
Only senseful with ACTION=GET and TRANS=ERRORLEVEL. If an error occours, the given ERRORCODE is set.
If you know the range of the data byte to be read (e.g. between 1 and 100), you can set ERRORCODE to 101 to find out an error condition.

If ERRORCODE is not set, the program always returns 255 on any error.

/FILL=byte
/f=byte
Only possible with ACTION=DELETE or ACTION=PUT. All sectors used by TRACK0 are filled with the given value. If FILL is not set, zero is used.

/INDEX=integer
/i=integer
Only sensefull with ACTION=GET and TRANS=ERRORLEVEL. You can determinate the index of the data byte to be retureed as DOS errorlevel. The count starts with zero.
If /INDEX is not set, the first data byte is returned.
The maximum senseful value is 63 sectors * 512 bytes/sector = 32.256 bytes.

/RANGE=Sectorlist
/r=Sectorlist
List of sectors to be treated. Only possible with BACKUP, RESTORE and DELETE. Usually TRACK0 finds the sectors itself (see Description of Program).
Attention: Use this feature only if you know what you are doing. Perhaps you may loose the partition table and the MBR, what leads to an unbootable hard disk and unaccessable disk data.

/VERBOSE
/v
Verbose mode. No default.

Begin of Page Begin of Chapter


TopTop
Management of Track Zero

Usually the first step boot loader (Master Boot Record, short MBR) and the partition table are stored in the first sector in head zero in track zero of the first hard disk, and all other sectors of this track are unused (except a boot manager or similar, which will be detected by TRACK0). These sectors are scanned for free sectors, and if there are some, the program writes its identification and any data from a file or the command line up to 495 bytes per free sector.

It does not matter which file system (FAT, VFAT, VFAT32, HPFS, HPFS386, NTFS, EXT2, ...) is used on other parts of the hard disk or even if there is another file system.

A sector may be free if it consists only of the same fill byte. If this sector is not used by other programs, an interaction of TRACK0 with other data or programs will probably not happen. To keep the risk of data loss small, TRACK0 uses free sectors from upper (mostly 63) down to lower values (lowest is 2).

Please note that there is no convention to distiguish used from unused sectors. It may happen that programs working near to the system (operation system, boot manager, BIOS-extentions) overwrite data written by TRACK0. Before you start such kind of software, you should read the TRACK0-data to a file, and afterwords restore your data.

The head zero, track zero in linear model:Master Boot RecordSector 1Partition TableSignature (0x55AA)TRACK0 Administration DataTRACK0 User DataTRACK0 Administration DataTRACK0 User DataTRACK0 Administration DataTRACK0 Administration DataTRACK0 Header for User DataTRACK0 User DataTRACK0 Administration Data
Composition of the first Sector
IndexLengthDescription
0variabelMaster-Boot-Record (MBR)
44664Partition Table
5102Signature '55AAh'
Sum: 512 Byte

The first sector ist not treated by TRACK0 usually. TRACK0 uses the second and following sectors. Sectors used by TRACK0 are constructed as follow:

Data Composition of a TRACK0 Sector
IndexLengthDescription
014Magic Number for Identification
141Number of the next used sector. The last sector takes it own number.
15495User Data
510216 bit check sum (CRC) over the previous 510 bytes
Sum: 512 Bytes

The user data are spread over the free sectors. In order to keep information about the user data, a administrative header is added and put into the sector with the highest number.
The header consists of following:

Composition of the User Data Header
IndexLengthDescription
01Total length of the header including the tailing check sum.
11Version infos
24Date and time of first write (packed format). This time is set only at the first writing to a disk.
64Date and time of last write (packed format).
102Amount of user data in bytes
122Check sum (CRC16) for the user data
142Check sum (CRC16) for the previous data (check for the head itself)
Sum: 16 Bytes

So the first sector used by TRACK0 can take 495-16 = 479 bytes user data only (all other can take 495 Bytes).

Limitations:

Begin of Page Begin of Chapter


TopTop
Frequently asked Questions

Other Media than Hard Disk Drives

Can TRACK0 handle other media than hard disks?

If this medium has a partition table, TRACK0 should work proper on this medium.
If this medium does not have a partition table, probably parts of the file system will be destroyed. For example on floppy disks with FAT file system unused parts of File Allocation Table are overwritten, but the files on the floppy are still accessable - mostly. Back up your data before using other media than hard disk drives.

No Space left on Medium

I would like to store some data on the first track, but your program says there are no free sectors.

Perhaps the data in sector 2-63 is garbage, perhaps not. Some viruses, boot manager or BIOS extensions are known to write data into this area. Ask the manufacturer of the software how many sectors it uses. If you are sure not having such kind of software only sector 1 is used on your system.

Proceed as follows to delete sectors with "data garbage" (on own risk):

  1. Make a backup of the media.
  2. Try to find out how many sectors are used by another software. In most cases only sector 1 is used for the MBR and partition table.
  3. Backup at least the area of track zero which seems to be unused and put it on a bootable DOS disk which should also contain the files of TRACK0.
  4. Now boot the system from the disk and validate that TRACK0 can access the medium.
  5. Delete the sectors that seem to be unused.
  6. Boot the system from the usual medium and have a look at the boot messages. If you get error messages reboot as soon as possible from the disk and restore the data.
    But perhaps another program has already written data to areas outside track zero...

Error message "Invalid Header CRC"

I get the error message "invalid header CRC". What's that?

Either the TRACK0 header for user data or the user data itself have been damaged. This may happen, if you use software which also stores data in track zero (boot manager, viruses, etc.) TRACK0 does not contain routines to reconstruct the data in case of damage. You may restore parts of the stored data: Uses ACTION=BACKUP to create a file which contains the sectors in question and use a hex editor to examinate it. Instead, you can use an disk editor to examinate the data on the disk directly.

Lost Partition Table

Accidently I have lost the partition table. Can I get it back with TRACK0?

Only, if you made a backup of the sector one earlier and only if the main partition table is lost. In this case:

  1. Find out the number of sectors: track0.exe /action=show. On modern hard disks this value is 63 probably.
  2. Write the earlier written sector image back to the medium: track0.exe /action=restore /trans=filename /Range=1-63. Replace the number '63' by the current value of your system.
  3. Restart the system.

Backup the MBR and Partition Table

How can I backup the partition table?

TRACK0 cannot make a copy of the partition table but an image of the sector which contains it and the MBR:

  1. Create a bootable DOS disk and put the necessary parts of TRACK0 on it. Perhaps you also want to put the description of restoring in simple text format on it.
  2. Create the backup: track0.exe /action=backup /trans=A:\PT.DAT /Range=1-1. Now there should be a file named PT.DAT, 512 bytes on your disk. This file contains an image of the first sector.
  3. Write protect the disk and store it on a save place. Keep in mind to date it up if you change partition data, operating system or similar.

Restore the MBR and Partition Table

How can I restore the partition table and the MBR?

Boot from the backup disk. Use track0.exe /action=restore /trans=A:\PT.DAT /Range=1-1 to write the earlier written image back to the first hard disk. Be sure that the image on the disk contains the partition data you want to get.

Language and Country Settings

How can I change the language or country settings?

The program directory of TRACK0 contains the file TRACK0.INI. Open this file with a text editor and replace the file names of LanguageFile and CountryFile by the ones you want to use.
Example: The current locale may be "Deutsch (Deutschland)". The entries of TRACK0.INI are as follow:
LanguageFile=TRACK0DE.NLS
CountryFile=STATE_DE.NLS
If you want to use the locate "English (United Kingdom)", you have to change the entries in TRACK0.INI to the following:
LanguageFile=TRACK0EN.NLS
CountryFile=STATE_GB.NLS
The meaning of the names is mentioned at Installation/Deinstallation.

Another way than editing the entries is to delete TRACK0.INI - after the next start TRACK0 will ask you for your desired country and language settings and create a corresponding initialisation file.

Begin of Page Begin of Chapter


TopTop
No linkAbout TRACK0
Shareware hints
Order
History

Author of Program

Please send bug reports, comments and milled hard disks to:

Leitseite MSDatec

FirmeninfosWer und Was
Komplettsysteme und KomponentenKomplettsysteme
und Komponenten
Entwicklung, Produktion, InstallationEntwicklung,
Produktion,
Installation
SystembetreuungSystembetreuung
SeminareSeminare

Matthias Stolte Datentechnik (MSDatec)

Systembetreuung, Seminare, EDV- und Telekommunikationslösungen

Kommunikationsverbindungen:

Newest version

The newest version of this software is always available with Euro File Transfer (EFT) or in internet at http://www.msdatec.de/download.htm

Limitations

The usage of this program is at your own risk. There is no warranty for the program except the above mentioned functions. Neither the author nor his company is responsible for any damage or loss concerning this program especially not for loss of data.

Begin of Page Begin of Chapter


TopTop
About TRACK0
Shareware hints

This Software is Shareware.
This means you can test the software and decide if it satisfies your demands before buying it. After 30 days - counted from the first start - you have to licence the software or you may not use it anymore.
Number of licences
n²-licence
Number of
licences
simultaneous
usable
11
24
39
416
etc.
Please note that the software is licenced like a book. You can install it on different machines and it can be used by different persons, but not simultaneously. If the software is used multiple simultaneously, you need multiple licences. The number of necessary licences follows the n²-licence, that means, the number of software copies you can use simultaneously is the square of the number of licences (see table).
May I give the software to others?
You may give it to others, if you didn't change anything in the distribution. Please keep the name of the distribution if you give it to others.
Of course you are not allowed to give the register code to others except you don't use it anymore.
What is the difference between the unregistered and the registered version?
The registered version does not wait for a key press at start, which prevents batch modus.
Furthermore you get technical support concerning this program as well as two free updates (for example if you register version 3 you can use the versions 4 and 5, too).
How can I register?
See next page. :-)

Begin of Page Begin of Chapter


TopTop
About TRACK0
Order

How to register the shareware version
The waiting for a key press is surpressed in the registered version. The cost of one licence is 15.00 Euro. You can transfer it to my account or you can send me a letter with a cheque or bank notes. Please don't forget to mention the name of the program and your E-Mail- or letter-address. Sometimes I get payments, where I can't see which program is concerned nor where I have to send the code.

If you have done so you will get the register code by E-Mail or letter. Instructions how to use it will be included there.

You can send me the following order as an E-Mail. If you have activated java script in your browser, the sums are calculated automagically.
(If the order isn't possible with this formular {e.g. the internet explorer can't do this}, you can send me the text formular T0RegEN.txt with E-Mail, fax or letter.)


Yes, please send me...

1 register code for the program TRACK0 0.1 (15.00 Euro) Euro
more licence(s), each 15.00 Euro Euro
via E-Mail
via letter including a 3,5"-Disc

Sum: Euro
All prices include taxes.

The value of Euro I have
assigned to the account of Matthias Stolte Datentechnik, account number 41508078 at Sparkasse Bielefeld, bank number 480 501 61, Germany. I've put my name as well as the program name TRACK0 on the assignment formular.
sent as cheque/bank notes to: Matthias Stolte Datentechnik, 33613 Bielefeld, Albert-Schweitzer-Straße 4, Germany.

Salutation:First name:Family name:
Organisation:Department:
Postial area code:City:Country:
Street:
Telephon:Fax:E-Mail:
Comments:

Begin of Page Begin of Chapter


TopTop
About TRACK0
History

Version 0.0:
Release: 11/15/2000, Time stamp 00:00
Size of TRACK0.EXE: 74,496 Bytes
MD5-sum of TRACK0.EXE: 05604be5d71decab7069fb9b3a2d6bc0
Version 0.1:
Release: 08/11/2001, Time stamp 00:10
Size of TRACK0.EXE: 74,496 Bytes
MD5-sum of TRACK0.EXE: 05604be5d71decab7069fb9b3a2d6bc0
Bugfixes: none
Changes: Documentation update

Begin of Page Begin of Chapter


Last update: 08/11/2001