aboutsummaryrefslogtreecommitdiff
path: root/os/commands/files.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/commands/files.c')
-rw-r--r--os/commands/files.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/os/commands/files.c b/os/commands/files.c
new file mode 100644
index 0000000..6f23e34
--- /dev/null
+++ b/os/commands/files.c
@@ -0,0 +1,20 @@
+#include "../../kernel/gpu/text_mode/display.h"
+#include "../filesystem/ramfs.h"
+
+void cmd_cf(char *args) {
+ // todo check args, filname length etc
+ ramfs_create_file(args);
+ scrn_print("created file: ");
+ scrn_println(args);
+}
+
+void cmd_lf(char *args) {
+ scrn_println("files:");
+ File_t* files = ramfs_list_files();
+
+ for(int i = 0; i <= ramfs_get_tip_file_idx(); i++) {
+ scrn_print(files[i].name);
+ scrn_print(" ");
+ }
+ scrn_newline();
+}