I am trying to fix a bug in a program when its reading another program from disk. For the most part, it works without error. However, it only works if both programs are one of the first programs copied to disk. If they are not, the loading program crashes while trying to read (for an unknown reason) passed track 79:
Code: Select all
00073027725p[FDD ] >>PANIC<< io: norm r/w parms out of range: sec#10h cyl#50h eot#00h head#00h
Code: Select all
fsys_fat::read curCluster: 799 physSector: 830
drive::rawread: sector 830 geometry: sectorsPerTrack 18 heads 2 totalSectors: 1422 tracks: 79
reading head 1 track 23 sector 3 on drive 0
fsys_fat::read curCluster: 1543 physSector: 1574
drive::rawread: sector 1574 geometry: sectorsPerTrack 18 heads 2 totalSectors: 1422 tracks: 79
reading head 1 track 43 sector 9 on drive 0
fsys_fat::read curCluster: 2864 physSector: 2895
drive::rawread: sector 2895 geometry: sectorsPerTrack 18 heads 2 totalSectors: 1422 tracks: 79
reading head 0 track 80 sector 16 on drive 0
<< crashes here >>
The last sector is where it crashes at with the above error from bochs. curCluster is the interesting one though. This value has been taken from the FAT (FAT12 filesystem) so I wonder how it can be so high? It seems to be pointing to an invalid sector.
I am not quite sure what is going on here...How can the value read from the FAT be wrong? And only in certain cases (Please see first paragraph for details.)? What else can be causing something like this to happen?
Any help is greatly appreciated