aboutsummaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2021-12-23 18:47:21 -0800
committerChristian Cunningham <cc@localhost>2021-12-23 18:47:21 -0800
commite8b09e02a8326e9d75cab97dfef4ab17ad1d6c1e (patch)
tree73df4e9a9893929784cb7f99cade1461da3f326c /src/sys
parent599af82d6d264c84118cd9407dd03323f0a1cb38 (diff)
Larger Font
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/core.c29
-rw-r--r--src/sys/timer.c21
2 files changed, 28 insertions, 22 deletions
diff --git a/src/sys/core.c b/src/sys/core.c
index 929c7a5..ed88570 100644
--- a/src/sys/core.c
+++ b/src/sys/core.c
@@ -85,19 +85,19 @@ void output_irq_status(void) {
}
// Check TIMER IRQ
- write_string(&g_Drawer, "\nTIMER: ");
+ write_string(&g_Drawer, " TIMER: ");
if (ib_val & (1<<0)) {
write_cstring(&g_Drawer, "Enabled", 0x00FF00);
- // Output the frequency
- write_string(&g_Drawer, " @ ");
- unsigned long frq = read_cntfrq()/1000;
- write_10(&g_Drawer, frq);
- write_string(&g_Drawer, " kHz");
} else {
write_cstring(&g_Drawer, "Disabled", 0xFF0000);
}
write_string(&g_Drawer, "\nTIMER: ");
- write_cstring(&g_Drawer, "Enabled", 0x00FF00);
+ write_cstring(&g_Drawer, "Enabled ", 0x00FF00);
+ // Output the frequency
+ write_string(&g_Drawer, " @ ");
+ unsigned long frq = read_cntfrq()/1000;
+ write_10(&g_Drawer, frq);
+ write_string(&g_Drawer, " kHz");
}
void postinit() {
@@ -111,19 +111,12 @@ void postinit() {
release_mutex(&exe_cnt_m, SYS_PID);
}
// Commands
- write_string(&g_Drawer, "\nMonitor Ctrl-A m Exit: Ctrl-A x");
- write_string(&g_Drawer, "\nTimer: Ctrl-T");
+ write_string(&g_Drawer, "\nMonitor: Ctrl-A m Exit: Ctrl-A x Timer: Ctrl-T");
// GPU IRQ Statuses
write_string(&g_Drawer, "\n");
output_irq_status();
- write_string(&g_Drawer, "\n> ");
-
- unsigned int x = g_Drawer.x;
- unsigned int y = g_Drawer.y;
- g_Drawer.x = 0;
- g_Drawer.y = 12;
- write_string(&g_Drawer, "VIDEO: ");
+ write_string(&g_Drawer, "\nVIDEO: ");
write_cstring(&g_Drawer, "Enabled ", 0x00FF00);
write_10(&g_Drawer, width);
write_string(&g_Drawer, "x");
@@ -133,6 +126,6 @@ void postinit() {
} else {
write_string(&g_Drawer, " BGR");
}
- g_Drawer.x = x;
- g_Drawer.y = y;
+
+ write_string(&g_Drawer, "\n> ");
}
diff --git a/src/sys/timer.c b/src/sys/timer.c
index b82ac2c..aa50bd3 100644
--- a/src/sys/timer.c
+++ b/src/sys/timer.c
@@ -13,7 +13,7 @@ struct Mutex exe_cnt_m = {.addr = &exe_cnt, .pid = NULL_PID};
void c_timer() {
// Reset the counter
- write_cntv_tval(cntfrq);
+ write_cntv_tval(cntfrq/100);
unsigned int x = g_Drawer.x;
unsigned int y = g_Drawer.y;
@@ -31,15 +31,28 @@ void c_timer() {
release_mutex(&exe_cnt_m, SCHED_PID);
}
- g_Drawer.x = 0;
- g_Drawer.y = 10;
+ g_Drawer.x = 29;
+ g_Drawer.y = 5;
// Output the value
- write_string(&g_Drawer, "Timer Value: ");
unsigned long v = read_cntv_tval();
write_10(&g_Drawer, v);
write_string(&g_Drawer, " | ");
write_hex32(&g_Drawer, v);
+ g_Drawer.x = 0;
+ g_Drawer.y = 9;
+ for(int i = 0; i < 128; i++)
+ write_char(&g_Drawer, ' ');
+ g_Drawer.x = 0;
+ g_Drawer.y = 9;
+ write_string(&g_Drawer, "Timer Counter: ");
+ if (exe_cnt_m.pid == 0) {
+ write_cstring(&g_Drawer, "Free!", 0xFF00FF);
+ } else {
+ write_cstring(&g_Drawer, "Locked by ", 0xFF00FF);
+ write_c10(&g_Drawer, exe_cnt_m.pid, 0xFF00FF);
+ }
+
g_Drawer.x = x;
g_Drawer.y = y;
}