+#ifdef __linux__
+#include <stdio.h>
+typedef FILE *FIL;
+typedef uint8_t FRESULT;
+typedef unsigned UINT;
+enum { FR_OK = 0 };
+
+void f_close(FIL *fd) { fclose(*fd); *fd = NULL; }
+FRESULT f_lseek(FIL *fd, unsigned pos) { return fseek(*fd, pos, SEEK_SET); }
+FRESULT f_read(FIL *fd, unsigned char *buffer, size_t buflen, UINT *bytes) {
+ *bytes = fread(buffer, 1, buflen, *fd);
+ return *bytes == 0;
+}
+
+#else