diff options
| author | James Barnett <noreply@jamesbarnett.xyz> | 2019-10-06 18:39:36 +0100 |
|---|---|---|
| committer | James Barnett <noreply@jamesbarnett.xyz> | 2019-10-06 18:39:36 +0100 |
| commit | 29478baf24532391cd94bd08d94cf867dee976e6 (patch) | |
| tree | 3127ae32572cd262c7283c6223b6e5712a07f91d /os/commands | |
| parent | e77b371fb0fc4e62fa727a340b2e322fa60ebcff (diff) | |
| download | tinyOS-master.tar.xz tinyOS-master.zip | |
Diffstat (limited to 'os/commands')
| -rw-r--r-- | os/commands/commands.h | 3 | ||||
| -rw-r--r-- | os/commands/echo.c | 2 | ||||
| -rw-r--r-- | os/commands/echo.h | 1 | ||||
| -rw-r--r-- | os/commands/files.c | 20 |
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(); +} |