Int86x function readabsolutesectors writeabsolutesectors

Files Recovery Software
Home Contact Details Customer Support Download Demo Products  

 
 

The int86x(0x13, &i, &o, &s) function invokes the interrupt 13H with segment register Values. The getdrivegeometry function returns the total number on drive.

  • In the main() function, (char)peekb(0x0040, 0x0075); (the function peekb is Defined in DOS.H) returns the number of hard disks attached to the system.

The number of hard disks connected to the system is represented by the byte stored at memory location 0040H:0075H (Segment 0040H: Offset 0075H). If the number of hard disks connected to the system is less then two program shows the error message and exits.

Sectors_in_HDD1 = getdrivegeometry (0x80); gets the parameters of first hard disk (0x80) and returns the total number of sectors on first hard disk.

Similarly Sectors_in_HDD2 = getdrivegeometry (0x81); gets the parameters of second hard disk (0x81) and returns the total number of sectors on second hard disk.

After confirmation by the user to continue with imaging, first check the condition that the size of source hard disk should not be greater then the size of the destination hard disk. If the destination is smaller, Display the error message and exit.

If everything is going right, copy the sectors of the source disk to the destination disk. Here we are reading and writing 61440 Bytes (120 sectors with each of 512 Bytes) at a time to make the imaging process faster.

If you want to use more sectors at a time, even beyond the limit of 64K, you can do it by using “huge Pointer” in large memory model. The Example of Specification is as follows:

char huge array[100000L];

  • The Function, readabsolutesectors ( 0x80, loop, 120, buffer ); reads the 120 sectors of first hard disk (0x80), starting from the sector number specified by unsigned long integer loop and store the data in data buffer.
  • The Function, writeabsolutesectors ( 0x81, loop, 120, buffer ); writes the data of data buffer to 120 sectors of second hard disk(0x81), starting from the sector number specified by unsigned long integer loop.
Previous page

page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19

Next page
 
 
Data Recovery Book
 
Chapter 1 An Overview of Data Recovery
Chapter 2 Introduction of Hard Disks
Chapter 3 Logical Approach to Disks and OS
Chapter 4 Number Systems
Chapter 5 Introduction of C Programming
Chapter 6 Introduction to Computer Basics
Chapter 7 Necessary DOS Commands
Chapter 8 Disk-BIOS Functions and Interrupts Handling With C
Chapter 9 Handling Large Hard Disks
Chapter 10 Data Recovery From Corrupted Floppy
Chapter 11 Making Backups
Chapter 12 Reading and Modifying MBR with Programming
Chapter 13 Reading and Modifying DBR with Programming
Chapter 14 Programming for “Raw File” Recovery
Chapter 15 Programming for Data Wipers
Chapter 16 Developing more Utilities for Disks
Appendix Glossary of Data Recovery Terms
 
 
Pro Data Doctor

Home

Products

Contact Details

Customer Support

Download Demo

Terms and Conditions

 
Pro Data Doctor