iret to vm86 proceedure
Posted: Tue Aug 06, 2002 11:00 pm
Hey,
I'm trying to write an interrupt that'll accept a register set, and an interrupt number, which will call the requested _real mode_ interrupt, and return the resultant register set.
I didn't want to create an entirely new vm86 task for this, so I decided to have the interrupt create a stack frame for a vm86 task and "iret" to it... but my knowledge of this is kind of fuzzy.
This is possible, correct?
If so, wouldn't it look something like this:
push dword real_mode_gs
push dword real_mode_fs
push dword real_mode_ds
push dword real_mode_es
push dword real_mode_ss
push dword real_mode_esp
pushfd (with vm86 bit = 1)
push dword real_mode_cs
push dword real_mode_eip
iretd
Is this right? Should cs:eip be real mode segments, or actual linear addresses?
My code segfaults at the iretd, so I'm guessing it's a messed stack frame, but I can't find good info on what the vm86 stack frame looks like.
Thanks,
Jeff
I'm trying to write an interrupt that'll accept a register set, and an interrupt number, which will call the requested _real mode_ interrupt, and return the resultant register set.
I didn't want to create an entirely new vm86 task for this, so I decided to have the interrupt create a stack frame for a vm86 task and "iret" to it... but my knowledge of this is kind of fuzzy.
This is possible, correct?
If so, wouldn't it look something like this:
push dword real_mode_gs
push dword real_mode_fs
push dword real_mode_ds
push dword real_mode_es
push dword real_mode_ss
push dword real_mode_esp
pushfd (with vm86 bit = 1)
push dword real_mode_cs
push dword real_mode_eip
iretd
Is this right? Should cs:eip be real mode segments, or actual linear addresses?
My code segfaults at the iretd, so I'm guessing it's a messed stack frame, but I can't find good info on what the vm86 stack frame looks like.
Thanks,
Jeff