How do I do anything equivalent on Linux using gcc/gpp? I prefer to use
my own graphics library. Thanks for any help =)
Kai
You don't want to access video hardware directly under Linux.
Have a look at LibGGI at http://www.ggi-project.org/
It hides away all the nasties of video and input under Linux/UNIX,
runs on all existing Linux graphics systems, uses acceleration
where available, and also allows you to access framebuffer memory
directly if possible.
//Marcus
--
-------------------------------+------------------------------------
Marcus Sundberg | http://www.stacken.kth.se/~mackan/
Royal Institute of Technology | Phone: +46 707 295404
Stockholm, Sweden | E-Mail: mac...@stacken.kth.se
Should do, it is the same compiler!
> when I run Win95. But one thing I've been trying to figure out...how do
> you gain access to the video memory? In DJGPP there's the DPMI library
> to set the video mode (__dpmi_int()) and the nearptr library to
> directly access conventional memory (with __djgpp_nearptr_enable() and
> __djgpp_nearptr_enable()).
> How do I do anything equivalent on Linux using gcc/gpp? I prefer to use
> my own graphics library. Thanks for any help =)
Are you writing a console or a graphics application??
For console the /dev/vcs* devices are what you need (just mmap them).
For graphics I am not sure that it can be done in any simple way,
I would be inclined to use svgalib.
If it is for a console app, PLEASE consider slang or curses, these are
portable in a way that opening /dev/vcsa is not! And on a modern
system the overhead in writing a screenful of text is tiny.
--
The email address **IS** valid (You do **NOT** need to remove spamblock).
And on the evening of the first day the lord said.....
.... LX 1, GO!! and there was light!
See /usr/doc/kernel-doc-2.2.5/fb/framebuffer.txt
(If it isn't present, install the kernel-doc-2.2.5 pacckage.)
Jon
--
Jon Bloom, KE3Z
jbl...@arrl.org
Electronic Publications Manager (Software, CD-ROMs and Web site)
In a UNIX (or Linux) operating system, unprivileged processes (not running in kernel
space) are not normally permitted to directly access memory in the way that DOS/Windows95
allow. This is for your own protection- it makes it harder to crash the kernel.
>
>Are you writing a console or a graphics application??
>For console the /dev/vcs* devices are what you need (just mmap them).
>For graphics I am not sure that it can be done in any simple way,
>I would be inclined to use svgalib.
>If it is for a console app, PLEASE consider slang or curses, these are
>portable in a way that opening /dev/vcsa is not! And on a modern
>system the overhead in writing a screenful of text is tiny.
The simplest way to access the graphics directly for the purposes of writing
your own graphics library is to use the framebuffer option that's available in
2.2 (and newer) kernels. You just "mmap" /dev/fb and you can "poke" the video
memory all you want.
SVGAlib is a dead-end project which is not going to support new cards.
It has a number of caveats and security issues. It really isn't a portable way
to go.
However, I suggest you reconsider your decision to access the video memory directly.
You are giving up on the benefits of libraries like libggi and X11; these libraries
make your program more portable and "safe" (from the OS point of view).
Dave
--
--------------------------------------------------------------------------------
Email: d...@cgl.ucsf.edu David Konerding WWW: http://picasso.ucsf.edu/~dek
--------------------------------------------------------------------------------
Snail: Graduate Group in Biophysics
Medical Sciences 926, Box 0446
University of California
San Francisco, CA 94143
Note that, as said earlier, you can access video memory directly from
LibGGI just fine when running on a target which supports this (svgalib,
fbdev, XFree DGA, glide).