| Description
This example uses the
biosdisk() function which provides
bios disk services , in this case
we are running the disk diagnostics
command .
Code
#include <stdio.h>
#include <dos.h>
#include <stdlib.h>
#include <bios.h>
int main(void)
{
int status;
int command = 19;
int drive = 0;
int head = 0;
int track = 1;
int sector = 1;
int nosectors = 1;
char buffer[512];
clrscr();
status =
biosdisk(command,drive,head,track,sector,nosectors,buffer);
if(status == 0)
printf("Diagnostics.\n");
else
printf("Unable to run diagnostics.\n");
return 0;
}
Information
|