嵌入式Linux下3G模块的驱动和应用
嵌入式Linux下AD驱动程序的实现与应用

码 的操 作系 统 , 常加 载 于嵌 入 式仪表 设备 中 , 统 一 调 度完成 任 务 。L i n u x系统 内核 的可 裁剪性 、 源 代 码 的开放性 和 易移 植 性 , 使 其 广泛 应 用 于工 业 控 制、 信 息家 电 、 智能 仪表及 军 工设备 等领域 。
率 的 串行 A D转 换 器的 工 作 原 理 , 设计了 s 3 C 2 4 4 0和 A D S 8 3 4 4 E基 于 S P I 的 接 口 电路 , 论 述 了嵌 入 式 L i n u x下 的 A D S 8 3 4 4 E的 驱 动 程序 开 发 和 编 译 加 载 过 程 , 编 写 了相 应 的 驱 动 程 序 和 采 集 系统 的 测 试 程
序 。该 驱 动 已用 于 湿 气 流 量信 号采 集 系统 中 , 测 试 结 果表 明 : 驱动工作正常 , 各 通 道 的 采 样 结 果 正确 。
关 键 词 AD S 8 3 4 4 E AR M9 驱动程序 L i n u x操 作 系统 S P I
中 图分 类 号
T H 8 1 4
1 . 4 硬 件接 口
输方 式 的 1 6位 模数 转换 器 A D S 8 3 4 4 E进行 扩展 。
S P 1 是 由摩托 罗拉公 司开 发 的全 双 工 串行 同步通
信 协议 , 主设备 和从 设 备通 过 同步 通信 完 成 数 据
交换 。因其 时序结 构简单 、 传输 稳定 高效 , 在 数 字
高工 作频 率为 5 3 3 MH z , 可满足 嵌入式 仪表 设备 的 高性 能需求 。¥ 3 C 2 4 4 0芯片提 供 了丰 富 的 内部 资源 , 支持 J T A G仿真 器 调试 。处 理 器 支持 L i n u x 及 Wi n d o w s C E等 操作 系统 , 可扩展 能力 强 。嵌 入 式L i n u x 操 作 系统是一 种 稳定 、 高效 、 可 靠 的软 件 管 理 系统 , 可 进 行 多任 务 之 间 的调 度 和 管 理 。设
嵌入式linux操作系统原理与应用

嵌入式Linux操作系统是一种针对嵌入式设备设计和优化的Linux操作系统。
它在嵌入式系统中发挥着关键作用,为嵌入式设备提供了丰富的功能和灵活性。
以下是嵌入式Linux操作系统的原理和应用方面的概述:嵌入式Linux操作系统原理:内核:嵌入式Linux操作系统的核心是Linux内核,它提供了操作系统的基本功能,包括处理器管理、内存管理、设备驱动程序、文件系统和网络协议栈等。
裁剪:为了适应嵌入式设备的资源限制,嵌入式Linux操作系统通常经过裁剪和优化,只选择必要的功能和驱动程序,以减小内存占用和存储空间,并提高性能和响应速度。
交叉编译:由于嵌入式设备通常具有不同的硬件架构和处理器,所以嵌入式Linux操作系统需要通过交叉编译来生成适用于目标设备的可执行文件和库。
设备驱动:嵌入式Linux操作系统需要适配各种硬件设备,因此需要编写和集成相应的设备驱动程序,以使操作系统能够正确地与硬件进行通信和交互。
嵌入式Linux操作系统应用:嵌入式设备:嵌入式Linux操作系统广泛应用于各种嵌入式设备,如智能手机、平板电脑、家用电器、工业控制系统、车载设备等。
物联网(IoT):随着物联网的快速发展,嵌入式Linux操作系统被广泛应用于连接的嵌入式设备,用于数据采集、通信、远程控制和智能化管理。
嵌入式开发板:嵌入式Linux操作系统在开发板上提供了丰富的开发环境和工具链,用于嵌入式软件开发和调试。
自定义嵌入式系统:开发者可以基于嵌入式Linux操作系统构建自定义的嵌入式系统,根据特定需求进行定制和开发,实现各种功能和应用。
嵌入式Linux操作系统的原理和应用非常广泛,它为嵌入式设备提供了灵活性、可定制性和强大的功能支持,使得开发者能够构建高度定制化和功能丰富的嵌入式系统。
嵌入式Linux驱动开发教程PDF

嵌入式Linux驱动开发教程PDF嵌入式Linux驱动开发教程是一本非常重要和实用的教材,它主要介绍了如何在Linux操作系统上开发嵌入式硬件设备的驱动程序。
嵌入式系统是指将计算机系统集成到其他设备或系统中的特定应用领域中。
嵌入式设备的驱动程序是连接操作系统和硬件设备的关键接口,所以对于嵌入式Linux驱动开发的学习和理解非常重要。
嵌入式Linux驱动开发教程通常包括以下几个主要的内容:1. Linux驱动程序的基础知识:介绍了Linux设备模型、Linux内核模块、字符设备驱动、块设备驱动等基本概念和原理。
2. Linux驱动编程的基本步骤:讲解了如何编译和加载Linux内核模块,以及编写和注册设备驱动程序所需的基本代码。
3. 设备驱动的数据传输和操作:阐述了如何通过驱动程序与硬件设备进行数据的传输和操作,包括读写寄存器、中断处理以及与其他设备的通信等。
4. 设备驱动的调试和测试:介绍了常用的驱动调试和测试技术,包括使用调试器进行驱动程序的调试、使用模拟器进行驱动程序的测试、使用硬件调试工具进行硬件和驱动的联合调试等。
通常,嵌入式Linux驱动开发教程的PDF版本会提供示例代码、实验步骤和详细的说明,以帮助读者更好地理解和掌握嵌入式Linux驱动开发的核心技术和要点。
读者可以通过跟随教程中的示例代码进行实际操作和实验,深入了解和体验嵌入式Linux驱动开发的过程和方法。
总之,嵌入式Linux驱动开发教程是一本非常重要和实用的教材,对于想要在嵌入式领域从事驱动开发工作的人员来说,具有非常重要的指导作用。
通过学习嵌入式Linux驱动开发教程,读者可以系统地了解和学习嵌入式Linux驱动开发的基本原理和技术,提高自己在嵌入式Linux驱动开发方面的能力和水平。
linux 模块驱动存放路径

linux 模块驱动存放路径Linux模块驱动存放路径主要是指Linux操作系统中存放内核模块(.ko文件)的路径。
内核模块是一种能够动态加载和卸载的Linux内核扩展,它们可以为内核添加新的功能或者驱动外部设备,提供更好的系统调节和扩展性。
在Linux系统启动或者在需要时,内核会自动加载相应的模块。
Linux模块驱动存放路径可以有多个,具体的路径和命名规则可能会根据不同的Linux发行版而有所差异。
以下是一些常见的路径:1. /lib/modules/`uname -r`:这是Linux系统中默认的模块存放路径,`uname -r`会替换为当前正在运行的内核版本号。
这个路径下按照内核版本号不同,会有不同的目录,每个目录下放置对应内核版本的模块。
2. /usr/lib/modules/`uname -r`:一些Linux发行版(如Debian、Ubuntu)使用这个路径作为模块存放位置,命名规则和上述路径相同。
3. /lib/modules/:这个路径下可能会包含多个内核版本的模块,每个内核版本有一个对应的目录,模块文件存放在各自的目录下。
4. /usr/local/lib/modules/:一些非官方或自定义的内核模块可能会被安装到这个路径,以避免与系统默认的模块冲突。
在存放路径中,一般会包含多个目录,每个目录可能对应一个或多个内核版本,其中常见的子目录有:1. build/:这个目录包含内核源码,可以用于编译模块。
2. kernel/:这个目录下存放已编译的内核模块文件(.ko)。
3. source/:这个目录中存放内核模块的源代码。
在模块驱动存放路径中,每个模块通常有一个对应的源代码文件(.c或.cpp)和一个已编译的模块文件(.ko)。
模块的源代码文件负责实现模块的功能和驱动逻辑,而模块文件则包含了已编译的二进制代码,可以被内核动态加载和卸载。
除了模块文件之外,存放路径中可能还包含一些其他的文件,如:1. Module.symvers:该文件包含了编译模块时使用的符号表,用于和内核中的符号进行匹配。
如何在Linux系统中安装驱动程序

如何在Linux系统中安装驱动程序Linux系统作为一个开源的操作系统,广泛应用于各种设备和领域。
而安装驱动程序是在Linux系统中使用外部硬件设备的关键步骤之一。
在本文中,我们将学习如何在Linux系统中安装驱动程序的方法和步骤。
1. 检查硬件设备在安装驱动程序之前,首先需要确定硬件设备的型号和制造商。
可以通过查询设备的型号或者查看设备的相关文档来获取这些信息。
这是非常重要的,因为不同的设备可能需要不同的驱动程序来正确地工作。
2. 更新系统在安装驱动程序之前,确保你的Linux系统已经是最新的状态。
可以通过在终端中运行以下命令来更新系统:```sudo apt-get updatesudo apt-get upgrade```更新系统可以确保你拥有最新的软件包和驱动程序,以获得更好的兼容性和性能。
3. 查找合适的驱动程序一般来说,大部分硬件设备的驱动程序都可以在Linux系统的软件仓库中找到。
可以通过使用包管理器(如apt、yum等)来查找并安装合适的驱动程序。
运行以下命令来搜索并安装特定的驱动程序:```sudo apt-cache search 驱动程序名称sudo apt-get install 驱动程序名称```注意替换“驱动程序名称”为具体的驱动程序名称。
安装驱动程序可能需要输入管理员密码和确认安装。
如果你无法在软件仓库中找到合适的驱动程序,可以转向设备的制造商网站或者开源社区来获取。
下载驱动程序后,根据驱动程序提供的文档和说明来安装。
4. 编译和安装驱动程序有些驱动程序可能需要手动编译和安装。
在这种情况下,你需要确保你的系统已经安装了编译工具(如GCC、make等)。
在终端中切换到驱动程序所在的目录,并按照以下步骤进行编译和安装:```./configuremakesudo make install```以上命令将分别进行配置、编译和安装驱动程序。
在进行安装之前,可能需要输入一些配置选项或者确认安装。
嵌入式Linux下GPIO驱动程序的开发及应用

第28卷第4期增刊 2007年4月仪 器 仪 表 学 报Chinese Jour nal of Scientif ic InstrumentVol.28No.4Apr.2007 嵌入式L inux 下GPIO 驱动程序的开发及应用3何 泉,贺玉梅(北京化工大学信息科学与技术学院 北京 100029)摘 要:嵌入式Linux 是一种适用于嵌入式系统的源码开放的占先式实时多任务操作系统,是目前操作系统领域中的一个热点,其重点与难点是驱动程序的开发。
开发嵌人式Linux 下的设备驱动程序,可以更好地利用新硬件特性,提高系统访问硬件的效率,改善整个应用系统的性能。
驱动程序修改非常方便,使应用系统非常灵活。
本文简要论述了基于A TM E L 公司嵌入式ARM 处理器芯片的嵌入式Linux 的GP IO 驱动程序的开发原理及流程。
关键词:嵌入式Linux ;ARM ;驱动程序;设备文件;GPIOInvest igat ion an d a pplicat ion of GP IO dr iver in t he embedded L inuxHe Quan ,He YuMei(School of I nf orma tion Science and Tec hnology BU CT ,Beij ing 100029,China )Abstract :Embedded Linu x ,w hich i s a full y real 2time kernel and applicable to embedded syst ems ,has bec o me a hot s 2po t in t he do main of op erati ng system at present.It s out line and difficult y is to investigat e drivers.Developi ng device dri vers o n embedded Lin ux can help using t he new devices ,and imp rovi ng t he e fficiency of access to t he new devices and t he p erformance cap abilit y.As drivers can be changed easil y ,t he system is very convenient and flexi ble.Thi s p a 2p er simpl y point s o ut t he element s and flow of t he GPIO driver in t he embedded Linux based o n t he A RM proces sor of A TMEL system.Key words :embedded Li nux ;A RM ;driver ;device file ;GPIO 3基金项目国家自然科学基金(6)、北京化工大学青年教师自然科学研究基金(QN 58)资助项目1 引 言随着半导体技术的飞速发展,嵌入式产品已经广泛应用于军事、消费电子、网络通信、工业控制等各个领域,这是嵌入式系统发展的必然趋势。
嵌入式Linux下ADC的驱动程序实现与应用

嵌入式Linux下ADC的驱动程序实现与应用作者:孙德辉梁鑫杨扬来源:《现代电子技术》2008年第22期摘要:详细介绍S3C2410芯片ADC模块以及Linux的驱动模型,并且通过S3C2410内置的ADC驱动程序设计说明字符型设备驱动开发方法;将驱动编译为模块的方式,单独加载入内核,便于调试。
以MINICOM为操作台,控制驱动模块的加载和应用程序的运行。
并通过实例介绍ADC驱动程序在电阻、电压等测试中的实际应用;从实验结果可以看出ADC驱动可以被成功加载和调用;该驱动可以测试电压、电流等标准工程量信号,或作为工业传感器接口的一部分对现场标准工程量信号进行采集处理。
关键词:S3C2410;ADC;Linux;字符设备驱动程序中图分类号:TP311文献标识码:B文章编号:1004373X(2008)2203303Implement and Application of ADC Driver about Embedded-LinuxSUN Dehui,LIANG Xin,YANG Yang(Key Laboratory of Beijing Municipality,The FAT Laboratory,North China University of Technology,Beijing,100041,China)Abstract:The module of ADC in S3C2410 CMOS chip and the model about Linux drivers are expounded,the method of developing character device drivers are illuminated by realizing an ADC driver.As convenient to debug,compiling the drivers into module and "insmod" it into kernel.Updating the drivers module and application by MINICOM,one kind of consoles.Application on testing resistance and voltage using ADC driver are introduced through an example.In the end,it is obviously that ADC drivers module could be "insmoded"and called successful from the result of ing the drivers testing resistance,voltage and many other standard signal.ADC drivers can collect the standard signal of plants as one part of interface of industrial sensor.Keywords:S3C2410;ADC;Linux;character device driver1 引言S3C2410开发板制造商提供了绝大部分的驱动程序,但有时出于实际开发的需要、应用程序的稳定性考虑,用户往往需要开发一个自己需要的接口驱动程序。
基于嵌入式Linux的3G无线视频终端的设计与实现

基于嵌入式Linux 的3G 无线视频终端的设计与实现何苏勤,张俊(北京化工大学信息科学与技术学院,北京100029)摘要:基于嵌入式系统开发以及3G 相关技术,采用ARM+Linux 作为软硬件开发平台,充分利用了ARM 以及Linux 系统丰富的软硬件资源,设计并实现了一个基于嵌入式Linux 的3G 无线视频终端。
在软件设计上,采用了Linux 的Netfilter 架构与socket 结合的方法,引入内核缓冲机制,达到了将数据包获取功能由用户态转入内核态,实现了数据包在Linux 内核态的获取及高效转发,并且解决了3G 模块因拨号延迟与视频服务器产生速率不匹配所造成的数据丢包问题,同时在嵌入式Linux 下为3G 模块开发了驱动。
关键词:嵌入式Linux ;3G ;Netfilter ;无线终端;套接字中图分类号:TN925文献标识码:A文章编号:1674-6236(2011)07-0057-05Design and implementation of 3G wireless video terminal based on embedded LinuxHE Su -qin ,ZHANG Jun(College of Information Science and Technology ,Beijing University of Chemical Technology ,Beijing 100029,China )Abstract :Based on embedded system ’s development and 3G related technology ,using ARM+Linux as the software and hardware development platform ,and taking full advantage of ARM +Linux software and hardware resources ,a 3G wireless video terminals based on embedded Linux was designed and implemented.In software design ,the Linux ’s Netfilter framework combined with socket was used ,Linux kernel buffer mechanism was introduced ,it achieved the function of data packet get from user mode into kernel mode.realized data packet achieving and efficient transmission ,and solved the problem of time delay between video server and 3G module ,meanwhile ,a 3G module driver was developed.Key words :embedded -Linux ;3G ;Netfilter ;wireless terminal ;socket随着网络技术和嵌入式技术的迅猛发展,通过网络来实现视频监控已经得到了广泛的应用,3G 网络以其高带宽使得传输流畅的视频信息成为可能,本文在采用3G 技术的基础上设计了一款基于嵌入式Linux 的无线终端,在数据处理部分采用了Linux 的Netfilter 架构[1],通过挂载钩子函数来实现数据包在内核态的获取及高效转发,并且通过在Linux 内核开辟一片缓冲区,解决了视频服务器与3G 模块拨号延时而造成的速率不匹配的问题,减少了数据丢包。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
嵌入式Linux下3G模块的驱动和应用1、开发资源1.1、硬件资源:ZTE-mf637u(中国联通)ZTE-mu351(中国移动)1.2、软件资源:1.2.1、usb-modeswitch-1.1.3libusb-0.1.12.tar.gzusb-modeswitch-1.1.3.tar.bz21.2.2、ppp-2.4.4libpcap-0.9.8.tar.gzppp-2.4.4.tar.gz1.2.3、wvdial1.2.3.1、wvdial-1.54.0(arm-linux-gcc 3.4.1) zlib-1.2.5.tar.bz2openssl-0.9.7g.tar.gzopenssl-0.9.7g-fix_manpages-1.patch wvstreams-4.0.1.tar.bz2wvstreams-4.0.1-tcl84-1.patchwvdial-1.54.0.tar.gz1.2.3.2、wvdial_1.60.4(arm-linux-gcc 4.2.2)zlib-1.2.5.tar.bz2openssl-0.9.8n.tar.gzopenssl-0.9.8n-fix_manpages-1.patchwvstreams-4.6.1.tar.gzwvdial_1.60.4.tar.gz2、Linux开发环境2.1、主机环境2.1.1、主机linux系统Fedora Core 62.1.2、主机编译环境2.1.2.1、gcc -vUsing built-in specs.Target: i386-redhat-linuxConfigured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix--enable-checking=release --with-system-zlib --enable-__cxa_atexit--disable-libunwind-exceptions --enable-libgcj-multifile--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk--disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre--with-cpu=generic --host=i386-redhat-linuxThread model: posixgcc version 4.1.1 20061011 (Red Hat 4.1.1-30)2.1.2.2、/usr/local/arm/3.4.1/bin/arm-linux-gcc -vReading specs from /usr/local/arm/3.4.1/lib/gcc/arm-linux/3.4.1/specsConfigured with:/work/crosstool-0.27/build/arm-linux/gcc-3.4.1-glibc-2.3.2/gcc-3.4.1/configure--target=arm-linux --host=i686-host_pc-linux-gnu --prefix=/usr/local/arm/3.4.1--with-headers=/usr/local/arm/3.4.1/arm-linux/include--with-local-prefix=/usr/local/arm/3.4.1/arm-linux --disable-nls --enable-threads=posix--enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-longThread model: posixgcc version 3.4.12.1.2.3、/usr/local/arm/4.2.2/usr/bin/arm-linux-gcc -vUsing built-in specs.Target: arm-unknown-linux-gnueabiConfigured with:/home/scsuh/workplace/coffee/buildroot-20071011/toolchain_build_arm/gcc-4.2.2/configu re --prefix=/usr --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu--target=arm-unknown-linux-gnueabi --enable-languages=c,c++--with-sysroot=/usr/local/arm/4.2.2-eabi/--with-build-time-tools=/usr/local/arm/4.2.2-eabi//usr/arm-unknown-linux-gnueabi/bin --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --enable-shared--with-gmp=/usr/local/arm/4.2.2-eabi//gmp --with-mpfr=/usr/local/arm/4.2.2-eabi//mpfr --disable-nls --enable-threads --disable-multilib --disable-largefile --with-arch=armv4t --with-float=soft --enable-cxx-flags=-msoft-floatThread model: posixgcc version 4.2.22.2、开发板环境2.2.1、CES-6410开发平台Samsung S3C6410X, ARM1176JZF-S128MB, Mobile DDR SDRAMUSB HOST:一个USB HOST 接口,USB2.0全速(12Mbits/s)3、Linux应用软件的编译3.1、usb-modeswitch-1.1.3[root@localhost cdma]# tar xzf libusb-0.1.12.tar.gz[root@localhost cdma]# cp libusb-0.1.12 libusb-0.1.12-arm[root@localhost cdma]# cd libusb-0.1.12-arm[root@localhost libusb-0.1.12-arm]#./configure --prefix=/works/cdma/install--host=arm-linux CC=arm-linux-gcc CXX=arm-linux-g++[root@localhost libusb-0.1.12-arm]# make[root@localhost libusb-0.1.12-arm]# make install[root@localhost libusb-0.1.12-arm]# cd ..[root@localhost cdma]# tar xjf usb-modeswitch-1.1.3.tar.bz2[root@localhost cdma]# cp usb-modeswitch-1.1.3 usb-modeswitch-1.1.3-arm [root@localhost cdma]# cd usb-modeswitch-1.1.3-arm[root@localhost usb-modeswitch-1.1.3-arm]#修改MakefileCC = gcc改为CC = arm-linux-gccCFLAGS += -Wall -l usb改为CFLAGS += -Wall -l usb -I/works/cdma/install/include -L/works/cdma/install/lib 修改usb_modeswitch.c// readConfigFile("/etc/usb_modeswitch.setup");改为readConfigFile("/etc/usb_modeswitch.setup");[root@localhost usb-modeswitch-1.1.3-arm]# make[root@localhost usb-modeswitch-1.1.3-arm]# make install[root@localhost usb-modeswitch-1.1.3-arm]# cd ..[root@localhost cdma]#3.2、ppp-2.4.4[root@localhost cdma]# tar xzf libpcap-0.9.8.tar.gz[root@localhost cdma]# cp libpcap-0.9.8 libpcap-0.9.8-arm[root@localhost libpcap-0.9.8-arm]# ./configure --prefix=/works/cdma/install --host=arm-linux --with-pcapmake: *** No rule to make target `pcap-yes.o', needed by `libpcap.a'. Stop.修改MakefilePSRC = pcap-yes.c改为PSRC = pcap-linux.c[root@localhost libpcap-0.9.8-arm]# make[root@localhost libpcap-0.9.8-arm]# make install[root@localhost libpcap-0.9.8-arm]# cd ..[root@localhost cdma]# tar xzvf ppp-2.4.4.tar.gz[root@localhost cdma]# cd ppp-2.4.4[root@localhost ppp-2.4.4]# ./configure --host=arm-linuxvi pppd/MakefileLIBS += -lpcapCFLAGS += -DPPP_FILTER改为LIBS += -lpcap -L../../libpcap-0.9.8CFLAGS += -DPPP_FILTER -I../../libpcap-0.9.8[root@localhost ppp-2.4.4]# make CC=arm-linux-gcc3.3、wvdial3.3.1、wvdial-1.54.0[root@localhost wvdial-1.54.0]# export PATH=/usr/local/arm/3.4.1/bin:$PATH [root@localhost wvdial-1.54.0]# tar xjf zlib-1.2.5.tar.bz2[root@localhost wvdial-1.54.0]# cd zlib-1.2.5[root@localhost zlib-1.2.5]#./configure --prefix=/works/wvdial-1.54.0/install修改MakefileCC = arm-linux-gccCPP=arm-linux-gcc -EAR=arm-linux-ar rcRANLIB=arm-linux-ranlib[root@localhost zlib-1.2.5]# make[root@localhost zlib-1.2.5]# make install[root@localhost wvdial-1.54.0]# tar xzf openssl-0.9.7g.tar.gz[root@localhost wvdial-1.54.0]# cd openssl-0.9.7g[root@localhost openssl-0.9.7g]# patch -Np1-i ../openssl-0.9.7g-fix_manpages-1.patch[root@localhost openssl-0.9.7g]#./Configure --prefix=/works/wvdial-1.54.0/install os/compiler:arm-linux-gcc[root@localhost openssl-0.9.7g]# make[root@localhost openssl-0.9.7g]# make install[root@localhost openssl-0.9.7g]# cd ..[root@localhost wvdial-1.54.0]# tar xjf wvstreams-4.0.1.tar.bz2[root@localhost wvdial-1.54.0]# cd wvstreams-4.0.1[root@localhost wvstreams-4.0.1]# patch -Np1 -i ../wvstreams-4.0.1-tcl84-1.patch修改configurewith_openssl=no改为with_openssl=yes(有两处)[root@localhost wvstreams-4.0.1]# ./configure --prefix=/works/wvdial-1.54.0/install --host=arm-linux CFLAGS=-I/works/cdma/install/includeLDFLAGS=-L/works/cdma/install/lib/ --with-zlib=/works/cdma/zlib-1.2.5--with-openssl=/works/cdma/openssl-0.9.8n --without-dbus --with-pam=no --with-tcl=no --with-qt=no[root@localhost wvstreams-4.0.1]# makelinking libwvutils.so.../usr/lib/libz.so: could not read symbols: Invalid operationcollect2: ld returned 1 exit statusmake: *** [libwvutils.so] Error 1[root@localhost wvstreams-4.0.1]# arm-linux-gcc -L./xplc -L/works/cdma/install/lib/ -L./xplc -L. -g -Wl,-soname,libwvutils.so.4.0 -shared -o libwvutils.so utils/strcrypt.outils/verstring.o utils/wvaudioencoder.o utils/wvbase64.o utils/wvbdbhash.outils/wvcrash.o utils/wvdiriter.o utils/wvgzip.o utils/wvhashtable.o utils/wvhex.outils/wvmagiccircle.o utils/wvmatrix.o utils/wvqdbmhash.o utils/wvrateadjust.outils/wvserialize.o utils/wvshmzone.o utils/wvstringtable.o utils/wvsubproc.o utils/wvtest.o utils/wvwordwrap.o libwvbase.so -lsupc++ -lgcc_eh[root@localhost wvstreams-4.0.1]# make[root@localhost wvstreams-4.0.1]# vi wvrules.mkXX_LIBS := $(XX_LIBS) $(shell $(CC) -lsupc++ -lgcc_eh 2>&1 | grep -q "undefined reference" && echo " -lsupc++ -lgcc_eh")改为XX_LIBS := $(XX_LIBS) $(shell $(CC) -lsupc++ -lgcc_eh 2>&1 | grep -q "undefined reference" && echo " -lz -lcrypt -lsupc++ -lgcc_eh")[root@localhost wvstreams-4.0.1]# makecompiling crypto/wvtripledes.o...crypto/: In member function `virtual boolWvTripleDESEncoder::_encode(WvBuf&, WvBuf&, bool)':crypto/:108: error: cannot convert `const unsigned char*' to `unsigned char (*)[8]' for argument `1' to `void DES_ecb3_encrypt(unsigned char (*)[8], unsigned char (*)[8], DES_key_schedule*, DES_key_schedule*, DES_key_schedule*, int)'make: *** [crypto/wvtripledes.o] Error 1解决方法:crypto/修改#if OPENSSL_VERSION_NUMBER >= 0x0090705FL改为#if 0compiling crypto/wvx509.o...crypto/: In member function `WvString WvX509Mgr::get_extension(int)': crypto/:1168: error: invalid conversion from `unsigned char**' to `const unsigned char**'crypto/:1171: error: invalid conversion from `unsigned char**' to `const unsigned char**'make: *** [crypto/wvx509.o] Error 1解决方法:crypto/if (method->it)ext_data = ASN1_item_d2i(NULL, &ext->value->data,ext->value->length,ASN1_ITEM_ptr(method->it));elseext_data = method->d2i(NULL, &ext->value->data,ext->value->length);改为if (method->it)ext_data = ASN1_item_d2i(NULL, (const unsigned char**)&ext->value->data,ext->value->length,ASN1_ITEM_ptr(method->it));elseext_data = method->d2i(NULL, (const unsigned char**)&ext->value->data,ext->value->length);compiling streams/wvpam.o...streams/: In member function `bool WvPam::authenticate(constWvFastString&, const WvFastString&, const WvFastString&)':streams/:71: error: `fail' undeclared (first use this function)streams/:71: error: (Each undeclared identifier is reported only oncefor each function it appears in.)make: *** [streams/wvpam.o] Error 1解决方法:return fail;改为return false;[root@localhost wvstreams-4.0.1]# make install[root@localhost wvstreams-4.0.1]# cp libwvutils.so ../install/lib/libwvutils.so.4.0 -a [root@localhost wvstreams-4.0.1]# cd ..[root@localhost wvdial-1.54.0]# tar xzf wvdial-1.54.0.tar.gz[root@localhost wvdial-1.54.0]# cd wvdial-1.54.0[root@localhost wvdial-1.54.0]# cp/works/wvdial-1.54.0/install/include/wvstreams/*.h .[root@localhost wvdial-1.54.0]# vi MakefilePREFIX=/usr/local改为PREFIX=/works/wvdial-1.54.0/installPPPDIR=/etc/ppp/peers改为PPPDIR=${PREFIX}/etc/ppp/peersXPATH=.. ../wvstreams/include $(PKGINC)改为XPATH=/works/wvdial-1.54.0/install/include/wvstreamsLIBS += -L../wvstreams -lwvutils -lwvstreams改为LIBS += -L/works/wvdial-1.54.0/install/lib -lwvutils -lwvstreams -lwvbase -lz[root@localhost wvdial-1.54.0]# vi wvrules.mk增加CC = arm-linux-g++CXX = arm-linux-g++[root@localhost wvdial-1.54.0]# make[root@localhost wvdial-1.54.0]# make install3.3.2、wvdial-1.60.4export PATH=/usr/local/arm/4.2.2-eabi/usr/bin:$PATHtar xjf zlib-1.2.5.tar.bz2cd zlib-1.2.5./configure --prefix=/works/cdma/install-4.2.2修改MakefileCC = arm-linux-gccCPP=arm-linux-gcc -EAR=arm-linux-ar rcLDSHARED=arm-linux-gcc ....RANLIB=arm-linux-ranlibmakemake installopenssl-0.9.8npatch -N -p1 -i ../openssl-0.9.8n-fix_manpages-1.patch./Configure --prefix=/works/cdma/install-4.2.2 os/compiler:arm-linux-gcc makemake installwvstreams-4.6.1修改configurewith_zlib=no改为with_zlib=yes(有两处)with_openssl=no改为with_openssl=yes(有两处)./configure --prefix=/works/cdma/install-4.2.2 --host=arm-linuxCPPFLAGS=-I/works/cdma/install-4.2.2/includeLDFLAGS=-L/works/cdma/zlib-1.2.5-4.2.2 CFLAGS=-I/works/cdma/zlib-1.2.5-4.2.2 --with-zlib=/works/cdma/zlib-1.2.5-4.2.2/--with-openssl=/works/cdma/openssl-0.9.8n-4.2.2 --without-dbus --with-pam=no--with-tcl=no --with-qt=no --without-valgrindmake如果出现undefined reference to"EVP_MD_size"错误将出现错误的语句returnEVP_MD_size((evp_md_st *)evpmd;改成return ((evp_md_st *)evpmd)->md_size;即可make installwvdial-1.60.4修改Makefileprefix=/usr/local改为prefix=/works/cdma/install-4.2.2PPPDIR=/etc/ppp/peers改为PPPDIR=${prefix}/etc/ppp/peersPC_CFLAGS=$(shell pkg-config --cflags libwvstreams)改为PC_CFLAGS=-I/works/cdma/install-4.2.2/include/wvstreamsPC_LIBS=$(shell pkg-config --libs libwvstreams)PC_LIBS=-L/works/cdma/install-4.2.2/lib -lwvstreams -lwvutils -lwvbase修改wvrules.mkWVLINK_CC = gcc改为WVLINK_CC = arm-linux-g++CC = arm-linux-g++CXX = arm-linux-g++makemake install4、Linux内核的配置与修改4.1、linux内核配置make menuconfigDevice Drivers --->[*] Network device support ---><M> PPP (point-to-point protocol) support[*] PPP multilink support (EXPERIMENTAL)[*] PPP filtering<M> PPP support for async serial ports<M> PPP support for sync tty ports<M> PPP Deflate compression<M> PPP MPPE compression (encryption) (EXPERIMENTAL) <M> PPP over Ethernet (EXPERIMENTAL)[*] USB support ---><M> USB Modem (CDC ACM) supportUSB Serial Converter support ---><M> USB driver for GSM and CDMA modems4.2、linux内核修改drivers/usb/serial/option.cstatic struct usb_device_id option_ids[] = {…};在这个数组中添加两项{ USB_DEVICE(0x19d2, 0x0031) },{ USB_DEVICE(0x19d2, 0x0034) },4.3、linux内核编译make zImagemake modules5、3G模块的使用5.1、加载内核模块insmod option.koinsmod cdc-acm.koinsmod slhc.koinsmod ppp_generic.koinsmod pppox.koinsmod pppoe.koinsmod ppp_synctty.koinsmod ppp_deflate.koinsmod crc-ccitt.koinsmod ppp_async.koinsmod sha1_generic.koinsmod ppp_mppe.ko5.2、加载USB文件系统mount -t usbfs usbfs /proc/bus/usb5.3、ZTE-mf637u(中国联通)的使用5.3.1、配置文件/etc/usb_modeswitch.setup# Configuration for the usb-modeswitch package, a mode switching tool for # USB devices providing multiple states or modes## This file is evaluated by the wrapper script "usb_modeswitch" in /lib/udev # To enable an option, set it to "1", "yes" or "true" (case doesn't matter)# Everything else counts as "disable"# Disable automatic mode switching globally (e.g. to access the original # install storage)DisableSwitching=0# Enable logging (results in a extensive report file in /var/log, named# "usb_modeswitch_<interface-name>"EnableLogging=0######################################################## # ZTE MF622 (aka "Onda MDC502HS")# ZTE MF626# ZTE MF628+ (tested version from Telia / Sweden)# ZTE MF633# ZTE MF636 (aka "Telstra / BigPond 7.2 Mobile Card")# ZTE MF637# Contributor: Joakim Wennergren and othersDefaultVendor= 0x19d2DefaultProduct= 0x2000TargetVendor= 0x19d2TargetProduct= 0x0031MessageContent="5553424312345678000000000000061b0000000200000000000 00000000000"MessageContent2="5553424312345678000000000000061b000000030000000000 000000000000"NeedResponse=15.3.2、配置文件/etc/wvdial.conf[Dialer Defaults]Modem = /dev/ttyUSB2Init1 = ATZInit3 = ATE0V1Init5 = ATS0=0Init6 = AT+CGDCONT=1,"IP","uninet" Init7 = AT+CFUN=1Modem Type = USB ModemBaud = 460800New PPPD = yesISDN = 0Phone = *99***1#Password = anyUsername = anyStupid Mode = 15.3.3 ZTE-mf637u(中国联通)的操作步骤5.3.3.1、设置环境变量export PATH= /works/wvdial-1.54.0/install/bin: /works/cdma/install/bin :$PATHexport LD_LIBRARY_PATH= /works/wvdial-1.54.0/install/lib:/works/cdma/install/lib:$LD_LIBRARY_PATH5.3.3.2、插入ZTE-mf637u(中国联通)无线网卡5.3.3.3、等待5秒钟左右、运行usb-modeswitch -W5.3.3.4、运行wvdial--> WvDial: Internet dialer version 1.54.0--> Cannot open /dev/ttyUSB2: Cannot get information for serial port.--> Cannot open /dev/ttyUSB2: Cannot get information for serial port.--> Cannot open /dev/ttyUSB2: Cannot get information for serial port.解决:(两种方法)5.3.3.4.1将wvstreams-4.0.1/streams/#if HAVE_LINUX_SERIAL_H改为#if 05.3.3.4.2. wvstreams-4.0.1的配置命令增加ac_cv_header_linux_serial_h=no即./configure --prefix=/works/wvdial-1.54.0/install --host=arm-linuxCFLAGS=-I/works/cdma/install/include LDFLAGS=-L/works/cdma/install/lib/--with-zlib=/works/cdma/zlib-1.2.5 --with-openssl=/works/cdma/openssl-0.9.8n--without-dbus --with-pam=no --with-tcl=no --with-qt=no ac_cv_header_linux_serial_h=no 重新编译。