diff --git a/fs/fat32.c b/fs/fat32.c index a9a4d5e..647a99b 100644 --- a/fs/fat32.c +++ b/fs/fat32.c @@ -55,3 +55,14 @@ free_ret: kfree(ret); return NULL; } + +void fat_print_root(struct fat32_fs *fs) +{ + for(int i = 0; i < fs->bpb.root_entries; i++) { + struct fat32_dirent *entry = &fs->root; + if (entry->name[0] == 0) + continue; + + kprintf(LOG_WARN "%s\n", entry->name); + } +} diff --git a/fs/gpt.c b/fs/gpt.c index c895336..9259bd9 100644 --- a/fs/gpt.c +++ b/fs/gpt.c @@ -53,7 +53,8 @@ void block_gpt_init(struct block_device *dev) part->lba_start = entries[i].lba_first; part->num_blocks = entries[i].lba_last - entries[i].lba_first + 1; - fat_init_part(part); + struct fat32_fs *fs = fat_init_part(part); + fat_print_root(fs); } dev->partition_count = used_count; diff --git a/include/fs/fat32.h b/include/fs/fat32.h index ef79849..8ede55f 100644 --- a/include/fs/fat32.h +++ b/include/fs/fat32.h @@ -76,4 +76,7 @@ struct fat32_fs { struct fat32_dirent root; }; +struct fat32_fs *fat_init_part(struct block_part *part); +void fat_print_root(struct fat32_fs *fs); + #endif /* _FAT32_H_ */