[RFC] xserver: use LRMI for real-mode calls

Adam Jackson ajax at nwnk.net
Tue Nov 17 14:14:23 PST 2009

On Tue, 2009-11-17 at 19:01 +0200, Tiago Vignatti wrote:
> Hi,
> Follow here please:
>     git://people.freedesktop.org/~vignatti/xserver libx86
>     git://people.freedesktop.org/~vignatti/libx86/
> This work removes x86emu code from X server and provides the same real-mode
> x86 BIOS calls by using libx86, through LRMI. Eventually we can remove vm86
> code from the server as well given the library has also such implementation.

Thanks for looking into this.  It looks like a good start.

> libx86 is basically a copy from Matthew's and I rebased the library's
> x86emu code as the one we current have on X server [0]. It's mostly about code
> move and clean up, really. Should not have any semantical changes. It will
> open space for _a lot of_ clean ups inside the server. 
> So now, inside X, I'm using some internal x86emu paths (--enable-x86emu) to
> POST a card regardless which libx86's backend. Of course, we need a lot of
> clean up here as well.
> Note that to use an external method to POST now, e.g. using posttool, it
> becomes really simple. Probably only VBE modesetting is not letting us to
> "externalize" all int10 now.
> I'll appreciate any kind of feedback.

I'd really rather see LRMI_init() grow a parameter for which pci device
to map as the VGA device, and return a context for each virtual 8086
environment which we then track in the Int10InfoPtr (in fact,
Int10InfoPtr becomes not a whole lot more than that).  Right now you're
setting up some of the memory arena from outside libx86 and some from
within; seems like a layering violation.

You have this:

 xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
+    if (!LRMI_init())
+        FatalError("Failed to initialise Linux Real-Mode Interface.\n");
     return TRUE;

which is pretty comic.  Just fail, don't FatalError.  Likewise you could
eliminate the failure paths from xf86ExecX86int10() if LRMI_init()
handled all of arena setup.

libx86 can be built with either vm86 or x86emu backend already, so you
should be able to eliminate the muxing for that in the X server.  I
suspect that in doing so, you'll find that most of helper_exec.c should
be merged into libx86 as well, since it does a slightly more elaborate
job of emulating a real mode arena than libx86's setup code does.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://lists.x.org/archives/xorg-devel/attachments/20091117/98f02703/attachment.pgp 

More information about the xorg-devel mailing list