Page 1 of 1

multitasking and locking the kernel

Posted: Fri Sep 26, 2008 1:07 am
by kubeos
Hi,

I am getting around to fixing my multitasking but I'm not sure of the best way to lock my kernel during critical operations. I've tried just setting a flag so the timer keeps firing but I don't think this is working for me. My critical operations are a few vm86 routines which I think are causing a problem with my timer/scheduler.

Should I mask off the timer irq? Or should I just do a cli?

Any suggestions would be appreciated.

Re: multitasking and locking the kernel

Posted: Fri Sep 26, 2008 3:49 am
by Brendan
Hi,
kubeos wrote:Any suggestions would be appreciated.
Sure - fix your code so that you can handle any/all interrupts while VM86 code is running, and so that your scheduler can preempt VM86 code.

The only problem you should have is when 2 or more threads try to use crusty old BIOS functions at the same time. In this case you'd just use a mutex or something so that only one thread can use the BIOS at a time.


Cheers,

Brendan

Re: multitasking and locking the kernel

Posted: Fri Sep 26, 2008 12:28 pm
by kubeos
Hmmm, maybe I should just use REAL floppy and hdd drivers and stop relying on BIOS. :lol: