diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-06-01 23:51:05 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-06-01 23:51:05 +0100 |
commit | 74daa7b891486fdd92cce0c67d076e29b93aeb1c (patch) | |
tree | 97ce20fb058a798c0d6c48250301fd56f6d9eba5 /src/main.c | |
parent | afc7ea1e4f667c16100677a3fe6d9b27278a8635 (diff) | |
download | gold-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.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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; } |