#include "fat12.h"
#include "disk_io.h"
#include "print.h"

void fs_mount() {
    // Load FAT12 boot sector
    fat12_boot_sector_t boot_sector;
    disk_read(0, &boot_sector, sizeof(boot_sector));


    // Initialize FAT12
    fat12_init();

}

void fs_read_file(const char *filename) {

    // Find file in FAT12 root directory and read its contents
    fat12_dir_entry_t dir_entry;

    fat12_find_file(filename, &dir_entry);

    // Read file data
    uint8_t buffer[dir_entry.file_size];
    fat12_read_file(&dir_entry, buffer);

    // Print or process the data
    printf(buffer);


}
