aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2021-12-04 17:28:16 -0700
committerChristian Cunningham <cc@localhost>2021-12-04 17:28:16 -0700
commit709148a4252c6d608808d9ed1380b02e94173d1b (patch)
tree5da3abd1020476cf3964cc10691546ce059108a4 /src
parent1c6cd8e1ea53275cc44b2a0ee5a8448cbc4a3f0d (diff)
Moved timer to separate file
Diffstat (limited to 'src')
-rw-r--r--src/sys/core.c15
-rw-r--r--src/sys/core.h1
-rw-r--r--src/sys/timer.c17
-rw-r--r--src/sys/timer.h6
4 files changed, 25 insertions, 14 deletions
diff --git a/src/sys/core.c b/src/sys/core.c
index 0420df0..dd7a5e7 100644
--- a/src/sys/core.c
+++ b/src/sys/core.c
@@ -2,10 +2,11 @@
#include "../drivers/uart.h"
#include "../util/time.h"
#include "../sys/core.h"
+#include "../sys/timer.h"
#include "../sys/power.h"
static char* os_info_h = "\033[93mInitialized the Real Time Operating System\033[0m\n\033[96mName\033[0m: \033[94mDendritOS\033[0m\n\033[96mVersion\033[0m: \033[95m";
-static char* os_info_t = "\033[0m\n\nQEMU\n====\n Exit : Ctrl-A x\n Monitor : Ctrl-A c\n\n";
+static char* os_info_t = "\033[0m\n\nQEMU\n====\n Monitor : Ctrl-A c\n Timer : Ctrl-t\n Exit : Ctrl-A x\n\n";
#ifndef VERSION
static char* os_info_v = "?";
#else
@@ -42,18 +43,6 @@ void sysinit() {
enable_cntv();
}
-void c_timer() {
- // Reset the counter
- write_cntv_tval(cntfrq);
-
- // Output the value
- uart_string((char*)"Timer Value: ");
- unsigned long v = read_cntv_tval();
- uart_10(v);
- uart_char(0x20);
- uart_hexn(v);
-}
-
// Checks IRQ status
void chk_irq_stat() {
uart_string((char*)"Checking Enabled Services...\n");
diff --git a/src/sys/core.h b/src/sys/core.h
index d2b4c1b..517b090 100644
--- a/src/sys/core.h
+++ b/src/sys/core.h
@@ -114,7 +114,6 @@ enum
};
void sysinit();
-void c_timer();
void chk_irq_stat();
void postinit();
diff --git a/src/sys/timer.c b/src/sys/timer.c
new file mode 100644
index 0000000..6996983
--- /dev/null
+++ b/src/sys/timer.c
@@ -0,0 +1,17 @@
+#include "../sys/core.h"
+#include "../sys/timer.h"
+#include "../util/time.h"
+#include "../drivers/uart.a.h"
+#include "../drivers/uart.h"
+
+void c_timer() {
+ // Reset the counter
+ write_cntv_tval(cntfrq);
+
+ // Output the value
+ uart_string((char*)"Timer Value: ");
+ unsigned long v = read_cntv_tval();
+ uart_10(v);
+ uart_char(0x20);
+ uart_hexn(v);
+}
diff --git a/src/sys/timer.h b/src/sys/timer.h
new file mode 100644
index 0000000..641a581
--- /dev/null
+++ b/src/sys/timer.h
@@ -0,0 +1,6 @@
+#ifndef SYS_TIMER_H
+#define SYS_TIMER_H
+
+void c_timer();
+
+#endif