Newer
Older
tree-os / src / kernel / kernel.c
@lukas lukas on 30 Jun 2021 672 bytes add interrupts
#include <stdint.h>
#include <_stdio.h>
#include <tree-os.h>
#include <cursor.h>
#include <task.h>
#include <alloc.h>
#include <osTasks.h>
#include <interrupts.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();
    printf("giving up control...\n");
    yields();
    printf("Returned to mainTask!\n\n");
    printf("initializing interrupts\n");
    initInterrupts();
    yields();
    printf("trying interrupt\n");
    asm ("int $0x80");
    printf("the interrupt worked!\n");
    yield();
}