hi guys ..im asking for your help on solving this mind boggling problem ...
you know 2 or 3 month ago i wrote this piece of code in order to get the floppy disk geometry ...and it was as follows:
Code:
//In the name of GOD
#include <conio.h>
#include <stdio.h>
#include <process.h>
#include <dos.h>
#include <stdlib.h>
main(void){
int i,k,start,sector;
char x[512];
clrscr();
gotoxy(27,5);
textcolor(2);
cprintf("In the name of God\n");
gotoxy(22,7);
printf ("First project Project\n\n");
cprintf (" This program will show you the information stored on sector 0 of your Floppy disk.\n ");
printf(" if you are ready press any key to continue ");
for (k=0;k<=4;k++){
delay(500);
cprintf("."); }
getch();
sector =0;
if (absread (0, 1, sector, &x)!=0){
cprintf ("Error");
exit(1);
}
gotoxy(30,8);
cprintf("Read Successful!\n\n\n");
for (i=0;i<=512;i++)
cprintf("%c",x[i]);
getch();
return 0;
}
after that i see some irrelevant characters on screen ... i just went after it and found some progs and also information concerning FAT
and it was :
Code:
{
char jumpCode[3];//0 - 2 Assembly Instruction for jump code.
char oemName[8];//3 - 10 OEM Name.
char bytes_Sector[2];//*11 - 12 Bytes per sector.
char sec_Cluster;//13 Sector per cluster.
char size_Sector_Reserved[2];//14 - 15 Number of reserved sector(Boot Sector)
char fatCount;//16 Number of File Allocation Table
char Max_Root_Entry[2];//17 - 18 Maximum entries possible under root directory.
char Total_Sector_FS[2];//19 - 20 Total number of sectors in file system.
char Media_Type;//21 Media Type(According to Microsoft 0xf8 for fixed disk and 0xf0 for removable disk.
char sectors_per_fat[2];//22 - 23 Sectors allocated for each File allocation table.
char sectors_per_track[2];//24 - 25 Sectors per track.
char total_Head_Count[2];//26 - 27 Number of head in storage device.
char no_Sectors_Before_Part[4];//28 - 31 Number of sectors before start of partition(Not applicable for floppy).
char no_Sector_FS32[4];//32 - 35 Number of sectors in file system(32-bit value, not applicable for floppy).
char BIOS_13h_Drive_No;//36 BIOS INT13h drive number.
char reserved;//37 Not Used.
char ext_Boot_Part_Signature;//38 Extended boot signature.
char vol_Serial_Number[4];//39 - 42 Volume Serial Number.
char vol_Lebel_Name[11];//43 - 53 Volume label in ASCII.
char FS_Type[8];//54 - 61 File System Type.
char boot_Code[448];//62 - 509 Boot Code, otherwise contains information to replace disk.
char signature[2];//510 - 511 Signature for File System.
i just tried to use loops to save the data of the specific regions of the floppy disk on the screen for example i used:
Code:
for(j=0;j<=2;j++)
printf("Assembly instruction for jump code : %C",&x[j])
but again no luck !!
im really confused !!! how to deal with it in C?
(ive already noticed the VC++ equivalent but i have not worked on Vc++ ,so i dont know anything about that ...please tell me and help me on C .... tell me how i can do it under C
oh by the way i was using TC 3 ..thats why it looks ancient ..( im using Pelles C now ..but it seems it doesnt have some header files such as Dos.h ..so i just used TC )
many tanx in advand