fs: implement FAT32 LFN support and root volume abstraction

This commit is contained in:
boreddevnl
2026-05-08 21:02:14 +02:00
parent b04bde3d9e
commit 3e26332b1a
7 changed files with 443 additions and 279 deletions

View File

@@ -3,6 +3,7 @@
// This header needs to maintain in any file it is present in, as per the GPL license terms.
#include "tar.h"
#include "fat32.h"
#include "bootfs.h"
// The standard TAR header block is 512 bytes.
struct tar_header {
@@ -111,8 +112,12 @@ void tar_parse(void *archive, uint64_t archive_size) {
parent_path[last_slash] = '\0';
tar_mkdir_recursive(parent_path);
}
if (full_path[0] == '/' && full_path[1] == 'b' && full_path[2] == 'o' &&
full_path[3] == 'o' && full_path[4] == 't' && full_path[5] == '/') {
bootfs_register_file(full_path + 6, ptr + 512, (uint32_t)file_size);
}
// Extract the file data block directly into the VFS
FAT32_FileHandle *fh = fat32_open(full_path, "w");
if (fh && fh->valid) {
fat32_write(fh, ptr + 512, file_size);