Formatting “Track 0 Bad” floppy program to format floppies which have bad sectors on their track 0 and when are formatted with DOS or windows, display error messages like “Track 0 BAD”. The program rewrites all the DBR, FAT and Root Directory information

Data Recovery PRO DATA DOCTOR

Home | Order Online | Downloads | Contact Us | Software Knowledgebase

it | es | pt | fr | de | jp | kr | cn | ru | nl | gr


Formatting “Track 0 Bad” floppy

This program is used to format those floppies which have bad sectors on their track 0 and when are formatted with DOS or windows, display error messages like “Track 0 BAD”. However you can also use it to format normal floppies.

The coding of the program has been given in the disk included with this book with the name “TTFORMAT.C”. The working logic of the program is same as the program published in PCQUEST computer magazine, in February 2003 edition.

In this program, we try to make this type of floppies reusable by formatting them. The program sounds that you can handle the floppy disk even with some bad sectors on it. However, if the first sector of the disk is bad, the floppy can not be formatted.

The program rewrites all the DBR, FAT and Root Directory information. If there are bad sectors on the surface of the disk, they are marked as bad in FAT.

In the coding of the program, the structure BPB is used to writer the BIOS Parameter Block of the DBR. The structure boot_sector is used to write the DBR of the disk. The structure address_field is used for interacting with number of cylinder, heads, and sectors per track and with the size of the sector.

Different functions used in the coding of the program and their description have been given in the table given next.

Function

Description

Random_VolumeID( )

This function provides the volume ID of the disk. (How DOS generates the serial number of the floppy has been discussed next to this table)

mark_bad( )

Mark bad sector using function 04H of INT 13H to verify the sectors.

sector_no_to_physical( )

This function is used to Convert the number of sectors into tracks, Heads and sectors

format_term( )

To terminate the formatting and exit the program

write_boot_info( )

Writes the boot sector of the disk

set_media_type_for_format( )

The function is used to Set Media Type For format using function 18H of INT 13H

volume_label( )

The function gets the volume label to write volume label of the disk

format( )

Wipes the surface of the disk during formatting as well as handling the bad sectors count.

get_drive_parameters( )

The Function uses INT 13H, Function 08H to get drive parameters.

mark_bad( )

Holds the information of bad cluster to mark in FAT

ask_for_continue( )

Function to confirm before formatting the disk

check_bad( )

Function to check if the returned status is error code for BAD sector

error( )

This function Displays Error message for Corresponding error code

lock_volume( )

The function is used to lock the Drive using INT 21H, function 44H and Sub function 0DH

unlock_volume( )

The function is used to unlock the Drive using INT 21H, function 44H and Sub function 0DH

physical_to_sector_no( )

Function is used to Calculate number of sectors from track, head and sector number

The Volume Serial Number of the Floppy disk is calculated by the DOS according to current date and time of the system clock.

The first part of the serial number is calculated by the sum of the time (seconds and hundredths of a second) and the date (month and day). The second part of the serial number is equal to the sum of the time (hours and minutes) and date (year).

All the calculations are performed in hexadecimal system. For example, let us assume that you formatted the floppy in DOS environment at 11:16:28:65 on 10/23/2003. Now let us calculate the serial number of the disk.

The time in (seconds and Hundredths of seconds) format is
= (28 and 65)
= (1CH and 41H)
Write it as 1C41

Similarly, date in (month and day) format is
= (10 and 23)
= (0AH and 17H)
Write it as 0A17

Similarly, time in (hours and minutes) format is,
= (11 and 16)
= (0BH and 10H)
Write it as 0B10

And the year will be
= 2003
= 07D3

Now, let us calculate the serial number of the floppy disk, according to the description given before. The first part of the serial number well be (1C41 + 0A17) = 2658 and the second part of the serial number will be (0B10 + 07D3) = 12E3.

Sample Chapters from book DATA RECOVERY WITH AND WITHOUT PROGRAMMING by Author Tarun Tyagi
Data Recovery with & without Programming


Publishers of the Book
Number of Pages
ISBN
Price of the Book


BPB Publications, New Delhi, India
540
81-7656-922-4
$69.00 (Including Shipping Charges, Cost of Book and Other expenses, Free Source Code CD included with the Book)





Buy Data recovery Book

Previous page

page 1 | 2 | 3 | 4 | 5 | 6

Next page

© Copyright 2002-2005 DataDoctor.Biz

Home | Contact us | Downloads | Services | Terms and conditions | Site map

Website Data Recovery | recuperación de Datos | Récupération de données | Datenrettung | Recupero dati | データ復旧 | 데이터 복구 | 数据恢复 | Восстановление данных | De terugwinning van gegevens | Ανάκτηση δεδομένων
Sitemap Site map1 2 3 4 | Spanish1 2 3 | French1 2 3 | German1 2 3 | Italian1 2 3 | Portuguese1 2 3 | Japanese1 2 3 | Korean1 2 3 | Chinese1 2 3 | Russian1 2 3 | Dutch1 2 3 | Greek1 2 3
Data Recovery Book English | Spanish | French | German | Italian | Portuguese | Japanese | Korean | Chinese | Russian | Dutch | Greek