Page 1 of 1

Some questions...

Posted: Wed May 28, 2003 11:00 pm
by darklife
How can I do context switching in voodoo mode? (or in x86 real mode)

If I remember correctly it isn't possible to run machine code >=1Mb. in real mode, so does
this hold true for voodoo mode also? If so maybe I can copy the current task to conventional
memory when needed and run it until the next context switch and then load the next task
to conv. mem. I know this would be slow but it's an idea :)

Is there a way to use DOS/BIOS interrupts once switched to 16bit protected mode?
Maybe redirecting the interrupts?

Bare with me please, im new to this pmode stuff.
Thanks for help.

RE:Some questions...

Posted: Wed May 28, 2003 11:00 pm
by Bird
> How can I do context switching in voodoo mode? (or in x86 real mode)
Same as in real mode.

> If I remember correctly it isn't possible to run machine code >=1Mb. in real
> mode, so does this hold true for voodoo mode also?
I think it's possible, if these (in the least) requirements are met:
1. Disable hardware interrupts (INTRs and NMI).
2. Or if really need them, hook them all. Have 32-bit IRET's (remember to make an EIP on the stack for the IRET: e.g., EIP <- IP + 10000H).
3. Use 32-bit CALL and RET even when you transfer to an offset below 64K.
4. Make an "interface" procedure when you call code in any external module (the BIOS, DOS, etc).
There must have more places that needs paying attention, but I can't think of for now. Sorry.

> Is there a way to use DOS/BIOS interrupts once switched to 16bit protected mode?
> Maybe redirecting the interrupts?
Probably no, one reason is that the BIOS and DOS code loads segment registers frequently.
The V8086 task may let you run DOS/BIOS code. IMHO, you can't have V8086 tasks in pure 16-bit PMode. Some 32-bit code must be used.