当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > FreeBSD实现3D桌面

Unix/Linux
linux查看内存的大小
在linux下写的代码,用的是utf-8,结果拿到XP下运行的时候,所有的中文都成乱码
linux su和sudo命令的区别
linux cron 下的定时执行工具使用技巧
linux 查找进程及终止进程操作的相关命令
redhat linux 安装 gcc编译器
Linux Mplayer播放各种格式的电影
一起回顾一下linux常用命令
Linux 网站项目发布要做哪些配置
linux SSH配合SecureCRT的密匙完美使用方法
GD 编译出错解决方法
Facebook Open Platform编译FAQ
Linux 系统硬盘 优化
linux 挂载详解
linux crontab定时命令
Linux 系统中确保访问三级域名畅通的方法
Linux 特权帐号VS普通帐号
确保Linux系统安全的前提条件 漏洞防护
Linux 监视系统资源使用率
Red Hat Linux上使用BIND建立DNS服务器

Unix/Linux 中的 FreeBSD实现3D桌面


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-15   浏览: 33 ::
收藏到网摘: n/a

这几天晚上闲来无事在琢磨FreeBSD上的3D桌面实现。现搜罗两篇比较仔细的参考文档给大家看看。我尚未动手折腾,因为有一些问题尚且不是很清楚。

1. 实现XGL/GLX,需要的xorg的版本最低是多少?要xorg7以上还是xorg6.9就可以?
2.能够支持的显卡是哪些?我的显卡是Intel865G集成显卡。

下面这篇很仔细,不过有些地方不是很明白,主要是第8步,有明白的给讲解讲解。有兴趣的可以照做看看。

AIGLX for FreeBSD(FreeBSD_Release_6.2+AIGLX+Beryl)

1: 系统安装
选择最小化安装,起码这里需要把网络或键盘配好,其他的可以再去细化。

2: bash

root@cnbsd/#cd /usr/ports/shells/bash
root@cnbsd/usr/ports/shells/bash#make install clean
root@cnbsd/usr/ports/shells/bash#ln -s /usr/local/bin/bash /bin/bash
root@cnbsd/usr/ports/shells/bash#chsh -s /usr/local/bin/bash
root@cnbsd/usr/ports/shells/bash#reboot
以后再创建的用户就可以指定shell为bash了。

系统装好后注意装好linux_base、perl包、修改fstab显示/proc目录等。也可以在这里修改环境变量,总之根据你自己的爱好来就是了。

3: axel

root@cnbsd/#cd /usr/ports/ftp/axel
root@cnbsd/usr/ports/ftp/axel#make install clean
root@cnbsd/usr/ports/ftp/axel#cd /etc
root@cnbsd/etc#make.conf

加入以下内容:
"
FETCH_CMD = axel -a
MASTER_SITE_OVERRIDE= /
ftp://ftp.freebsd.org.cn/pub/FreeBSD/ports/distfiles/ \
"

4: fcitx

wanglong@unixsir/usr/ports/chinese/fcitx$make install clean

5:git

root@cnbsd/etc#cd /usr/ports/devel/git
root@cnbsd/usr/ports/devel/git#make install clean

6: pkg_deinstall

root@cnbsd/usr/ports/sysutils/portupgrade#cd /usr/ports/sysutils/portupgrade
root@cnbsd/usr/ports/devel/git#cd /usr/ports/sysutils/portupgrade
root@cnbsd/usr/ports/sysutils/portupgrade#make install clean

7: pkgdb

root@cnbsd/usr/ports/sysutils/portupgrade#cd /usr/ports/sysutils/pkg_trackinst
root@cnbsd/usr/ports/sysutils/pkg_trackinst#make install clean

8: checkout the code

root@cnbsd/usr/ports/sysutils/pkg_trackinst#cd /usr
root@cnbsd/usr#mv ports ports.20070128
root@cnbsd/usr#git clone git://git.geekfire.com/git/ports.git
root@cnbsd/usr#cd ports
root@cnbsd/usr#pkg_info -Ex xorg- | grep -v linux | xargs -n1 pkg_create -b
root@cnbsd/usr#pkg_deinstall -fP xorg-\* libdrm-\* dri-\* libGL-\* libGLU-\* libglut-\* nvidia-driver-\*
root@cnbsd/usr#cd /usr/ports/x11/xorg
root@cnbsd/usr/ports/x11/xorg#make all install clean
root@cnbsd/usr/ports/x11/xorg#cd /usr
root@cnbsd/usr#pkgdb -F
root@cnbsd/usr#reboot
root@cnbsd/#Xorg -configure
root@cnbsd/#cp /root/xorg.conf.new /etc/X11/xorg.conf

增加以下内容到"/etc/X11/xorg.conf":
"
Section "ServerFlags"
Option "AIGLX" "on"
EndSection

Section "DRI"
Mode 0666
EndSection


Section "Extensions"
Option "Composite" "true"
EndSection

"

另外打开"#Option "Dac6Bit" # []"
改为"Option "DRI" "True""

9:确认3D功能是否打开

在装xfce4前可以测试下3D功能是否已经打开,这里主要通过"/var/log/Xorg.0.log"来见检查确认(linux下满街都有glxinfo,bsd下ports里连
key也找不到)。

root@cnbsd/#Xorg -config /etc/X11/xorg.conf
root@cnbsd/#grep rendering /var/log/Xorg.0.log
(II) I810(0): direct rendering: Enabled
root@cnbsd/#

如能看到是"Enable"就可以稍微放心点了。"disabled"多半是由于"mesa""dri"的问题,"dri""mesa"关系密切,不过这里还是要具体情况具
体对待,多看日志。

root@cnbsd/#cd /home
root@cnbsd/home#git clone git://anongit.freedesktop.org/git/mesa/mesa
root@cnbsd/home#chown -R surferwl:surferwl mesal
root@cnbsd/home#su - surferwl
surferwl@cnbsd~$

平常习惯用"surferwl"这个用户,添加的步骤就省了。

surferwl@cnbsd~$vi .profile

增加以下内容:

"
export PKG_CONFIG_PATH=/usr/local/libdata/pkgconfigPKG_CONFIG_PATH
"

保存后退出。

root@cnbsd/#cd /home/mesa
root@cnbsd/home/mesa#gmake freebsd-dri-x86
root@cnbsd/home/mesa#gmake install
root@cnbsd/home/mesa#ln -s /usr/X11R6/lib/modules/dri /usr/X11R6/lib/dri

增加以下内容到"/home/surferwl/.profile":
"
export LIBGL_DRIVERS_PATH="/home/mesa/lib"
export LD_PRELOAD="/home/mesa/lib/libGL.so.1"
"

root@cnbsd/#reboot

再去调试3D功能,心平气和的操作应该是没有问题的。至于"drm",是这样解释的:"The DRM is shipped with the kernel, so you shouldn't need to build it. If you choose to, simply run "make && make install" from the drm/bsd-core directory."

若3D搞定后再去install其他的。


10: xfce4

root@cnbsd/usr/ports/x11-wm/xfce4#make install clean

11: beryl

root@cnbsd/usr/ports/x11-wm/beryl#make install clean

12: .xinitrc
surferwl@cnbsd~$ echo "exec fcitx -nb &" > .xinitrc
surferwl@cnbsd~$ echo "exec beryl-manager &" >> .xinitrc
surferwl@cnbsd~$ echo "exec /usr/local/bin/startxfce4" >> .xinitrc


接着就去"startx"或再"gdm"吧、再就是去转你的屏幕吧,最好放张女朋友的照片,你这样可以360度的随心所意的转着看,就看你的发挥了!


说明:以上的步骤有掺和了不少个人习惯性动作,有多余的步骤,比如切换目录的、使用bash shell等,其实这是个人习惯,自己明白就o了,>对着去画就行;我习惯用"simsun""文泉"字体,这里也没有写出来。另外就是还没有仔细检查,可能还有错字情况,但大体思想是这样的。我在使用的过程中还没有发现问题,和平常没有使用AIGLX功能的时侯一样,就是比较"动态"了。