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.
multitasking and locking the kernel
Re: multitasking and locking the kernel
Hi,
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
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.kubeos wrote:Any suggestions would be appreciated.
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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: multitasking and locking the kernel
Hmmm, maybe I should just use REAL floppy and hdd drivers and stop relying on BIOS.