设为首页 加入收藏 简繁转换

 | 网站首页 | 网络学院 | 自考论坛 | 四联自学 | 四联博客 | 

您现在的位置: IT自学网 >> 网络学院 >> 操作系统 >> Linux >> 新手入门 >> 学院正文
专 题 栏 目
最 新 热 门
最 新 推 荐
相 关 文 章
按部就班三步走:RHCE黄金…
实力的终极挑战:RHCE认证…
考前必读:怎样准备RHCE考…
认证考试介绍之RHCE篇
红旗Linux认证证书样本
高手攻关心得:RHCE实战详…
实力的终极挑战:RHCE认证…
按部就班三步走:RHCE黄金…
考前必读:怎样准备RHCE考…
明年Redhat考试将有重大…
Framebuffer HOWTO英文         ★★★★
Framebuffer HOWTO英文
作者:4Lzx.com 文章来源:bbs.4Lzx.com 点击数: 更新时间:2005-9-4 18:51:58
set" to adjust the setting on this second monitor

Only set the "fbset" settings on the monitor you run the "fbset"command on. Therefore, you must be careful to use the "-fb" flag onthe second monitor. In particular, if you do nothing else you'llprobably want to at least set the virtual vertical resolution toyour actually vertical resolution.

e.g. "fbset -fb /dev/fb1 -vyres 600"

This will seriously slow down text mode, but X will be obnoxiouswithout it.

Set up X for Frame Buffer support.

The framebuffer.txt file explains this better than I can, but here's the two important points.

Make sure you set the link for "X" to point to "XF86_FBDev".

Next you need to add a monitor section to your XF86Config filefor the frame buffer device. Here's an example:

# The Frame Buffer serverSection "Screen" Driver "fbdev" Device "Millennium" Monitor "NEC MultiSync 5FGp" Subsection "Display" Depth 8 Modes "default" ViewPort 0 0 EndSubsection Subsection "Display" Depth 16 Modes "default" ViewPort 0 0 EndSubsection Subsection "Display" Depth 24 Modes "default" ViewPort 0 0 EndSubsection Subsection "Display" Depth 32 Modes "default" ViewPort 0 0 EndSubsectionEndSection

Use the "default" modes as I don't think any other one will work withthe Matrox frame buffer.

Try starting the X server on the second monitor.

Set the variable FRAMEBUFFER to the second frame buffer.

"export FRAMEBUFFER=/dev/fb1"

or

"setenv FRAMEBUFFER /dev/fb1"

You need to start the X server so that it both matches the selectedcolor depth and it appears on the same monitor you start the X serverfrom.

e.g. "startx -- :0 -bpp 16 vt06"

This example will start the "zeroth" X server on virtual console sixwith 16 bit color. Using ":1" when launching another X server forthe other frame buffer will allow you to have two X servers running.

14.10 Summary

The steps involved in getting an X server running on a second monitorcan be summarized as follows:

* Get the kernel patch, fbset, and con2fb.

* Patch the kernel, configure, rebuild, and reboot.

* Add XF86_FBDev section to XF86Config file and set X link.

Then each time you reboot:

* Move a console over. e.g. "con2fb /dev/fb1 /dev/tty6"

* Adjust the settings e.g. "fbset -fb /dev/fb1 1280x1024"

* Set the FRAMEBUFFER. e.g. "export FRAMEBUFFER=/dev/fb1"

* Start the X server. e.g. "startx -- -bpp 16 vt06"

You can automate this each time you reboot via a shell alias. It must be an alias and not a shell script since it needs to detect thecurrent console number. This is my C-shell alias to start up X ona second fixed frequency monitor:

alias startxfb = "setenv FRAMEBUFFER /dev/fb\!*; # Set the env var to the cmd arg.con2fb $FRAMEBUFFER /dev/$tty; # Move the fb to the current tty.fbset -fb $FRAMEBUFFER 1280x1024@62; # Favorite from /etc/fb.modesstartx -- :\!* -bpp 16 vt0`echo $tty | cut -dy f 2`' # X on this tty."

In my .cshrc file these are all on the same line together withoutthe comments, but it's easier to read here with line breaks andcomments inserted. I just give the number of the frame buffer as anargument and it starts right up.

I'm not sure how to do this same alias in bash. I don't know how todetermine the current tty or get the arguments to an alias in bash.If someone lets me know I'll insert it here. However, you can usethe "tty" command to get the name of the current VT and just maketwo separate aliases for each X server.

14.11 Other Notes and Problems

* Both "fbset" and "startx" MUST be run from the same frame bufferas the one being affected. This places serious limits on how muchof these commands can be automated via scripts.

* XFree86 4.0 will have "proper" multi-head support, but 3.3.1 doesnot. You can run two servers with 3.3.1 and use x2x to switchbetween them however...(see the next bullet)

* The inactive frame buffer will just hold the last image of when itwas active, no updates with occur.

* The monitor that's not selected doesn't always preseve it's statewhen not active. (But it usually does.)

* Geert Uytterhoeven (the frame buffer maintainer) and LinusTorvalds don't agree with the current "frame buffer per VT"multi-head console support changes (i.e. fbaddon) so it may neverbe in the mainstream kernel tree. (This was heard third hand andmay be wildly untrue.)

* If you "break the rules" and start the X server (run "startx")from a different monitor, the machine can eventually crash badlywith the keyboard and mouse input all mixed together.

* The documentation framebuffer.txt in the kernel source explainsthat you can use the Modeline settings in your XF86Config filedirectly when running X. Using the Matrox frame buffer seems toforce the X server to drop all of those. So you can only have theone ("default") setting at at time (the same one you had in textmode).

* The XF86_FBDev is unaccelerated. However, there are patches foraccelerated Matrox support at

http://www.in-berlin.de/User/kraxel/xfree86/

Getting "init level five" (i.e. xdm/gdm) to work

I have not yet figured out a way to boot with init level 5 with adual monitor configuration (and actually have the server on eitherthe second montior or both). While it seems easy enough to add aline to the gdm/xdm Xservers file, the constrain that you must startthe X server from the same frame buffer prevents the obvioussolution from working. If anyone finds a way please e-mail me andI'll add it here.

Using the x2x program.

There's a nice little program called x2x that will switch X serversfor you when you get to the edge of the screen. Last known home forthis program was:

http://ftp.digital.com/pub/DEC/SRC/x2x/

It'salso an optional Debian package. I haven't tried it yet but someusers have reported success.

Other useful commands

These are existing linux commands that are worth remembering whendealing with a multi-head configuration (especially in writingscripts).

* "chvt" will allow you to switch between virtual terminals.

* "openvt" start a program on a new virtual terminal (VT).

* "tty" will report the name of the current terminal.

Appendix A. Octave cvtmode.m script

(note the bpp setting)

#!/usr/bin/octave -qbpp = 16;DCF = sscanf(argv(1,:), "%f");HR = sscanf(argv(2,:), "%f");SH1 = sscanf(argv(3,:), "%f");SH2 = sscanf(argv(4,:), "%f");HFL = sscanf(argv(5,:), "%f");VR = sscanf(argv(6,:), "%f");SV1 = sscanf(argv(7,:), "%f");SV2 = sscanf(argv(8,:), "%f"); VFL = sscanf(argv(9,:), "%f");pixclock = 1000000 / DCF;left_margin = HFL - SH2;right_margin = SH1 - HR;hsync_len = SH2 - SH1;# 3) vertical timings:upper_margin = VFL - SV2;lower_margin = SV1 - VR;vsync_len = SV2 - SV1;RR = DCF / (HFL * VFL) *1e6;HSF = DCF / HFL * 1e3;printf("mode \"%dx%d\"\n",HR,VR);printf(" # D: %3.2f MHz, H: %3.2f kHz, V: %2.2f Hz\n", DCF, HSF, RR);printf(" geometry %d %d %d %d %d\n", HR, VR, HR, VR, bpp);printf(" timings %d %d %d %d %d %d %d\n", ... pixclock, left_margin, right_margin, ... upper_margin, lower_margin, ... hsync_len, vsync_len);printf("endmode\n");

Appendix B. Borne Shell script "cvtfile"

(This calls the octave script "cvtmode")

#!/bin/sh# Shell script to convert XF86Config file to fb.modes file.# Uses octave script cvtmode.mif [ -z $1 ]; then FILE=/etc/X11/XF86Configelse FILE=$1fii=1LEN=`grep Modeline $FILE | wc -l`while expr $i \< $LEN > /dev/null ;do CURLINE=`grep Modeline $FILE | cut -d'"' -f 3-20 | head -$i | tail -1 ` ./cvtmode.m $CURLINE echo " " i=`expr $i + 1`done

15. Using/Changing fonts

To get the capability to change fonts, you need kbd-0.99. You may obtainthis from

ftp://ftp.win.tue.nl/pub/linux/utils/kbd

One advantage of downloading and installing kbd-0.99 is that you will beable to load international fonts (i.e Euro symbol) into your consoledevice (It is tres chic to have three symbols on my keyboard, the dollar sign, the English pound sign and the Euro sign!).

16. Changing console modes

To get the capability to change modes (i.e 640x480, 800x800 etc), youneed fbset (currently fbset-19990118.tar.gz) - you may ftp it from:

http://www.cs.kuleuven.ac.be/~geert/bin/fbset-19990118.tar.gz

This comes with a full set of instructions on how to operate this.

17. Setting up the X11 FBdev driver

If you are not using XFree86 3.3.3.1 or later, you are urged to upgradeto XFree86 3.3.3.1 - it includes a FBdev X driver for framebuffer devices.Otherwise, follow the steps below to either download or build your own FBdevdriver for older XFree86 versions such as 3.3.2, 3.3.3 etc.

Go to

http://www.xfree86.org

, and download the latest XServers source archive, unpack, and configure the drivers, following these steps:

* Edit xc/config/cf/xf86site.def, uncomment the #define forXF68FBDevServer
* Comment out all references to FB_VISUAL_STATIC_DIRECTCOLOR, asthese are bogus and aren't used any more. If you are using XFree86 3.3.3.1, there is no need to do this step - as they have removed this.
* Edit xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c, andchange K_RAW to K_MEDIUMRAW.

and then build the driver. Don't worry about the m68k references, itsupports Intel platforms. Then build the whole thing - it'll take a longtime though as it's a large source tree.

Alternatively, if you d

上一页  [1] [2] [3] [4] [5] [6] [7] 下一页

学院录入:4Lzx.com    责任编辑:4Lzx.com 
  • 上一篇学院:

  • 下一篇学院:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      网友评论:(评论内容只代表网友观点,与本站立场无关!)

    站长:IT自学
    有事点这里