Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 08 Nov 1997 20:52:11 +1030
From:      Mike Smith <mike@smith.net.au>
To:        Jonathan Mini <mini@d198-232.uoregon.edu>
Cc:        Mike Smith <mike@smith.net.au>, hackers@FreeBSD.ORG
Subject:   Re: x86 gods; advice? Suggestions? 
Message-ID:  <199711081022.UAA00794@word.smith.net.au>
In-Reply-To: Your message of "Sat, 08 Nov 1997 02:14:51 -0800." <19971108021451.30385@micron.mini.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > > 	- hop into the kernel, from the vm86 task. The kernel would be in
> > > 	a situation where it is in a ring 0 32bit TSS with a vm86 TSS which
> > > 	has mappings to do some basic BIOS calls for it, possibly even some
> > > 	complex ones.
> > 
> > This isn't making a lot of sense to me.  Are you implying that one 
> > could be in 32-bit PM and vm86 mode at the same time?
> 
>   No. I am saying that the kernel has on it's hands two prepped and functional
> TSS's. One which describes a vm86 environment suitable for making BIOS calls,
> and another which is the 32bit protected mode TSS that the kernel is used to
> having.

Uh.  I am still not understanding.  With these on hand, what then?  How 
do you swap between them in a useful fashion?  When you say "TSS" do 
you just mean segment descriptors, or is there more to it than this?

> > >   A way which would allow the protected mode code to request services of
> > > the vm86 code rather than visa versa. Currently, the only method I have
> > > created is for the task to do a vfork, and the child turns itself into a
> > > vm86 process with a monitor.
> > 
> > What's the difference?  Your execution passes between vm86 mode and 
> > 32-bit PM; which direction information passes is entirely a semantic 
> > issue.
> 
>   It is not the way the information passes, which the way that the process's
> control thread passes. Currently, it goes :
> 
> 	pmode : (setup) ->
> 		vm86
> 		(run run run)
> 		(fault) ->
> 			pmode (handle fault)
> 			<- (return)
> 		(run run run)
> 
>  I need :
> 
> 	pmode :
> 	(setup) ->
> 		vm86
> 		(perform subserviant task)
> 	     <- (fault)
> 	(run run run)

Try:
 	pmode : (setup) (invoke init function)->
 		vm86
 		(run run run inside init function)
 		(fault) ->
 			pmode (return to main program)
	(run run run)
	(invoke function) ->
		(run run run)
		(fault) ->
			pmode (return to main program)
	(run run run)

If you look at (invoke function) and expand it to (fiddle vm86 register 
set, return), then you see that all you are worrying about is semantic.
The (return to main program) may have to be a little ugly, as in it may 
want to take the address of a function as an argument, ie. your entire 
application runs inside the vm86 fault handler, but all that would be 
invisible presuming that that the alternate signal stack was large 
enough.

mike





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711081022.UAA00794>