Re: Frame buffer detection

"Antonino A. Daplas" <[email protected]>
Newsgroups gmane.linux.fbdev.user
Message-ID <[email protected]>
On Friday 03 September 2004 23:09, [email protected] wrote:
> Hello.
>
> How can I determine whether a script is being run
> from a frame buffer console?
>
> I need this information in order to choose the
> correct arguments when calling a program from
> my script.
>

You can parse /proc/fb to find out if any framebuffer drivers are loaded, then 
do an ioctl where request is FBIO_GET_CON2FBMAP, and struct  
fb_con2fbmap.console is set to the console number you want to determine.
If successful, check fb_con2fbmap.framebuffer on return. Valid values are from 
0  to (FB_MAX - 1) where FB_MAX is the number of framebuffer drivers 
configured in your system

In 2.6, an unmapped console will return fb_con2fbmap.framebuffer = -1.  In 
2.4, I'm not sure, but it's possible that it can be undefined.

Tony




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.