From owner-freebsd-hackers Sun Sep 17 9:22: 3 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from prism.flugsvamp.com (cb58709-a.mdsn1.wi.home.com [24.17.241.9]) by hub.freebsd.org (Postfix) with ESMTP id EA9F137B422 for ; Sun, 17 Sep 2000 09:22:00 -0700 (PDT) Received: (from jlemon@localhost) by prism.flugsvamp.com (8.11.0/8.11.0) id e8HGLOR54666; Sun, 17 Sep 2000 11:21:24 -0500 (CDT) (envelope-from jlemon) Date: Sun, 17 Sep 2000 11:21:24 -0500 (CDT) From: Jonathan Lemon Message-Id: <200009171621.e8HGLOR54666@prism.flugsvamp.com> To: jon@spock.org, hackers@freebsd.org Subject: Re: VM86 interrupt calls from userland X-Newsgroups: local.mail.freebsd-hackers In-Reply-To: Organization: Cc: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article 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