1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

A userspace process can now GPF and the OS goes on!

This is really rickety, but it kinda sorta works for my test GPF!
This commit is contained in:
Andreas Kling 2018-10-17 23:49:32 +02:00
parent 77299cf54d
commit 56c1f9db8e
8 changed files with 96 additions and 42 deletions

View file

@ -185,11 +185,15 @@ void yield()
if (!scheduleNewTask())
return;
//kprintf("yield() jumping to new task: %x (%s)\n", current->farPtr().selector, current->name().characters());
switchNow();
}
void switchNow()
{
Descriptor& descriptor = getGDTEntry(current->selector());
descriptor.type = 9;
flushGDT();
//kprintf("yield() jumping to new task: %x (%s)\n", current->farPtr().selector, current->name().characters());
asm(
"ljmp *(%%eax)\n"
::"a"(&current->farPtr())