aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-11-01 17:43:33 +0200
committeraqua <aqua@iserlohn-fortress.net>2022-11-01 17:43:33 +0200
commit247fb5a8476aa66fdc6d4f042b0a743fe7c3ab2b (patch)
treec719f192e3352363652a33544f4ab7167509d3c8 /src
parentmakefile: add Makefile.config (diff)
downloadkernel-247fb5a8476aa66fdc6d4f042b0a743fe7c3ab2b.tar.xz
Add uppercase scancodes
Make text mode screen scroll
Diffstat (limited to 'src')
-rw-r--r--src/kernel.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/kernel.c b/src/kernel.c
index 41025d7..6b3df3f 100644
--- a/src/kernel.c
+++ b/src/kernel.c
@@ -6,35 +6,31 @@
#include "mem.h"
#include <stdio.h>
-#include "devices/pic.h"
#include "devices/uart_16550.h"
#include "devices/vga.h"
#include <conf.h>
#include <sys/cpuid.h>
void kmain() {
+ vga_init(vmm_map(0xb8000, 0xc03ff000));
if (uart_init(COM1) != 0) printf("UART self-test failed.\r\n");
printf("glitch [version " VERSION "] [" CC "]\n");
- char vendor[13] = {'\0'};
- unsigned int eax;
- __get_cpuid(0, &eax, (unsigned int *)vendor, (unsigned int *)(vendor + 8), (unsigned int *)(vendor + 4));
- struct CPUVersion v;
- __get_cpuid(1, (unsigned int *)&v, &eax, &eax, &eax);
- printf("CPU: %s family %u model %u stepping %u\n", vendor, family(v), model(v), v.stepping);
-
- printf("hello %s world\n", "kernel");
- printf("Hello %c\n", 'C');
- printf("we are number %d\n", 1);
- printf("a negative %d as hex %x\n", -1, -1);
- printf("hex 255=0x%x\n", 255);
-
- vga_init(vmm_map(0xb8000, 0xc03ff000));
-
- alloc4M();
- char *c = (char *)0xc0700000;
- if (*c == 0) printf("c is 0\r\n");
+ {
+ char vendor[13] = {'\0'};
+ unsigned int eax;
+ __get_cpuid(0, &eax, (unsigned int *)vendor, (unsigned int *)(vendor + 8), (unsigned int *)(vendor + 4));
+ struct CPUVersion v;
+ __get_cpuid(1, (unsigned int *)&v, &eax, &eax, &eax);
+ printf("CPU: %s family %u model %u stepping %u\n", vendor, family(v), model(v), v.stepping);
+ }
+
+ /*
+ alloc4M();
+ char *c = (char *)0xc0700000;
+ if (*c == 0) printf("c is 0\r\n");
+ */
// asm volatile("int $0x80");