linux安装ati工具,安装ati驱动的辛苦历程
不知道啥时候变懒了,linux只想能用就行,不想去搞定驱动的事清,但是很不愿意装ubuntu,从它那里学不到linux的知识。于是ati的驱动就那么放着一直用vesa,反正9.3版本的fglrx安装不上。某天想将9.3的ati驱动装上,让mplayer更流畅一点,于是有了下面的经历。
1、阶段1
直接运行ati-driver-installer-9-3-x86.x86_64.run,编译失败,查看log是我的build和source指向的路径不对,于是从kernel.org下载来源码,放到/usr/src,又将build和source文件指向路径指对了,编译告警改变了,说找不到version.h,搜了一通走了些弯路,找到了生成version.h的办法:,运行modprobe oldconfig&&modprobe modules_prepare,生成了正确的versing.h和utsreleae.h。
2、阶段2
此时再运行ati-driver-installer-9-3-x86.x86_64.run,告警又变了,提示
they are versioned as ""
instead of "2.6.31.5my".
you might need to adjust your symlinks:
- /usr/include
- /usr/src/linux
[Error] Kernel Module : Failed to compile kernel module - please consult readme.
解决不了,于是解压出ati的源码,修改lib/modules/fglrx/build_mod/2.6.x/下的Makefile文件,给EXTRA_CFLAGS添加了当前内核的include路径
之后运行ati-driver-installer-9-3-x86.x86_64.run提示firegl_public.c编译有错,后来找到是内核文件变,task_struct结构变了,增加了cred来指向euid,在google搜搜到一篇文件章将task_struct更变的地方修改的方法,又查了内核源码,确实我用的版本也改了,之后有搜到一个fglrx的patch,根据patch的内容,修改了task_struct的指向,又修改了*(kernel_cap_t *)¤t->cred->cap_effective,屏蔽了#error unknown or undefined architecture configured,这部分终于能过了
3、阶段3
经过一行步骤已经能否生成fglrx的内核模块了,但是加载不进去,可能是由于我用的内核是先编译的,后来删掉了源码,而装驱动的时候用的源码是从kernel.org新下的,于是重新编译内核
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
以下是参考的网页:
http://hi.baidu.com/yinjianren/blog/item/bfd2e313cfedbe8c6438db07.html
如何配置内核
2010年04月23日 星期五 20:25
前提:
1. 运行良好的Linux 系统
2. pciutils 工具包
$lspci -k # 列举出您的Linux此时所必须的模块
......
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
Kernel driver in use: i801_smbus
Kernel modules: i2c-i801 # 内核对应选项是 CONFIG_I2C_I801
01:00.0 VGA compatible controller: ATI Technologies Inc RV610 video device [Radeon HD 2400 PRO]
Kernel driver in use: fglrx_pci
Kernel modules: fglrx
03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 14)
Kernel driver in use: sky2
Kernel modules: sky2 # 内核对应选项是CONFIG_SKY2
$ ## 有一些模块要反着搜。如 intel-agp,就是 AGP_INTEL,多搞搞就熟悉了(减少字符也是办法)。
$ # 一般来说,make menuconfig 之前还是先搞一份一般配置。如x86
$ cp arch/x86/configs/i386_defconfig .config
$ make menuconfig # 根据lspci -k 得到的信息 在配置的时候搜索: 按"/" 。
$
$ # 然后重要的一条是文件系统
$ cat /etc/fstab # 看看是啥文件系统,编译入内核(*)。
$
$ # 还有处理器芯片, 用hardinfo 查看吧,不懂就默认。
$
$ # 编译吧
$ make -j cpu_number*2# 从gentoo 安装手册看到的,至于为啥。
$ make -j cpu_number*2 modules_install
$ sudo cp arch/i386/boot/bzImage /
$ # 编辑引导程序的配置文件 (自理)
PS: 我的 ATI Radeon HD 2400,安装时使劲的报错:
---------------------------------错误的分割线--------------------------------------
[Message] Kernel Module : Trying to install a precompiled kernel module.
[Message] Kernel Module : Precompiled kernel module version mismatched.
[Message] Kernel Module : Found kernel module build environment, generating kernel module now.
AMD kernel module generator version 2.1
Error:
kernel includes at /lib/modules/2.6.33.2/build/include do not match current kernel.
they are versioned as ""
instead of "2.6.33.2".
you might need to adjust your symlinks:
- /usr/include
- /usr/src/linux
[Error] Kernel Module : Failed to compile kernel module - please consult readme.
其实,并不是我们的Linux kernel有问题,而是ATI的驱动并没有更新及时,详细的讨论在,
,。
。
jimi@debian20:09:25 ~/ati $ ls
ati-driver-installer-10-3-x86.x86_64.run fglrx-2.6.33.patch
jimi@debian20:09:26 ~/ati $ ./ati-driver-installer-10-3-x86.x86_64.run --extract .
Warning: target directory exists .
Verifying archive integrity... All good.
Uncompressing ATI Proprietary Linux Driver-8.712..................(...)
jimi@debian20:12:15 ~/ati $ patch -p1 < fglrx-2.6.33.patch
patching file common/lib/modules/fglrx/build_mod/drmP.h
patching file common/lib/modules/fglrx/build_mod/firegl_public.c
Hunk #3 succeeded at 1470 (offset -2 lines).
patching file common/lib/modules/fglrx/build_mod/kcl_acpi.c
patching file common/lib/modules/fglrx/build_mod/kcl_agp.c
patching file common/lib/modules/fglrx/build_mod/kcl_io.c
patching file common/lib/modules/fglrx/build_mod/kcl_osconfig.h
patching file common/lib/modules/fglrx/build_mod/kcl_pci.c
patching file common/lib/modules/fglrx/build_mod/kcl_str.c
patching file common/lib/modules/fglrx/build_mod/kcl_wait.c
patching file common/lib/modules/fglrx/build_mod/make.sh
jimi@debian20:14:46 ~/ati $ sudo ./ati-installer.sh . --install
jimi@debian20:14:46 ~/ati $ # 一路回车,好了,重启系统.
jimi@debian20:14:46 ~/ati $ # 没有声音? alsamixer 全部都调到最高吧, ^_^
jimi@debian20:14:46 ~/ati $ alsamixer
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
by » 3. Jan 2009, 16:27
Distro is openSUSE 11.2 Alpha0 x86_64.
Kernel 2.6.28 is OK, from 2.6.28-git1 errors:-
barrabas:/usr/src/vboxdrv-2.1.0 # make
*** Building 'vboxdrv' module ***
make[1]: Entering directory `/usr/share/virtualbox/src/vboxdrv'
make KBUILD_VERBOSE= -C /lib/modules/2.6.28-git5-smp/build
SUBDIRS=/usr/share/virtualbox/src/vboxdrv
SRCROOT=/usr/share/virtualbox/src/vboxdrv modules
make[2]: Entering directory `/usr/src/linux-2.6.28-git5'
CC [M] /usr/share/virtualbox/src/vboxdrv/linux/SUPDrv-linux.o
/usr/share/virtualbox/src/vboxdrv/linux/SUPDrv-linux.c: In function ‘VBoxDrvLinuxCreate’:
/usr/share/virtualbox/src/vboxdrv/linux/SUPDrv-linux.c:706: error: ‘struct task_struct’ has no member named ‘euid’
/usr/share/virtualbox/src/vboxdrv/linux/SUPDrv-linux.c:719: error: ‘struct task_struct’ has no member named ‘uid’
/usr/share/virtualbox/src/vboxdrv/linux/SUPDrv-linux.c:720: error: ‘struct task_struct’ has no member named ‘gid’
make[3]: *** [/usr/share/virtualbox/src/vboxdrv/linux/SUPDrv-linux.o] Error 1
make[2]: *** [_module_/usr/share/virtualbox/src/vboxdrv] Error 2
make[2]: Leaving directory `/usr/src/linux-2.6.28-git5'
make[1]: *** [vboxdrv] Error 2
make[1]: Leaving directory `/usr/share/virtualbox/src/vboxdrv'
make: *** [all] Error 2
Posts: 10Joined: 10. Nov 2007, 02:47Location: Halesowen, W. Midlands, UK
by » 4. Jan 2009, 02:34
Code:--- a/vboxdrv/linux/SUPDrv-linux.c 2008-12-29 16:15:53.000000000 +0000
+++ b/vboxdrv/linux/SUPDrv-linux.c 2009-01-04 00:02:20.346070537 +0000
@@ -703,7 +703,7 @@
/*
* Only root is allowed to access the device, enforce it!
*/
- if (current->euid != 0 /* root */ )
+ if (current->cred->euid != 0 /* root */ )
{
Log(("VBoxDrvLinuxCreate: euid=%d, expected 0 (root)\n", current->euid));
return -EPERM;
@@ -716,8 +716,8 @@
rc = supdrvCreateSession(&g_DevExt, true /* fUser */, (PSUPDRVSESSION *)&pSession);
if (!rc)
{
- pSession->Uid = current->uid;
- pSession->Gid = current->gid;
+ pSession->Uid = current->cred->uid;
+ pSession->Gid = current->cred->gid;
}
pFilp->private_data = pSession;
Posts: 2Joined: 4. Jan 2009, 02:03
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
I've made a quick fglrx 9.3 patch for 2.6.29 kernel, already tested under 2.6.29.2 kernel.
to install fglrx:
1. download and install ati 9.3 driver, you will see fglrx errors during "post processing kernel modules ..."
2. put install_patch.sh and 2.6.29.x_fglrx-9.3.patch somewhere in a diretory
3. sh install_patch.sh
2.6.29.x_fglrx-9.3.patch:
Code:
--- build_mod/firegl_public.c2009-03-18 23:07:22.000000000 +0800
+++ build_mod_new/firegl_public.c2009-05-01 12:21:32.000000000 +0800
@@ -225,7 +225,7 @@
#endif
#ifdef MODULE_LICENSE
-MODULE_LICENSE("Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY");
+MODULE_LICENSE("GPL");
#endif
#ifdef MODULE_DEVICE_TABLE
MODULE_DEVICE_TABLE(pci, fglrx_pci_table);
@@ -1402,7 +1402,7 @@
*/
KCL_TYPE_Uid ATI_API_CALL KCL_GetEffectiveUid(void)
{
- return current->euid;
+ return current->cred->euid;
}
/** /brief Delay execution for the specified number of microseconds
@@ -1776,11 +1776,11 @@
{
if (lock == 0 )
{
- cap_lower(current->cap_effective, CAP_IPC_LOCK);
+ cap_lower(*(kernel_cap_t *)¤t->cred->cap_effective, CAP_IPC_LOCK);
}
else
{
- cap_raise(current->cap_effective, CAP_IPC_LOCK);
+ cap_raise(*(kernel_cap_t *)¤t->cred->cap_effective, CAP_IPC_LOCK);
}
return;
}
--- build_mod/kcl_acpi.c2009-03-18 23:07:22.000000000 +0800
+++ build_mod_new/kcl_acpi.c2009-05-01 12:21:32.000000000 +0800
@@ -21,6 +21,9 @@
#include "kcl_config.h"
#include "kcl_type.h"
#include "kcl_acpi.h"
+#include "../acconfig.h"
+#include "../aclocal.h"
+#include "../acobject.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)install_patch.sh:
Code:
#!/bin/bash
PATCHPATH=$(pwd)
KERNV=$(uname -r)
MODPATH=/lib/modules
KERNPATH=/usr/src/linux
echo -e "Installing patch ..."
cd $MODPATH/fglrx
cp $KERNPATH/drivers/acpi/acpica/{acconfig.h,aclocal.h,acobject.h} build_mod/
patch -Np0 < $PATCHPATH/2.6.29.x_fglrx-9.3.patch
cd $MODPATH/fglrx/build_mod
sh make.sh
cd ..
sh make_install.sh
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++
最佳答案
我原来遇到过,记录到我blog的文章
软件环境:2.6.17.14内核版本,在kernel.org上下载后,开始制作arm和x86的交叉编译环境,最后写了一个驱动的demo测试,发现在进行编译驱动的demo的时候,一直报错:
Makefile:438: .config: No such file or directory
于是在内核里随便找了个缺少的文件cp arch/arm/configs/s3c2410_defconfig ./.config
然后再make,接着报错:
huyongfu@huyongfu-desktop:~/Develop_Src/char_dev/module$ make
make -C /home/huyongfu/cross_complie/linux-2.6.17.14 SUBDIRS=/home/huyongfu/Develop_Src/char_dev/module modules
make[1]: Entering directory `/home/huyongfu/cross_complie/linux-2.6.17.14'
WARNING: Symbol version dump /home/huyongfu/cross_complie/linux-2.6.17.14/Module.symvers
is missing; modules will have no dependencies and modversions.
Building modules, stage 2.
MODPOST
/bin/sh: scripts/mod/modpost: No such file or directory
make[2]: *** [__modpost] Error 127
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/huyongfu/cross_complie/linux-2.6.17.14'
make: *** [modules] Error 2
这个问题还从来没有遇到过,原来编译内核的时候也没有这种错误,有的网站上说:“在内核下,先执行make modules_prepare,执行完毕再进行make”
我认为这并不是解决该问题的本质原因,导致这个问题的原因是modpost这个可执行文件没有生成,到目录下
%linux/scripts/mod下查看并没有这个文件,所以错误提示:No such file or
directory,问题出在编译内核的过程中。因此把内核重新解包,修改makefile,然后重新进行编译,发现这次编译内核的时间明显比上次长,而
且生成zImage的文件也比上次的大,但是上次编译的时候makefile确实没有报错误,而且还提示zImage is
already,所以有时候不要相信编译器,编译器不报错不等于没错,最相信的还是自己,根据现象找出本质。这个问题也折磨了我两个小时。
编译完内核后再去make我的驱动demo:
huyongfu@huyongfu-desktop:~/Develop_Src/char_dev/module$ make
make -C /home/huyongfu/cross_complie/linux-2.6.17.14 SUBDIRS=/home/huyongfu/Develop_Src/char_dev/module modules
make[1]: Entering directory `/home/huyongfu/cross_complie/linux-2.6.17.14'
CC [M] /home/huyongfu/Develop_Src/char_dev/module/char_dev_example.o
Building modules, stage 2.
MODPOST
CC /home/huyongfu/Develop_Src/char_dev/module/char_dev_example.mod.o
LD [M] /home/huyongfu/Develop_Src/char_dev/module/char_dev_example.ko
make[1]: Leaving directory `/home/huyongfu/cross_complie/linux-2.6.17.14'
已经编译通过。
那么modpos这个文件缺少了,直接导致驱动编译失败,那么这个文件的作用是什么呢?从编译的过程日志中可以看到,他的作用应该是就爱嗯.o文件转成.ko文件的,这样我们用.ko文件才能去内核里insmod。
linux安装ati工具,安装ati驱动的辛苦历程相关推荐
- [linux小水滴]工具安装与使用
目录 1 vim相关 2 vs code 2.1 快捷键 批量修改变量名 内部调用terminal 页面快速放大/缩小 查找文件中的warning和error tab缩进 切换标签页 快捷分页 快速打 ...
- linux 之 nc 工具安装使用教程
nc工具简介: 全名 Ncat 7.50 ( https://nmap.org/ncat ) 在网络工具中有"瑞士军刀"美誉,其有Windows和Linux的版本.因为它短小精悍, ...
- Linux下rar工具安装及常用命令
linux中默认的tar命令用于解压压缩文件,但是tar命令不支持rar文件的解压和压缩,需要安装rar解压工具,实现rar命令解压rar压缩包. 1.下载rarlab软件 官网下载页面:https: ...
- Windows10安装fiddler工具安装证书失败总结手机抓包总结
引言:最近在学习python自动化框架的学习,首先第一步需要学习Web协议.简单的抓包工具.python基础语法.测试框架unittest.pytest等等.今天安装了fiddle4版本,安装证书没有 ...
- linux安装ati工具,安装ATIforlinux显卡驱动
安装ATI for linux 显卡驱动 注意安装:gcc,kernel-source, make compat-expat1--注意:10.0不用装这个包,10.1需要这个包提供文件 libexpa ...
- linux中常见工具安装问题集锦
前言 问题 解决 结尾 前言 经常和服务器打交道的同学,特别是服务器运维和开发的同学,会经常使用到一些工具和命令.然而,有时候一些新机器或者"有待考究的机器"可能啥都没有,就需要我 ...
- linux下dnw工具安装和使用
dnw工具下载链接:https://download.csdn.net/download/lushoumin/10547570 一.安装 1.解压之后,进入dnw-linux文件夹 2.make 3. ...
- 命令行 安装 Gparted 工具安装. linux 磁盘分配工具
首先本地安装 xmanager 插件, 官网 https://www.xshell.com/zh/xmanager/ 用xsheel链接服务器 运行以下命令 # ubuntu sudo apt-get ...
- Linux下7z工具安装
sudo apt-get install p7zip p7zip-full p7zip-rar 使用: 使用7z --help查看使用方法. 解压: 7za X test.7z 转载于:https:/ ...
最新文章
- WCF技术剖析之十四:泛型数据契约和集合数据契约(下篇)
- matlab基本运算实验报告,实验2 Matlab的基本运算实验报告
- Spring Security使用
- From AlphaGo Zero to 2048论文分享
- ***常用的***手段
- scrapy简单爬虫
- QQ 被曝搜集浏览器历史记录;饿了么回应骑手自焚;原锤子团队被合并暂停手机研发;| 极客头条...
- 成为一名斜杠程序员,你还差点什么?
- java actor和线程有什么区别_java – 在Akka Actors中使用OpenGL:保证单个线程用于特定的actor...
- js 多维数组 应用
- Spring操作数据库几十次后就JDBC begin transaction failed
- linux卸载jdk,安装jdk
- 自动阅读专业版第七次更新---原薅羊毛专业版
- beamer插入图片_在beamer中插入动画
- 学python要有多少英语词汇量_英文总共20万个词汇量!学好英文,到底要背多少单词才够用?...
- 用Html5制作 汤姆猫 小游戏
- 软件开发过程与项目管理(16.项目结束)
- H5实现无插件视频监控按需直播
- i3-1125G4 怎么样 相当于什么水平
- Android聊天软件界面开发
热门文章
- php 中英文查询字数,php统计中英文混合的文章字数
- java对银行卡号、手机号码、身份证号码进行脱敏
- tcpip Socket编程入门
- 第一台数字电子计算机占地面积为,计算机应用基础教学课件作者刘凤第1章.ppt...
- 微信开发修改button里的字体大小_在微信小程序中如何修改文字大小
- call 和 apply 方法
- 与开发“斗智斗勇”的小技巧
- 青藤 #44 比例简化
- Altium Designer 20新手上路(一)常见网站及插件推荐
- 椭圆一般方程求解椭圆标准方程参数