aboutsummaryrefslogtreecommitdiff
path: root/os/commands
diff options
context:
space:
mode:
Diffstat (limited to 'os/commands')
-rw-r--r--os/commands/commands.h3
-rw-r--r--os/commands/echo.c2
-rw-r--r--os/commands/echo.h1
-rw-r--r--os/commands/files.c20
4 files changed, 24 insertions, 2 deletions
diff --git a/os/commands/commands.h b/os/commands/commands.h
new file mode 100644
index 0000000..6bc0e7d
--- /dev/null
+++ b/os/commands/commands.h
@@ -0,0 +1,3 @@
+void cmd_cf(char *args);
+void cmd_lf(char *args);
+void cmd_echo(char *args); \ No newline at end of file
diff --git a/os/commands/echo.c b/os/commands/echo.c
index 669003e..4a0bcd3 100644
--- a/os/commands/echo.c
+++ b/os/commands/echo.c
@@ -1,5 +1,5 @@
#include "../../kernel/gpu/text_mode/display.h"
-void echo(char *args) {
+void cmd_echo(char *args) {
scrn_println(args);
} \ No newline at end of file
diff --git a/os/commands/echo.h b/os/commands/echo.h
deleted file mode 100644
index db62a4f..0000000
--- a/os/commands/echo.h
+++ /dev/null
@@ -1 +0,0 @@
-void echo(char *args); \ No newline at end of file
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();
+}