From 5481848e27fdd4fc859def9841a0283665531a46 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 13 Sep 2020 17:12:29 -0400 Subject: fixed some paging bugs, added fault handlers and new programs --- src/kernel/fat.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/kernel/fat.c') diff --git a/src/kernel/fat.c b/src/kernel/fat.c index c297cab..c4461de 100644 --- a/src/kernel/fat.c +++ b/src/kernel/fat.c @@ -119,10 +119,17 @@ static const uint8_t this_dir[] = {'.', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' static const uint8_t parent_dir[] = {'.', '.', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}; static inline bool check_fat_names(const uint8_t *a, const uint8_t *b) { - return (((uint32_t *)a)[0] == ((uint32_t *)b)[0]) && - (((uint32_t *)a)[1] == ((uint32_t *)b)[1]) && - (((uint16_t *)a)[4] == ((uint16_t *)b)[4]) && - (((uint8_t *)a)[10] == ((uint8_t *)b)[10]); + for (uint8_t i = 0; i < 11; ++i) { + uint8_t ac = a[i]; + uint8_t bc = b[i]; + if ((ac >= 0x61) && (ac <= 0x7a)) + ac &= ~0x20; + if ((bc >= 0x61) && (bc <= 0x7a)) + bc &= ~0x20; + if (ac != bc) + return false; + } + return true; } //after: cur_dir -> specified entry in root -- cgit v1.2.3