Hi Juras,
sorry for the late reply...
> how to obtain CONTEXT for VM86-task of callBIOS
> to privide multitasking while a BIOS function is running?
Ok, here is how things work with vm86_callBIOS:
- There is a vm86 task that is used for performing bios calls. This is
not a real task that can be scheduled together with the other ones (at
least, I would not schedule it ;), but is considered to be
nonpreemptable. It is only needed to switch to the vm86 mode (and
back). It is not created through ll_context_create(), but by directly
writing the TSS into the GDT (see vm86_init())
- The CONTEXT of a task is just a selector, indicating the position of
its TSS in the GDT
- There is only a vm86 task (the BIOS is not reentrant), and its CONTEXT
is X_VM86_TSS, defined in ll/i386/sel.h
- You can know the CONTEXT of the task that is currently running by
using get_TR(), or context_save(), or ll_context_save() (they are more
or less equivalent)
- Hence, if you want to see if you are running the vm86 task or not, you
can do:
CONTEXT c = get_TR();
if (c == X_VM86_TSS) {
/* We are in the vm86 task */
} else {
/* We are running some other task... */
}
See for example the emulate() function in examples/biosdemo.c
Ok, I hope this clarified things a little bit... If your scheduler is
driven by the timer interrupt, I would simply avoid to invoke it if the
interrupted task is the vm86 task.
Luca
--
_________________________________________________________________________
Add this to your signature, if you think it is important
N O W A R ! ! !
|