aboutsummaryrefslogtreecommitdiff
path: root/src/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel.c')
-rw-r--r--src/kernel.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/kernel.c b/src/kernel.c
index 2777f72..a315f3b 100644
--- a/src/kernel.c
+++ b/src/kernel.c
@@ -15,11 +15,16 @@
#include <stdio.h>
#include <sys/cpuid.h>
+FILE *stdin;
+FILE *stdout;
+FILE *stderr;
+
void kmain() {
- vga_init(vmm_map(0xb8000, 0xc03ff000));
- if (uart_init(COM1) != 0) printf("UART self-test failed.\r\n");
+ stderr = uart_init(COM1);
+ stdout = vga_init(vmm_map(0xb8000, 0xc03ff000));
printf("glitch [version " VERSION "] [" CC "]\n");
+ fprintf(stderr, "glitch [version " VERSION "] [" CC "]\n");
{
char vendor[13] = {'\0'};
unsigned int eax;
@@ -27,6 +32,7 @@ void kmain() {
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);
+ fprintf(stderr, "CPU: %s family %u model %u stepping %u\n", vendor, family(v), model(v), v.stepping);
}
pic_init();
@@ -46,6 +52,5 @@ void kmain() {
// asm volatile("int $0x80");
- while (1)
- ;
+ while (1) {}
}