From 3973bfdf7936f4574aa28a97b7343319aa344bc3 Mon Sep 17 00:00:00 2001 From: aqua Date: Sun, 17 Jul 2022 23:04:47 +0300 Subject: Print version, compiler id and version, and cpuid on boot --- src/kernel.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/kernel.c') diff --git a/src/kernel.c b/src/kernel.c index ffa8814..b9a6bdf 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -8,6 +8,9 @@ #include "devices/uart_16550.h" #include "devices/vga.h" +#include +#include + void kmain() { pic_init(); @@ -16,6 +19,15 @@ void kmain() { 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("we are number %d\n", 1); printf("a negative %d as hex %x\n", -1, -1); -- cgit v1.2.1