Newer
Older
tree-os / src / kernel / kernel.c
@lukas lukas on 1 Jan 2022 653 bytes code cleanup: lists
#include <_stdio.h>
#include <alloc.h>
#include <cpuid.h>
#include <devices.h>
#include <interrupts.h>
#include <osTasks.h>
#include <stdint.h>
#include <task.h>
#include <tree-os.h>

extern uint32_t _kernel_end;

void kernelMain() {
    initMemoryAllocation(
        0x1000000); // initializing stacks after the kernel seems not to work :(
                    // otherwise, _kernel_end should be passed here
    initOSTasks();
    drawLogo();
    setupDevices();
    setupInterrupts();
    printf("cpu data:\n");
    printCPUData();
    while (1) {
        if (isTaskQueueEmpty()) {
            asm volatile("hlt");
        }
        yields();
    }
}