diff options
author | Benji Dial <benji6283@gmail.com> | 2020-09-13 17:12:29 -0400 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2020-09-13 17:12:29 -0400 |
commit | 5481848e27fdd4fc859def9841a0283665531a46 (patch) | |
tree | 990a8df008214d85141a3bd10bd96898e64b0c37 /src/kernel/fat.c | |
parent | 1e4a254674f668839e5de273916024c16814b045 (diff) | |
download | portland-os-5481848e27fdd4fc859def9841a0283665531a46.tar.gz |
fixed some paging bugs, added fault handlers and new programs
Diffstat (limited to 'src/kernel/fat.c')
-rw-r--r-- | src/kernel/fat.c | 15 |
1 files changed, 11 insertions, 4 deletions
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 |