aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-06-01 23:51:05 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-06-01 23:51:05 +0100
commit74daa7b891486fdd92cce0c67d076e29b93aeb1c (patch)
tree97ce20fb058a798c0d6c48250301fd56f6d9eba5 /src/main.c
parentafc7ea1e4f667c16100677a3fe6d9b27278a8635 (diff)
downloadgold-mine-run-74daa7b891486fdd92cce0c67d076e29b93aeb1c.tar.gz
gold-mine-run-74daa7b891486fdd92cce0c67d076e29b93aeb1c.zip
Add timer to count ticks
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 2b01d3f..d83c18b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2,14 +2,22 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <crt0.h>
#include <conio.h>
-#include "data.h"
+#include "timer.h"
#include "vga.h"
+#include "data.h"
+
+/* disable paging because our int handlers are written in C */
+int _crt0_startup_flags = _CRT0_FLAG_LOCK_MEMORY;
int main(int argc, char *argv[])
{
+ timer_init();
+ atexit(timer_free);
+
/* set VGA 320x200, 256 col */
set_mode(0x13);
@@ -36,5 +44,7 @@ int main(int argc, char *argv[])
set_mode(3);
close_framebuffer();
+ printf("tick is %li\n", ticks);
+
return 0;
}