extern void Log_Panic(char *Ident, char *Message, ...);
extern void Log_Error(char *Ident, char *Message, ...);
extern void Log_Warning(char *Ident, char *Message, ...);
-extern void Log_Log(char *Ident, char *Message, ...);
extern void Log_Notice(char *Ident, char *Message, ...);
+extern void Log_Log(char *Ident, char *Message, ...);
extern void Log_Debug(char *Ident, char *Message, ...);
// --- Debug ---
* Acess 2\r
* FAT12/16/32 Driver Version (Incl LFN)\r
*/\r
+/**\r
+ * \todo Implement changing of the parent directory when a file is written to\r
+ * \todo Implement file creation / deletion\r
+ */\r
#define DEBUG 0\r
#define VERBOSE 1\r
\r
-#define CACHE_FAT 1 //!< Caches the FAT in memory\r
-#define USE_LFN 1 //!< Enables the use of Long File Names\r
-\r
#include <acess.h>\r
#include <modules.h>\r
#include <vfs.h>\r
#include "fs_fat.h"\r
\r
+#define CACHE_FAT 1 //!< Caches the FAT in memory\r
+#define USE_LFN 1 //!< Enables the use of Long File Names\r
+\r
\r
// === TYPES ===\r
#if USE_LFN\r
//Open device and read boot sector\r
diskInfo->fileHandle = VFS_Open(Device, VFS_OPENFLAG_READ|VFS_OPENFLAG_WRITE);\r
if(diskInfo->fileHandle == -1) {\r
- Log_Warning("FAT", "Unable to open device '%s'", Device);\r
+ Log_Notice("FAT", "Unable to open device '%s'", Device);\r
return NULL;\r
}\r
\r
VFS_ReadAt(diskInfo->fileHandle, 0, 512, bs);\r
\r
if(bs->bps == 0 || bs->spc == 0) {\r
- Log_Warning("FAT", "Error in FAT Boot Sector\n");\r
+ Log_Notice("FAT", "Error in FAT Boot Sector\n");\r
return NULL;\r
}\r
\r
sSize = "GiB";\r
iSize >>= 20;\r
}\r
- Log_Log("FAT", "'%s' %s, %i %s", Device, sFatType, iSize, sSize);\r
+ Log_Notice("FAT", "'%s' %s, %i %s", Device, sFatType, iSize, sSize);\r
}\r
#endif\r
\r
}\r
\r
/*\r
- * === FILE IO ===\r
+ * ====================\r
+ * FAT Manipulation\r
+ * ====================\r
*/\r
/**\r
* \fn Uint32 FAT_int_GetFatValue(tFAT_VolInfo *Disk, Uint32 cluster)\r
#endif\r
}\r
\r
+/*\r
+ * ====================\r
+ * Cluster IO\r
+ * ====================\r
+ */\r
/**\r
* \brief Read a cluster\r
*/\r
LEAVE('-');\r
}\r
\r
+/* ====================\r
+ * File IO\r
+ * ====================\r
+ */\r
/**\r
* \fn Uint64 FAT_Read(tVFS_Node *node, Uint64 offset, Uint64 length, void *buffer)\r
* \brief Reads data from a specified file\r
return Length;\r
}\r
\r
+/* ====================\r
+ * File Names & Nodes\r
+ * ====================\r
+ */\r
/**\r
* \fn void FAT_int_ProperFilename(char *dest, char *src)\r
* \brief Converts a FAT directory entry name into a proper filename\r
}\r
#endif\r
\r
+/* ====================\r
+ * Directory IO\r
+ * ====================\r
+ */\r
/**\r
\fn char *FAT_ReadDir(tVFS_Node *Node, int ID)\r
\param Node Node structure of directory\r