首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

移植LINUX ARM篇(转)(4)

移植LINUX ARM篇(转)(4)

$cd
$cd debug/build-gdbserver
$chmod +x ../../source/gdb-5.2.1/gdb/gdbserver/configure
$CC=arm-linux-gcc ../../source/gdb-5.2.1/gdb/gdbserver/configure --host=$TARGET --prefix=$TARGET_PREFIX
$make
$make install
n=`echo gdbserver | sed 's,x,x,'`; \
if [ x$n = x ]; then n=gdbserver; else true; fi; \
/usr/bin/install -c gdbserver /home/armlinux/tools/arm-linux/bin/$n; \
/usr/bin/install -c -m 644 ../../software/gdb-5.2.1/gdb/gdbserver/gdbserver.1 /home/armlinux/tools/arm-linux/man/man1/$n.1
/usr/bin/install: 无法创建一般文件‘/home/armlinux/tools/arm-linux/bin/gdbserver’: 没有那个文件或目录
/usr/bin/install: 无法创建一般文件‘/home/armlinux/tools/arm-linux/man/man1/gdbserver.1’: 没有那个文件或目录
make: *** [install-only] Error 1
此处错误不难理解,主要是因为交叉编译工具放到/usr/local/arm里面了。前面的安装目录tools里面缺少几个文件夹,只需要建立就可以了。
$cd $PRJROOT/tools
$mkdir arm-linux
$cd arm-linux
$mkdir bin man
$cd man
$mkdir man1
$cd $PRJROOT/debug/build-gdbserver
$make install
这样就没有问题了,当然也可以修改makefile,但是自己还没有学好shell语言,所以采取上述方法解决了。这样首先用strip处理一下,目的是gdbserver不需要附带上调试的信息,把它们都剥离去就是了。
$arm-linux-strip $TARGET_PREFIX/bin/gdbserver/gdbserver
$ls -l $TARGET_PREFIX/bin/
总用量 24
-rwxr-xr-x    1 armlinux armlinux    23132  8月 10 11:33 gdbserver
也就是说,gdbserver经过strip处理之后还剩下23KB多一点,已经挺小了,适合目标板了。
附:
在CU论坛上看到tree工具可以查看目录树,觉得不错。也想要安装一个。下面這個站點已經沒有tree-1.5.0.tgz。
有效的下載地址:http://linus.yhspatriot.net/cs/cs/assignments/q1/introToUnix.html
$cd
$cd source
$ftp mama.indstate.edu
Connected to mama.indstate.edu (139.102.70.201).
220 ProFTPD 1.3.0 Server (ProFTPD Default Installation) [139.102.70.201]
Name (mama.indstate.edu:armlinux): anonymous
331 Anonymous login ok, send your complete email address as your password.
Password:
230 Anonymous access granted, restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd linux/tree
250 CWD command successful
ftp> ls
227 Entering Passive Mode (139,102,70,201,149,53).
150 Opening ASCII mode data connection for file list
drwxr-xr-x   2 root     root         4096 Jun  4  2001 binary
drwxr-xr-x   2 root     root         4096 May 19  1999 slack
-rw-r--r--   1 root     root          406 Oct 11  1996 tree-1.1.lsm
-rw-r--r--   1 root     root        13135 Oct 11  1996 tree-1.1.tgz
-rw-r--r--   1 root     root          405 Jan  6  1997 tree-1.2.lsm
-rw-r--r--   1 root     root        16362 Jan  6  1997 tree-1.2.tgz
-rw-r--r--   1 root     root          436 Feb 21  2002 tree-1.3.lsm
-rw-r--r--   1 root     root        25060 Feb 21  2002 tree-1.3.tgz
-rw-r--r--   1 root     root          432 Feb 21  2002 tree-1.4b1.lsm
-rw-r--r--   1 root     root        27536 Feb 21  2002 tree-1.4b1.tgz
-rw-r--r--   1 root     root        27891 Mar 25  2002 tree-1.4b2.tgz
-rw-r--r--   1 root     root          432 Jun 18  2003 tree-1.4b3.lsm
-rw-r--r--   1 root     root        29366 Feb  6  2003 tree-1.4b3.tgz
-rw-r--r--   1 root     root          466 Aug 20  2004 tree-1.5.0.lsm
-rw-r--r--   1 root     root        26543 Aug 16  2004 tree-1.5.0.tgz
226 Transfer complete.
ftp> get tree-1.5.0.tgz
ftp> bye
221 Goodbye.
在Windows下解壓tree-1.5.0.tgz,將解壓後的文件夾tree-1.5.0拷到/home/zhj1011/software下。
$cd /home/zhj1011/software/tree-1.5.0
$make
$make install
然后就可以了,安装路径查看makefile文件知道在/usr/local/bin,也可以用which查看。现在可以用tree命令来查看一下自己的目录结构了。
示例:
$cd
$tree -L 1     //显示一级目录,当然也可以显示二级目录了。
.
|-- bootloader
|-- debug
|-- images
|-- kernel
|-- program
|-- rootfiles
|-- software
|-- source
|-- sysapps
|-- tmp
`-- tools
这样对自己的组织比较好。等用tree熟悉了,在补充它的用法。
四、引导装载程序bootloader
因为u-boot的功能比较强大,所以选择了u-boot。这几天想先研究研究它的代码,好好分析一下启动过程。原来做过一次,不过是利用原来开发板做好的,熟悉过程是可以,但是不明白原理仍然不行。这次要学习掌握原理部分。
待续。。。。
继承事业,薪火相传
返回列表