+
+/*
+ * command table for fat subcommands
+ */
+
+cmd_tbl_t cmd_tbl_fat[] = {
+CMD_TBL_ITEM(
+ status, 2, CTBL_RPT, do_stat,
+ "Show logical drive status",
+ "dev"
+),
+CMD_TBL_ITEM(
+ pwd, 2, CTBL_RPT|CTBL_SUBCMDAUTO, do_pwd,
+ "Print name of current/working directory",
+ ""
+),
+CMD_TBL_ITEM(
+ cd, 2, 0|CTBL_SUBCMDAUTO, do_cd,
+ "Change the current/working directory.",
+ "path"
+),
+CMD_TBL_ITEM(
+ ls, 2, CTBL_RPT|CTBL_SUBCMDAUTO, do_ls,
+ "Directory listing",
+ "path"
+),
+CMD_TBL_ITEM(
+ load, 5, 0, do_rw,
+ "load binary file from a dos filesystem",
+ "<d:/path/filename> <addr> [bytes [pos]]\n"
+ " - Load binary file 'path/filename' on logical drive 'd'\n"
+ " to address 'addr' from dos filesystem.\n"
+ " 'pos' gives the file position to start loading from.\n"
+ " If 'pos' is omitted, 0 is used. 'pos' requires 'bytes'.\n"
+ " 'bytes' gives the size to load. If 'bytes' is 0 or omitted,\n"
+ " the load stops on end of file."
+),
+CMD_TBL_ITEM(
+ write, 4, 0, do_rw,
+ "write file into a dos filesystem",
+ "<d:/path/filename> <addr> <bytes>\n"
+ " - Write file to 'path/filename' on logical drive 'd' from RAM\n"
+ " starting at address 'addr'.\n"
+),
+
+CMD_TBL_ITEM(
+ help, CONFIG_SYS_MAXARGS, CTBL_RPT, do_help,
+ "Print sub command description/usage",
+ "\n"
+ " - print brief description of all sub commands\n"
+ "fat help command ...\n"
+ " - print detailed usage of sub cmd 'command'"
+),
+
+/* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */
+ {FSTR("?"), CONFIG_SYS_MAXARGS, 1, do_help,
+ NULL,
+#ifdef CONFIG_SYS_LONGHELP
+ FSTR(""),
+#endif /* CONFIG_SYS_LONGHELP */
+ NULL,
+#ifdef CONFIG_AUTO_COMPLETE
+ NULL,
+#endif
+},
+/* Mark end of table */
+CMD_TBL_END(cmd_tbl_fat)
+};
+
+
+command_ret_t do_fat(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc UNUSED, char * const argv[] UNUSED)
+{
+ puts_P(PSTR("Huch?"));
+
+ return CMD_RET_USAGE;
+}