Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Sep 2000 11:21:24 -0500 (CDT)
From:      Jonathan Lemon <jlemon@flugsvamp.com>
To:        jon@spock.org, hackers@freebsd.org
Subject:   Re: VM86 interrupt calls from userland
Message-ID:  <200009171621.e8HGLOR54666@prism.flugsvamp.com>
In-Reply-To: <local.mail.freebsd-hackers/20000917033317.A41735@spock.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <local.mail.freebsd-hackers/20000917033317.A41735@spock.org> you write:
>Is there a way to make VM86 interrupt calls from userland?  The reason I'm
>asking is that in order to get my video card (Savage/IX) working in X
>properly, I need to make a couple of VESA int10 calls (or somehow obtain
>the programming specs for the card and do this the right way).  Anyway,
>what I have tried is using the syscons ioctl()'s, which doesn't work here.  
>Right now what I've done is modified src/sys/i386/i386/vm86.c to enable the
>VM86_INTCALL bit (and added a check for uid), and just called i386_vm86
>from userland.  This seems to work fine, but I want to know
>
>1) Is there already some standard way to do this that I missed?  The man
>   page for i386_vm86 mentions sigreturn(), but I'm not sure if that will
>   do what I want, plus I don't know how to use it anyway...
>2) There was probably a reason the VM86_INTCALL stuff was #if'ed out... but
>   I looked around the lists and cvs logs to see if one was mentioned and
>   found none.  This seems to work and I don't see how anything bad could
>   come from this -- is it possible that this be enabled by default?
>3) Or would the whole problem be solved more correctly by extending the
>   ioctl by adding something like FBIO_SETMODE_ONLY where syscons would
>   only switch the mode and not bother setting up the renderer or emulator?

I added VM86_INTCALL while developing the vm86 system for this very
reason; so I could make vm86 calls from userland.  However, it was 
turned off before it was initially committed, since it could probably
open up a security hole or worse.

My feeling is that this functionality probably belongs in the kernel
(point #3), but as a workaround, adding a root capability check and 
then enabling the vm86 functionality is probably acceptable.
--
Jonathan


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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