1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +00:00

Generalize the SpinLock and move it to AK.

Add a separate lock to protect the VFS. I think this might be a good idea.
I'm not sure it's a good approach though. I'll fiddle with it as I go along.

It's really fun to figure out all these things on my own.
This commit is contained in:
Andreas Kling 2018-10-23 23:32:53 +02:00
parent e4bfcd2346
commit 018da1be11
11 changed files with 88 additions and 203 deletions

View file

@ -494,28 +494,6 @@ bool scheduleNewTask()
}
}
static void drawSchedulerBanner(Task& task)
{
return;
// FIXME: We need a kernel lock to do stuff like this :(
//return;
auto c = vga_get_cursor();
auto a = vga_get_attr();
vga_set_cursor(0, 50);
vga_set_attr(0x20);
kprintf(" ");
kprintf(" ");
kprintf(" ");
vga_set_cursor(0, 50);
kprintf("pid: %u ", task.pid());
vga_set_cursor(0, 58);
kprintf("%s", task.name().characters());
vga_set_cursor(0, 65);
kprintf("eip: %p", task.tss().eip);
vga_set_attr(a);
vga_set_cursor(c);
}
static bool contextSwitch(Task* t)
{
//kprintf("c_s to %s (same:%u)\n", t->name().characters(), current == t);
@ -573,7 +551,6 @@ static bool contextSwitch(Task* t)
tssDescriptor.type = 11; // Busy TSS
flushGDT();
drawSchedulerBanner(*t);
t->didSchedule();
return true;