- Status Closed
- Percent Complete
- Task Type Bugs
- Category
- Assigned To No-one
- Operating System
- Severity Low
- Priority Very Low
- Reported Version
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#55 - FAT start address
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.
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
This is not a bug.
'startsector' is used in the cache_fat_sector() function, so
it should not be added to 'thisfatsecnum'. Only if you
disable caching will you need to change this code.