summaryrefslogtreecommitdiff
path: root/stage3/shell.c
diff options
context:
space:
mode:
authorKimapr <kimapr@mail.ru>2023-12-20 14:51:37 +0500
committerLizzy Fleckenstein <lizzy@vlhl.dev>2023-12-21 22:54:34 +0100
commit2834bff2cf6131202a788b59a5fd81994e1ed5aa (patch)
tree9a1ace6488e16d15af474cd027f2387c91ebbc12 /stage3/shell.c
parent43a856b5d40ceb570af7755d9f1222093a48aa64 (diff)
downloadcuddles-2834bff2cf6131202a788b59a5fd81994e1ed5aa.tar.xz
rtc clock driver
Diffstat (limited to 'stage3/shell.c')
-rw-r--r--stage3/shell.c47
1 files changed, 32 insertions, 15 deletions
diff --git a/stage3/shell.c b/stage3/shell.c
index 5b79e58..825723b 100644
--- a/stage3/shell.c
+++ b/stage3/shell.c
@@ -8,6 +8,9 @@
#include "memory.h"
#include "io.h"
#include "math.h"
+#include "clock.h"
+#include "pic.h"
+#include "thread.h"
static void cmd_echo(str arg)
{
@@ -301,27 +304,41 @@ static void cmd_watchdog(str arg)
print(S("\n"));
}
+static void cmd_clocktest(str arg)
+{
+ (void) arg;
+ while(1) {
+ print_num(clock_monotonic(), 10);
+ print(S(" "));
+ print_num(clock_monotonic_coarse(), 10);
+ //wait_irq();
+ yield(nil);
+ print(S("\r"));
+ }
+}
+
typedef struct {
str name;
void (*fn)(str arg);
} command;
static command registry[] = {
- { S("echo"), &cmd_echo },
- { S("cat"), &cmd_cat },
- { S("font"), &cmd_font },
- { S("fontdemo"), &cmd_fontdemo },
- { S("img"), &cmd_img },
- { S("lspci"), &cmd_lspci },
- { S("run"), &cmd_run },
- { S("loadkeys"), &cmd_loadkeys },
- { S("clear"), &cmd_clear },
- { S("love"), &cmd_love },
- { S("uname"), &cmd_uname },
- { S("ls"), &cmd_ls },
- { S("shutdown"), &cmd_shutdown },
- { S("cheese"), &cmd_cheese },
- { S("watchdog"), &cmd_watchdog },
+ { S("echo"), &cmd_echo },
+ { S("cat"), &cmd_cat },
+ { S("font"), &cmd_font },
+ { S("fontdemo"), &cmd_fontdemo },
+ { S("img"), &cmd_img },
+ { S("lspci"), &cmd_lspci },
+ { S("run"), &cmd_run },
+ { S("loadkeys"), &cmd_loadkeys },
+ { S("clear"), &cmd_clear },
+ { S("love"), &cmd_love },
+ { S("uname"), &cmd_uname },
+ { S("ls"), &cmd_ls },
+ { S("shutdown"), &cmd_shutdown },
+ { S("cheese"), &cmd_cheese },
+ { S("watchdog"), &cmd_watchdog },
+ { S("clocktest"), &cmd_clocktest },
};
void shell_run_cmd(str cmd)