Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in fat16_get_first_cluster #29

Open
gierens opened this issue Nov 16, 2023 · 2 comments
Open

Bug in fat16_get_first_cluster #29

gierens opened this issue Nov 16, 2023 · 2 comments

Comments

@gierens
Copy link

gierens commented Nov 16, 2023

Correct me if I'm wrong but we are just ORing the high and low bits here:

PeachOS/src/fs/fat/fat16.c

Lines 355 to 358 in 9518f7a

static uint32_t fat16_get_first_cluster(struct fat_directory_item *item)
{
return (item->high_16_bits_first_cluster) | item->low_16_bits_first_cluster;
};

Shouldn't we shift the high bits like so:

return (item->high_16_bits_first_cluster << 16) | item->low_16_bits_first_cluster;
@nibblebits
Copy link
Owner

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
Copy link
Owner

Thanks for mentioning the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants