Documentation of TRACK0 0.1
Deutsche Version
| Top |
| | 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 |
| Top |
| | 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:
- You can fill any sector from track 0 with a specific number - this means deleting these sectors. If sector 1 is filled, the partition table and the master boot record are away (some needed to do this for installing a new Redmond operation system).
- You can write sectors from track 0 to a file to take precautions against infection with computer viruses or deletion of main partition table (see FAQ: Backup MBR/Partition table).
- If you want to have a lot of hard disk partitioned in the same way - but without extended partitions -, you can build an image of sector one and simply copy it to the other hard disks. This meight be of interest for system builders or administrators of teaching rooms.
| Top |
| | Description of Program |
| | Assumptions |
|
- This program requires an computer with at least 80286 CPU and a NPU (numerical co-processor). If you need a version for an older CPU, please EMail.
- The operating system must be DOS (tested with DOS7.x of Win9x). Reading of data works fine in a DOS window, but writing does not. If you really need writing in a DOS window, please drop me an EMail.
- DOS memory needed: about 100 kB plus the amount of data to write/read.
- TRACK0 only works with media accessable by INT13h and only with the first track of it.
Further restrictions are listed at Management of Track Zero.
| Top |
| | 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 ProgramFile Name | Description |
---|
TRACK0.EXE | Work statements in i80286-language (the program itself :-) |
TRACK0.INI | Configurations 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.NLS | All language dependent strings are kept in this file. |
STATE_cc.NLS | Files with county information. |
TRACK0ll.HTM | Language dependent documentation of program, (compacted) HTML format. |
TRACK0.JS | Language independent Javascript for the HTML documentation. |
TRACK0ll.GIF | Language dependent image for the HTML documentation. |
*.GIF | Language independent images for the HTML documentation. |
T0REGll.TXT | Language dependent order form. May be deleted after registration. ;-) |
Legend: |
ll | 2-character-language-code according ISO 639. |
cc | 2-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.
| Top |
| | Description of Program |
| | | Command Line Parameter |
| | | Definitions of Actions |
| | | Options |
|
First of all some conventions about notation:- necessary parameters are surrounded by <>, optional ones by [] and sets by {}
- the symbol | is used for an OR-combination
- words in Italic font are understood to be symbolic terms
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"}]
| Top |
| | 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.
| Top |
| | 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:
- The escape (\) prevents the following char from interpretation, exept the following:
String | Value (dezimal) | Interpretation to |
---|
\\ | 92 | the escape itselfExample:is interpreted as »C:\WIN95«. |
|
|
\a | 7 | alert |
\b | 8 | backspace |
\e | 92 | the escape itself |
\f | 12 | page feed |
\n | 10 | line feed |
\r | 13 | carriage return |
\t | 9 | horicontal tab |
\v | 11 | vertical tab |
- Double quotes (") must be leaded by escape (\)
Example: | »A \"word\" in double quotes« | is interpreded as »A "word" in double quotes«. |
|
- Any characters can be defined by using its value of the caracter table. The description of the number base can be found at previous place.
Example:is interpreted as »A~«. |
|
If environment variables are given in the string, the will be expanded (even if the variable is null).
Example: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«. |
|
| Top |
| | Description of Program |
| | | Command Line Parameter |
| | | Options |
|
- /BATCH
- /b
- Surpresses confirmation questions. No default.
- /DISK=Byte
- /d=Byte
- Number of drive according BIOS convention:
0 | first floppy disk drive |
1 | second floppy disk drive |
... |
128 | first hard disk drive |
129 | second 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.
| Top |
| 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:
Sum: 512 ByteThe 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 SectorIndex | Length | Description |
---|
0 | 14 | Magic Number for Identification |
14 | 1 | Number of the next used sector. The last sector takes it own number. |
15 | 495 | User Data |
510 | 2 | 16 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 HeaderIndex | Length | Description |
---|
0 | 1 | Total length of the header including the tailing check sum. |
1 | 1 | Version infos |
2 | 4 | Date and time of first write (packed format). This time is set only at the first writing to a disk. |
6 | 4 | Date and time of last write (packed format). |
10 | 2 | Amount of user data in bytes |
12 | 2 | Check sum (CRC16) for the user data |
14 | 2 | Check sum (CRC16) for the previous data (check for the head itself) |
Sum: 16 BytesSo the first sector used by TRACK0 can take 495-16 = 479 bytes user data only (all other can take 495 Bytes).
Limitations:
- The sector size of the media must be 512 bytes.
- TRACK0 can handle with the maximum of 255 sectors. TRACK0 can only read and write the amount of 65520 bytes (except the action BACKUP and RESTORE). With 512 Bytes/sector TRACK0 can handle only with 127 sectors. Because the BIOS-Int 0x13 supports only 6 Bits for the value of the sector, the maximum count of sectors is 64.
| Top |
| Frequently asked Questions |
|
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.
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):
- Make a backup of the media.
- 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.
- 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.
- Now boot the system from the disk and validate that TRACK0 can access the medium.
- Delete the sectors that seem to be unused.
- 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...
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.
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:
- Find out the number of sectors: track0.exe /action=show. On modern hard disks this value is 63 probably.
- 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.
- Restart the system.
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:
- 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.
- 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.
- 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.
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.
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.
| Top |
| | About TRACK0 |
| | Shareware hints |
| | Order |
| | History |
|
Author of Program
Please send bug reports, comments and milled hard disks to:
| Wer und Was | | Komplettsysteme und Komponenten | | Entwicklung, Produktion, Installation | | Systembetreuung | | Seminare |
| Matthias Stolte Datentechnik (MSDatec) Systembetreuung, Seminare, EDV- und Telekommunikationslösungen
Kommunikationsverbindungen: |
The newest version of this software is always available with Euro File Transfer (EFT) or in internet at http://www.msdatec.de/download.htmLimitations
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.
| Top |
| | 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²-licenceNumber of licences | simultaneous usable |
---|
1 | 1 |
2 | 4 |
3 | 9 |
4 | 16 |
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. :-)
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.)
- 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
Last update: 08/11/2001