absread and abswrite Functions read/write operation on the entire disk The absread function reads absolute disk sectors and the abswrite function writes absolute disk sectors

Files Recovery Software
Home Contact Details Customer Support Download Demo Products  

 
 

absread and abswrite Functions

These Functions have been defined in Dos.h. The absread function reads absolute disk sectors and the abswrite function writes absolute disk sectors. The function absread uses DOS interrupt 0x25 to read specific disk sectors and the function abswrite uses DOS interrupt 0x26 to write specific disk sectors.

Absolute read or write operations proceeds in sequential manner by incrementing sector(s) step by step and are completely free of the head and track numbers etc. it is the job of BIOS of the computer to translate the absolute sectors to the respective track, Head and Sector numbers.

Absolute read and write operations are recommended in such programs where we are going to perform read/write operation on the entire disk and we want to avoid extra coding and looping in our program to increase the speed of the program to fastest.

Both of the functions absread and abswrite, ignore the logical structure of a disk and pay no attention to files, FATs, or directories. These functions directly perform absolute read and absolute write operation on the surface of the disk, This is the reason that if used improperly, abswrite can overwrite files, directories, and FATs.

The declaration of the absread function is as follows:

int absread(int drive, int nsects, long lsect,
void *buffer);

and the abswrite function is declared as follows:

int abswrite(int drive, int nsects, long lsect,
void *buffer);

Where the meaning of parameters is as follows:

Param.

What It Is/Does

drive

Drive number to read (or write): 0 = A, 1 = B, etc.

nsects

Number of sectors to read (or write)

lsect

Beginning logical sector number

buffer

Memory address where the data is to be read (or written)

On success, both of the functions return 0. When there is any error, both return -1 and set error no. to the value of the AX register returned by the system call.

The number of sectors for read or write operation is limited to 64K or the size of the buffer, whichever is smaller. However we will learn the use of Huge memory in next chapters to exceed out of the memory limit 64K, to develop a very fast program.


Previous page

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


page 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38

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