bringelle/src/bringelle.c

46 lines
795 B
C
Raw Normal View History

2021-04-09 10:29:23 +02:00
#include "libc/stdio.h"
#include "boot/multiboot.h"
2021-04-12 10:13:21 +02:00
#include "core/mem.h"
#include "core/gdt.h"
#include "core/paging.h"
2021-04-13 18:09:43 +02:00
#include "core/scheduler.h"
2021-04-09 18:18:15 +02:00
2021-04-12 10:13:21 +02:00
extern void interrupt_enable();
2021-04-10 17:24:13 +02:00
2021-04-09 18:18:15 +02:00
void utask(){
2021-04-14 14:13:44 +02:00
char *msg=(char*)4206592+10;
msg[0]='T';
msg[1]='a';
msg[2]='s';
msg[3]='k';
msg[4]='1';
msg[5]='\0';
2021-04-10 17:24:13 +02:00
asm("mov $0x1, %%eax;int $0x30"::"b"(msg));
2021-04-09 18:18:15 +02:00
while(1);
}
2021-04-04 11:19:55 +02:00
void bringelle(){
clear();
2021-04-09 18:18:15 +02:00
printc("Booting Bringelle...\n",GREEN);
2021-04-12 10:13:21 +02:00
// ----- Kernel boot sequence
interrupt_enable();
2021-04-10 17:24:13 +02:00
print("Interrupts enabled\n");
2021-04-09 18:18:15 +02:00
2021-04-11 20:53:06 +02:00
paging_enable();
2021-04-14 14:13:44 +02:00
print("Paging enable\n");
print("Kernel started!\n");
print("-----------------------\n");
2021-04-11 20:53:06 +02:00
show_tics=1;
2021-04-14 14:13:44 +02:00
2021-04-09 18:18:15 +02:00
// Utask
2021-04-14 14:13:44 +02:00
print("Launch user task \n");
int* page_dir=paging_allocate(2);
run_task(page_dir, utask,100);
2021-04-09 18:18:15 +02:00
2021-04-04 11:19:55 +02:00
while(1);
}
2021-04-13 15:31:45 +02:00