Newer
Older
tree-os / src / kernel / kernel.c
@lukas lukas on 25 Aug 2021 620 bytes :refactor terminal
#include <_stdio.h>
#include <alloc.h>
#include <cursor.h>
#include <devices.h>
#include <interrupts.h>
#include <irqs.h>
#include <osTasks.h>
#include <stdint.h>
#include <task.h>
#include <timer.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();
  printf("initializing interrupts\n");
  setupDevices();
  initInterrupts();
  yields();
  while (1) {
    asm volatile("hlt");
    yields();
  }
}