aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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");