From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Richard Cooper" Subject: How to Use the vm86 System Call Date: Thu, 15 Sep 2005 14:04:47 -0400 Message-ID: Mime-Version: 1.0 Content-Transfer-Encoding: 7BIT Return-path: Sender: linux-assembly-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed delsp=yes" To: linux-assembly@vger.kernel.org Does anyone know how to make use of the vm86 system call? The man page for it is pretty light on the details, and the names of the fields of the structures in the header file aren't very explanatory. All I can seem to find on the internet is stuff like this: 16:02:17 anyone knows how to use vm86() ? 16:02:24 system call 16:02:59 how can I creat the struct vm86plus_struct 16:03:03 ? 16:03:15 I couldn't find any documentation on that 16:06:53 #include 16:07:13 /usr/include/sys/vm86.h 16:07:22 all the documentation u could ever want 16:07:48 couldn't find what the struct members should contain 16:07:55 :( 16:08:23 struct vm86plus_struct { 16:08:24 struct vm86_regs regs; 16:08:24 unsigned long flags; 16:08:24 unsigned long screen_bitmap; 16:08:24 unsigned long cpu_type; 16:08:26 struct revectored_struct int_revectored; 16:08:26 struct revectored_struct int21_revectored; 16:08:28 struct vm86plus_info_struct vm86plus; 16:08:36 }; It seems so hopeless. I was working on a new Softer-like thing, except that it would work in framebuffer mode too, and it would just provide video access rather than all of that "orange protocol" stuff. However, I'm writing it to use with a game that I want to release as shareware, but if the game is shareware, then I want it to work well for people (so that they'll give me money), and part of working well is being able to run it in whatever video mode the user wants. With framebuffer, you only get the one video mode that the framebuffer is in, and that's not very nice since the user might want framebuffer in 1600x1200 because they run X in framebuffer mode, but in all likelyhood they'd rather run the game in something like 640x480. I'd much rather just call the VESA BIOS and be able to make it support every mode available in both text mode and framebuffer mode rather than deal with the unstability of SVGA lib or the "maybe we can change modes, and maybe we can't" stuff you get with things like SDL under X, but the vm86 call doesn't seem to be documented anywhere. I actually decided to write the thing in Windows because of that, but reading through the Windows documentation, I'm not sure how much of that hungarian notation I can tolerate. If I could just figure out how to use this vm86 call then I could make the game support the video modes that I want it to support, and then I wouldn't have to learn to program for a whole new OS, and I could write the game in Linux like I origionally wanted to. (And just in case anyone is wondering, the part that does the graphics modes would be public domain just like Softer, only the game itself would be closed source shareware.)