Subject: Re: VM86 mode.
To: None <salvet@nyx.dcs.muni.cz, sommerfeld@orchard.medford.ma.us>
From: None <mycroft@gnu.ai.mit.edu>
List: port-i386
Date: 10/27/1994 07:12:38
I think your analysis is wrong.  When a V86 process gets an interrupt or
trap, the segment registers are saved on the stack and then filled with
null selectors (except for the new cs, of course).  This is specifically
to allow saving and restoring the segment registers in the way that the
operating system would for a 386 program.

However, the switching to and from V86 is rather tricky.  When you're
switching to, something has to create the saved segment registers on the
stack for the kernel to restore when it returns.  When switching from,
something has to pop them.

This could be handled fairly easily by a special pair of system call
stubs.  However, handling signals, if the signal handlers are run in
32-bit mode, could be a veritable pain in the arse.