Rockbox mail archive
Subject: [ rockbox-Bugs-569620 ] FAT start address
From: noreply_at_sourceforge.net
Date: 2002-06-16
Bugs item #569620, was opened at 2002-06-16 06:12
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=439118&aid=569620&group_id=44306
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: FAT start address
Initial Comment:
Hello!
I have been snooping around your code to look at the
reusability it, and found one error in the FAT calulation.
The FAT start sector was not included in these
calculations.
In my case, the FAT looked corrupt.
The first cluster could be read(since the fileentry
contains the location of the first sector), but as soon as
the next cluster had checked inside the FAT, it failed.
By making the below adjustment, I could get it running:
fat.c:
static int read_entry(int entry)
{
unsigned long *sec;
int fatoffset;
int thisfatsecnum;
int thisfatentoffset;
int val = -1;
fatoffset = entry * 4;
// OLD
*/
thisfatsecnum = fatoffset / fat_bpb.bpb_bytspersec +
fat_bpb.bpb_rsvdseccnt;
*/
// NEW
thisfatsecnum = (fatoffset / fat_bpb.bpb_bytspersec) +
fat_bpb.bpb_rsvdseccnt + fat_bpb.startsector ;
// END
thisfatentoffset = fatoffset % fat_bpb.bpb_bytspersec;
/* Load the sector if it is not cached */
sec = cache_fat_sector(thisfatsecnum);
if(!sec)
{
DEBUGF( "read_entry() - Could not cache sector %
d\n",
thisfatsecnum);
return -1;
}
val = sec[thisfatentoffset/sizeof(int)];
val = SWAB32(val);
return val;
}
I disabled the FAT caching for me to get all this running.
Well, thats my contribution. Great project you are doing!
Mike.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=439118&aid=569620&group_id=44306
Page was last modified "Jan 10 2012" The Rockbox Crew
|