From 247fb5a8476aa66fdc6d4f042b0a743fe7c3ab2b Mon Sep 17 00:00:00 2001 From: aqua Date: Tue, 1 Nov 2022 17:43:33 +0200 Subject: Add uppercase scancodes Make text mode screen scroll --- src/kernel.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'src') 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 -#include "devices/pic.h" #include "devices/uart_16550.h" #include "devices/vga.h" #include #include 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"); -- cgit v1.2.1