smp: multithreading (WIP)

This commit is contained in:
2021-11-08 00:07:58 +08:00
parent 5cf68dca6a
commit 297c20bbfc
8 changed files with 379 additions and 1 deletions

View File

@ -11,6 +11,7 @@
#include "../interrupt/syscall.h"
#include "../driver/irq/pic/pic.h"
#include "../driver/irq/pic/ps2/ps2.h"
#include "../smp/kthread.h"
#include "../execformat/pe/reloc.h"
void execformat_pe_ReadSystemHeader(execformat_pe_PortableExecutable *pe);
@ -70,8 +71,12 @@ SYSV_ABI void kMain() {
} else
io_WriteConsoleASCII("xcursor_Default: failed to load\n");
io_WriteConsoleASCII("kMain: Initializing threading\n");
smp_thread_ID tid = smp_thread_Init();
io_WriteConsoleASCII("kMain: Threading OK\n");
for (;;) {
asm volatile("hlt");
//asm volatile("hlt");
//io_WriteConsoleASCII("kMain: Interrupt hit\n");
graphics_SwapBuffer();