In this example let us start studying from the first line. The command DEBUG A:\BKDBR.BIN Initializes the debug command with creating a file in A: floppy drive named as BKDBR.BIN if it is not already present there. That’s why we got the message “File not found” in the starting.
In our second Instruction L 100 2 0 1, The L (load) command is to load the DBR of the instructed drive. Let us learn how? In this Instruction the number 100 is the address of the buffer, where the DBR will be stored, next number 2 is used for the drive C(C :). The drive numbers are given as follows:
Drive Letter |
Number Used |
A:
B:
C:
D:
.
.
and so on |
0
1
2
3
.
.
. |
The next number 0 is the starting sector number of the number of sectors to be read. Here we are using 0 to read the 1st sector i.e. DBR sector. The next number that is 1 is used to inform the number of sectors to be read.
Here we have given 1 because we only want to read one sector. However we can use the numbers and locations of starting and ending sectors according to our needs in different type of other operations. Therefore it will load one sector staring from 1st sector of the drive C: to the memory location 100.
And R CX Instruction is used to change or to define the length of the data we want to write in BKDBR.BIN file. This Instruction will show the current value of the CX register and allow you to make any change. We typed 200 here because the DEBUG command uses hexadecimal system and the size of DBR in hexadecimal is 200(h) bytes that is 512 bytes in Decimal system.
W command tells the DEBUG to write the 200(h) bytes from location 100 to the BKDBR.BIN file. And finally we use the Instruction Q to quit the DEBUG and go back to the DOS prompt.
Warning!!! Warning!!! Warning!!!
It is strictly recommended that you should know what and how are you doing in the procedure of restoring DBR of any disk. If accidentally you store the illegal or DBR of any other Disk, it is possible in most of the cases that the complete data of the disk may become inaccessible.
when you type the first Instruction of the coding that is:
DEBUG A:\BKDBR.BIN <Enter>
File must be in the given location where you are starting the DEBUG program. Now if you get the error message “File not found” before the DEBUG prompt then immediately stop the process by using the Q (quit) command. Because it means that the BKDBR.BIN file could not be found or opened by the DEBUG program and if you continue this process some junk information will be written on DBR and it will make the complete partition inaccessible. |
Now let us see what we did in the coding of the Instructions for restoring the DBR from the backup file we made named BKDBR.BIN. The commands of DEBUG to restore the backup are as follows:
C:\> DEBUG A:\BKDBR.BIN <Enter>
- W 100 2 0 1 <Enter>
- Q <Enter>
|
This Instruction will write 1 sector of information from the BKDBR.BIN file in floppy drive (a:) in the memory location 100 to the first sector that is sector 0 of 2nd drive that is drive(C:).
|