osmocombb_编译部署.doc

上传人:re****.1 文档编号:563421540 上传时间:2023-08-20 格式:DOC 页数:6 大小:43KB
返回 下载 相关 举报
osmocombb_编译部署.doc_第1页
第1页 / 共6页
osmocombb_编译部署.doc_第2页
第2页 / 共6页
osmocombb_编译部署.doc_第3页
第3页 / 共6页
osmocombb_编译部署.doc_第4页
第4页 / 共6页
osmocombb_编译部署.doc_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《osmocombb_编译部署.doc》由会员分享,可在线阅读,更多相关《osmocombb_编译部署.doc(6页珍藏版)》请在金锄头文库上搜索。

1、0.OsmocomBB简介 OsmocomBB是GSM协议栈(Protocols stack)的开源实现,全称是Open source mobile communication Baseband.目的是要实现手机端从物理层(layer1)到layer3的三层实现。但是目前来看,真正的物理层(physical layer)并没有真正的开源实现,暂时也没看到实施计划。只有物理层控制。因为真正的物理层是运行在baseband processor的DSP core上,涉及到许多信号处理算法的实现,而且还要牵扯很多硬件RF的东西。 OsmocomBB项目始于2010年,到目前,还没有实时操作系统支持,没

2、有GPRS的实现,以及移动管理(Mobility Management)的实现,所以还需很多志愿者的加入。1.OsmocomBB准备 硬件: a.OsmocomBB支持的手机列表. b.PC机 C.和手机相配的串口线以我个人为例,我从旧货市场上面买了Moto C118,然后从网站上买的T191串口线,当然如果买那种RS232转USB的转换线的话,不要买便宜的,便宜的cable通常不能用于OsmocomBB. 软件: a.Linux操作系统(Ubuntu) b.arm-elf编译器 确保能够编译代码之前,我们需要安装一些软件包,在ubuntu or Debian中运行以下命令:sudo apti

3、tude install libtool shtool autoconf git-core pkg-config make gcc2.获取代码用git来获取代码,在一个目录下,执行以下命令: $ git clone git:/git.osmocom.org/osmocom-bb.git$ cd osmocom-bb $ git pull -rebase 3.设置编译器 如果要编译 Motorora C118,需要ARM7的elf编译器,下面是下载地址:http:/ /opt/gnuarm-3.4.3, 那就在ubuntu的home路径下的.bashrc的最后面加上: export PATH=$

4、PATH:/opt/gnuarm-3.4.3/bin这里执行后没有起作用,好像少执行了一条什么命令?实际是这么做的,直接在终端命令中键入:export PATH=$PATH:/opt/gnuarm-3.4.3/bin 然后用 export 命令显示 PATH 确实更新了。这样就把交叉编译器的路径加到了系统环境变量中了,我们可以在shell中调用编译工具链。4.编译,运行,测试 4.1 编译 Osmocom-bb的主分支(main branch)不支持对SIM卡的读写相关操作,如果要对真实的SIM卡与网络进行试验,必须转 到另外一个分支上去,即sylvain/testing, 我们可以运行以下命

5、令转到这个分支上:$ cd osmocom-bb$ git checkout -b testing remotes/origin/sylvain/testing下一步就是将 $osmocom-bb/src/target/firmwire/下的Makefile中的CONFIG_TX_ENABLE宏打开:# Uncomment this line if you want to enable Tx (Transmit) Support.-#CFLAGS +=-DCONFIG_TX_ENABLE+CFLAGS +=-DCONFIG_TX_ENABLE然后你就可以运行$osmocom-bb/src/目录

6、下的makefile来编译出可以进行实网测试的binary.Make 时,出现的第一个问题: arm-elf-ld: ././shared/libosmocore/build-target/src/.libs/libosmocore.a(msgb.o): Relocations in generic ELF (EM: 3) ././shared/libosmocore/build-target/src/.libs/libosmocore.a: could not read symbols: File in wrong format make1: * board/compal_e88/hello

7、_palram.elf Fehler 1 I found a similar Thread on the mailing list here: http:/baseband- But there is not a solution for the problem I would be happy if anybody would be able to giv a solution. MFG Kandanalor解决方法:With help of the mailing list I realized that first time i tried tocompile I hadnt my cr

8、oss compiler in PATH.A git clean -dfx and make fixed the problemMake时遇到的第二个问题:arm-elf-ld: region LRAM is full (board/compal_e86/palram.elf section .data)make1: * board/compal_e86/palram.elf Error 1make1: Leaving directory src/target/firmwaremake: * firmware Error 2解决方法:Now it works.Ive tried this:I

9、changed ram.lds & highram.lds.ram.lds: LRAM (rw) : ORIGIN = 0x00800000, LENGTH = 0x00015000 IRAM (rw) : ORIGIN = 0x00815000, LENGTH = 0x0000c000highram.lds: LRAM (rw) : ORIGIN = 0x00820000, LENGTH = 0x00015000IRAM (rw) : ORIGIN = 0x00835000, LENGTH = 0x0000c0004.2 运行现在可以通过命令在测试机上运行layer1,以及短按手机上得电源按

10、钮来将layer1的binary加载到手机的RAM中:$cd src/host/osmocon/$ ./osmocon -p /dev/ttyUSB0 -m c123xor ././target/firmware/board/compal_e88/palram.bin现在运行Desktop端的mobile程序,负责layer2,layer3的功能实现,开启新的终端,运行命令如下:$cd src/host/layer23/src/mobile$ ./mobile -i 127.0.0.1还可以用著名的wireshark 1.4来抓取GSM的信令消息,开启新的终端,运行的命令如下:$nc -u -

11、l 4729 /dev/null & 注意:“”必须前后加空格。$ sudo wireshark -k -i lo -f port 4729在开启telnet服务进行手机控制之前,先要建立配置文件/etc/osmocom/osmocom.cfg,用touch命令来建立:$ sudo mkdir /etc/osmocom/$ sudo touch /etc/osmocom/osmocom.cfg运行命令:$ telnet localhost 4247如果telnet连接成功,则有以下输出:Trying 127.0.0.1.Connected to localhost.Escape character is.Welcome to the OpenBSC Control interfaceOsmocomBB这是mobile程序建立的telnet服务,等待客户端去连接,OsmocomBB目前用这个用户接口来控制手机各种功能。在此输入命令:OsmocomBBenableOsmocomBB# sim reader 1运行此命令后,如果观察Wireshark的log输出,我们应该可以看到Location Update 的信令流程。然后还可以通过命令查看SIM卡信息:OsmocomBB# show subscriber如果要打电话,运行以下命令:OsmocomBB# call 1 112

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号