Added a math library, with clamp and POW. added printf support for printing doubles added a few helper functions in PIT for calcaulting the time in seconds of a clock cycle based on divisor
41 lines
709 B
C
41 lines
709 B
C
#include <stdio.h>
|
|
#include <stdint.h>
|
|
|
|
#include <kernel/_kernel.h>
|
|
#include <kernel/tty.h>
|
|
#include <kernel/serial.h>
|
|
#include <kernel/x86/gdt.h>
|
|
#include <kernel/x86/idt.h>
|
|
#include <kernel/x86/io.h>
|
|
#include <kernel/x86/keyb.h>
|
|
|
|
#include <kernel/x86/pit.h>
|
|
|
|
|
|
void kmain(void)
|
|
{
|
|
#ifdef __TESTING__ // important components should be declared first, but if we're testing we want to log all of that
|
|
terminal_initialize();
|
|
serial_initialize();
|
|
#endif
|
|
gdt_init();
|
|
idt_init();
|
|
|
|
#ifndef __TESTING__
|
|
terminal_initialize();
|
|
serial_initialize();
|
|
#endif
|
|
|
|
init_kb();
|
|
|
|
printf("%f\n", get_time_from_divisor(10));
|
|
|
|
printf("Entering loop...\n");
|
|
while (1) {
|
|
|
|
continue;
|
|
}
|
|
printf("Exiting loop...\n");
|
|
|
|
}
|