Allow finding files in the root directory

This allows you to find the cluster number of a file in the root
directory by name. The main program is a simple demo where you can type
in a filename and it will tell you the cluster number.
This commit is contained in:
Byron Lathi
2022-04-17 18:12:13 -05:00
parent edd13e9b71
commit 52f631e558
3 changed files with 193 additions and 28 deletions

View File

@@ -1,6 +1,7 @@
#include <stdint.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
#include "devices/board_io.h"
#include "devices/uart.h"
@@ -14,6 +15,7 @@ uint8_t buf[512];
int main() {
int i;
uint16_t rca;
char* filename;
clrscr();
cprintf("Hello, world!\n");
@@ -34,7 +36,17 @@ int main() {
sd_select_card(rca);
fat_init();
exec("/test.o65");
filename = (char*)malloc(FAT_MAX_FILE_NAME);
for(;;) {
cprintf("Filename: ");
cscanf("%s", filename);
cprintf("\n");
fat_parse_path_to_cluster(filename);
}
//exec("/test.o65");
cprintf("Done!\n");