On Wed, Mar 27, 2002 at 03:53:34PM +0800, henry wrote: > There(internet) are resources about video-programming & > There are VGA-bios-calls(VESA2.0) in these dos-programming. > > I will take efforts(maybe impossible) to port those dos-programs to Linux > if I use svgalib(a VGA-library for linux). > > Does someone know how to call those Bios-calls on Linux ? > or > I'd better abandon those implimented Bios-calls? > (it's supposed that VGA-bios is ready in my VGA-card).
Hi Henry, Are these dos programs that you wrote yourself/have the source code to? It would be better for you to use a library such as svgalib (or the higher level library, SDL - http://www.libsdl.org) I've not used svgalib, but have used libSDL. Most DOS programs that use graphics will tend to use BIOS calls to do things like change the video mode and setup an appropriate frame buffer so that the program can then simply do appropriate paging and write directly to memory to perform the actual graphics. When I programmed graphics under DOS I would only use the BIOS to change the video mode and just about everything else I did by writing to the VGA card's registers. While you probably can call the BIOS under Linux in userland as root, it's best to forget about the BIOS. libsdl contains all the necessary functions for setting video mode, swapping buffers, etc. and is portable across several operating systems and architectures. If you do want to go down the evil path, try http://linuxassembly.org/ I have written a very crappy unfinished "game" with libsdl in C and have found it very easy to use. It also (to quote the documentation) has bindings to several other languages including Ada, Eiffel, ML, Perl, PHP, Python and Ruby. It also contains support for mouse input, sound, joystick etc. Regards, Chris -- SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
