nibblebits / PeachOS

Simple kernel designed for a online course
GNU General Public License v2.0
133 stars 55 forks source link

fat16.c - incorrect value for last cluster in file #22

Open howardthuang opened 1 year ago

howardthuang commented 1 year ago

https://github.com/nibblebits/PeachOS/blob/master/src/fs/fat/fat16.c#L411:

if (entry == 0xFF8 || entry == 0xFFF)

This line is checking if the cluster entry is the last cluster in a file. However, the value it is checking for is incorrect. The EOC (end of chain) mark for FAT16 should be 0xFFF8 - 0xFFFF.

nibblebits commented 1 year ago

Thank you for fileing the issue report