aboutsummaryrefslogtreecommitdiff
path: root/os/commands/files.c
diff options
context:
space:
mode:
authorJames Barnett <noreply@jamesbarnett.xyz>2019-10-06 18:39:36 +0100
committerJames Barnett <noreply@jamesbarnett.xyz>2019-10-06 18:39:36 +0100
commit29478baf24532391cd94bd08d94cf867dee976e6 (patch)
tree3127ae32572cd262c7283c6223b6e5712a07f91d /os/commands/files.c
parente77b371fb0fc4e62fa727a340b2e322fa60ebcff (diff)
downloadtinyOS-master.tar.xz
tinyOS-master.zip
Start on ram backed filesystemHEADmaster
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();
+}