vm86 task

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
digo_rp
Member
Member
Posts: 233
Joined: Sun Jun 05, 2005 11:00 pm

vm86 task

Post by digo_rp »

Hi all, i have a small problem. I have a kernel with software taskswitching, and vm86. now is my question.

I can do real mode ints, like int 0x10, etc. but I start those int with a funcion that create a vm86 process. and when I finish using int 0x10 for example, that function call int 0x20, that is a simple function that remove that process from my scheduler.

anyone knows how to make that better?

like when using a int 0x20 " good exit " it turns that task to protected mode task and then exit by him self ?
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: vm86 task

Post by Gigasoft »

Only one thread should use the BIOS simulatenously. Therefore, you might as well have a dedicated BIOS process where the low virtual addresses are identity mapped (for example, you could have all BIOS calls be executed in the system process context) and access to the BIOS should be protected by a critical section. When the V86 mode call is finished, the system can remove the V86 return address, stack pointer and segment registers from the stack, restore the ESP0 field in the TSS to what it was before the V86 call was issued and return to the caller. If the thread was moved to the system process (to call the BIOS), the thread should also be moved back to the original process.
Post Reply