Thread: FAT creation
View Single Post
Old Dec 6th, 2005, 5:34 AM   #11
BungalowBill
Programmer
 
Join Date: Dec 2005
Posts: 40
Rep Power: 0 BungalowBill is on a distinguished road
Its cool, we all need help.

So whats the code for doing this?. If i wanted to set up the FAT. This is what i go so far.

void format(){

int j;
for(j=4; j<512; j++){
disk[1].FATdata[j] = unused;
}
int i;
for(i=0;i<512; i++){
disk[2].FATdata[i] = unused;
}

disk[1].Datablock[0] = data;
disk[1].FATblock[1] = FATdata;
disk[1].FATdata[2] = FATdata;
disk[1].Dirblock[3] = dirdata;
disk[1].Datablock[79] = data;
}

I have data, FATdata, and dirdata declared in a separate header file like this:-
typedef union Tdiskblock Diskblock;
union Tdiskblock{
Datablock data;
Dirblock dirdata;
FATblock FATdata;
};

but when i compile its saying that data, FATdata, and dirdata are not defined. BTW that 79 thing is just something extra i forgot to take out. Its saying that Datablock,Dirblock and FATblock are not members of Tdiskblock, but it looks like they are to me.
If you haven't guessed, im a complete newbie with this so don't be too harsh.


thanks

Last edited by BungalowBill; Dec 6th, 2005 at 5:49 AM.
BungalowBill is offline   Reply With Quote