nibblebits / PeachOS

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

Bug in fat16_get_first_cluster #29

Open gierens opened 9 months ago

gierens commented 9 months ago

Correct me if I'm wrong but we are just ORing the high and low bits here: https://github.com/nibblebits/PeachOS/blob/9518f7a15134c31d66a4efe5a67a8ffba67edf50/src/fs/fat/fat16.c#L355-L358

Shouldn't we shift the high bits like so:

return (item->high_16_bits_first_cluster << 16) | item->low_16_bits_first_cluster;
nibblebits commented 9 months ago

Yes you are correct, this function by the end of the course does not get used anymore, it will be removed in a future lecture entirely

nibblebits commented 9 months ago

Thanks for mentioning the issue