




已阅读5页,还剩7页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
uClinux 2.6入门一、使用uClinux/ARM 2.6的原因? 为什么你要使用uClinux?有很多的理由使uClinux做为你的嵌入式操作系统。其中大部分认为uClinux有以下好处: 轻便 你可以编译linux2.6的内核得到一个300k以下的内核镜像,它包括终端和一些基本的设备驱动以及只读文件系统。并且flat格式的二进制zImage和应用程序要比linux传统使用的ELF二进制小30%-50%,由于使用了较少的标准的C和C+库。 XIP(execution in place) 你能通过XIP来在一个较小的RAM时执行你的内核镜像,甚至是应用程序。它能帮助你快速的启动,尽管flash的存取时间或是rom启动镜像足够快以及有足够的缓存大小。(如果我们想找到它们最优化的平衡点,可以交换两者之间这些变量。) 便宜 MMU (内存管理单元)核心大小大约占典型的ARM SoC(System-on-Chip单片机)wafer(晶体)的30%。在典型的网络和嵌入式系统里有一半以上的应用程序不需要MMU。甚至如果只有一个CPU的许多RTOS(实时操作系统)在默认情况下也不使用MMU。 完全的Linux应用程序接口 除少数情况外,你可以在uClinux平台上完全使用Linux应用程序接口。你能在uClibc里使用多线程以及使用标准的系统调用。在用户盘里的uClinux发布包里有大量的应用程序 被移植到了uClinux系统上。 Easiar to adapt 在uClinux 性能里有一个有趣的特性,是应用程序可以访问整个系统,包括设备里的寄存器,with a bit of wrapper ,我们能 制作固件代码做为无格式的 应用程序运 行在 uClinux上!当然,你能加一些设备驱动和系统调用来调用以及使用许多打开的Ips在混和的旧的固件代码里。如果你计划移动你的固件代码到linux,但你没有熟悉的linux系统程序,uClinux是一个很好的出发点 完全的linux2.6内核的特性 尽管uClinux很小,但它支持linux2.6内核约定的全部的特性,包括内核优先级特性以及许多的文件系统,设备驱动。为linux约定设备驱动端口是容易实现的。几乎所有的代码不需要改变就可以编译,除了从虚拟地址到物理的内存镜像外。 注:上面的部分由于涉及的概念太多,翻译的不大好,请大家指正,谢谢。 二、初次编译uClinux/ARM2.6指南 如果你决定使用uClinux做为开发环境,那么下面的部分将会让uClinux运行在你的linux PC机上: 1、获得uClinux发布包 一个最容易得到uClinux的发布包的方法是直接访问uC站点: /pub/uClinux/dist/ 注意这里发布的内核版本可能不是最新的,但你能找到一个最新的补丁以及从站点上找一个对应的linux内核版本来制作一个最新的uClinux内核。此时(2004年05月25日)可从“/pub/uClinux/dist”获得最新的发布包的版本是uClinux-dist.20040408.tar.gz。如果你对编译软件不是很熟悉,那么根据这个指南你将会很容易的使用这个分布包来制作你的uClinux内核或是升级它到最新的版本。 2、获得最新的内核及补丁 你能到这里找到最新的uClinux/ARM内核补丁: http:/adam.kaist.ac.kr/hschoe/ 在下载的部分,你将会找到“linux-2.6.x-hscx.patch.gz”最新的链接,以及原始的内核包: http:/adam.kaist.ac.kr/hschoe/dow.5-hsc2.patch.gz 和 /pub/linux/ker.x-2.6.5.tar.bz2 3、ARM-ELF工具链 从linux2.6内核代码使用了一些更新的binutils新特性以来,你需要一个比站点上更新的ARM-ELF工具链来编译内核。你能够从上面的与下载内核和补丁相同的download部分找到最新的工具链,就在当前的链接下: http:/adam.kaist.ac.kr/hschoe/dow.ols-20040427.sh 4、硬件平台或是一个ARMulator(ARM仿真) 当然你需要一个平台来运行uClinux内核,请首先看一下注意事项里有那些平台被支持。即使你不能找到适用于你的平台,或是你没有任何的硬件平台,那你也能在你的linux PC机上运行这个内核:使用ARMulator(ARM仿真)。ARMulator是一个以GDB调试器为基础的仿 真,这个仿真完全支持Atmel AT91x和arm7tdmi EB01。ARMulator的主页在这: /pub/uClinux/utilities/armulator/ 你也能直接从这里下载: /pub/uClinux/.gdb-5.0.tar.bz2(原始gdb-5.0包) /pub/uClinux/.021127.patch.gz(gdb-5.0所依赖的补丁) 如果你想在ARMulator上运行内核的ramdisk(虚拟磁盘),那么你就需要从这下载另外一个软件包: http:/adam.kaist.ac.kr/hschoe/dow.040412.patch.gz 5、如果你是初次编译这些发布包的话,OK!从这我们将会一步一步的进行 (现在把上面所下载的软件包都发在/root/incoming目录里) (On this guide, the downloaded files are gathered on /incoming and the ARMulator is used for platform to run on.) 6、安装工具链 以root用户来执行arm-elf-tools-20040427.sh,像这样: roothyoklinux /#/bin/sh /incoming/arm-elf-tools-20040427.sh 注:是你的root用户目录,当然也可以选择别的目录,但这取决于你的第5步所设置的目录。 你将看到被安装文件的列表,这个工具链的可执行的二进制文件被安装到了/usr/local/bin目录里,所以你的环境变量的搜索路径应包括这个目录,通常使用的发行版像redhat等已经将这个路径包括在$PATH变量里,可以用下面的命令查看一下: roothyoklinux /#echo $PATH 7、释放uClinux发布包 在一个有2GB空间的目录里来释放uclinux发布包 roothyoklinux /# tar -zxvf /incoming/uClinux-dist-20040408.tar.gz 让我们看看uClinux-dist目录里有什么文件 roothyoklinux /# cd uClinux-dist/ roothyoklinux uClinux-dist# ls -al total 104 drwxr-xr-x 15 1000 users 4096 Apr 8 09:27 . drwxr-xr-x 28 root root 4096 Apr 27 20:32 . -rw-r-r- 1 1000 users 18007 Apr 8 09:13 COPYING drwxr-xr-x 3 1000 users 4096 Apr 8 09:13 documentation -rw-r-r- 1 1000 users 9305 Apr 8 09:13 Makefile -rw-r-r- 1 1000 users 4934 Apr 8 09:13 README -rw-r-r- 1 1000 users 1743 Apr 8 09:13 SOURCE drwxr-xr-x 2 1000 users 4096 Apr 15 15:19 bin drwxr-xr-x 3 1000 users 4096 Apr 8 09:27 config - 为本地用户提供的配置文件以及其它的 drwxr-xr-x 11 1000 users 4096 Apr 8 09:27 freeswan - IPsec的实现 drwxr-xr-x 68 1000 users 4096 Apr 8 09:23 glibc - GNU C库 drwxr-xr-x 18 1000 users 4096 Apr 8 09:28 lib - 许多移植到uClinux的库,包括uC-libc. drwxr-xr-x 15 1000 users 4096 Apr 8 09:27 linux-2.0.x - uClinux 2.0.x kernel drwxr-xr-x 16 1000 users 4096 Apr 8 09:27 linux-2.4.x - uClinux 2.4.x kernel drwxr-xr-x 18 1000 users 4096 Apr 8 09:27 linux-2.6.x - uClinux 2.6.x kernel drwxr-xr-x 3 1000 users 4096 Apr 8 09:26 tools - 安装romfs提供的程序以及其它的 drwxr-xr-x 17 1000 users 4096 Apr 8 09:27 uClibc - uClibc可从找到,与uC-libc不同. drwxr-xr-x 174 1000 users 4096 Apr 8 09:27 user - the“userland”被移植的应用程序 drwxr-xr-x 44 1000 users 4096 Apr 8 09:27 vendors .gdbinit target sim load D 通过下面的命令,就可以运行我们的内核了。 roothyoklinux uClinux-dist# arm-elf-gdb linux-2.6.x/linux GNU gdb 5.0 Copyright 2000 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as -host=i686-pc-linux-gnu -target=arm-elf. Loaded ROM boot.rom to 0x01300000 Loaded ROM boot.rom to 0x01400000 Loaded ROM boot.rom to 0x04000000 Loaded ROM boot.rom to 0x01300000 Loaded ROM boot.rom to 0x01400000 Loaded ROM boot.rom to 0x04000000 Connected to the simulator. Loading section .init, size 0xb000 vma 0x1000000 Loading section .text, size 0xa0b98 vma 0x100b000 Loading section _ex_table, size 0x5b8 vma 0x10abba0 Loading section .data, size 0x8ef8 vma 0x10ae000 Start address 0x1000000 Transfer rate: 5931584 bits in 1 sec. (gdb) run Starting program: /uClinux-dist/linux-2.6.x/linux Linux version 2.6.5-hsc1 (roothyoklinux) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from XIP and shared lib patches from ) #9 Mon May 3 11:00:29 KST 2004 CPU: Atmel-AT91M40xxx 14000040 revision 0 (ARMvundefined/unknown) Machine: ATMEL EB01 On node 0 totalpages: 1024 DMA zone: 0 pages, LIFO batch:1 Normal zone: 1024 pages, LIFO batch:1 HighMem zone: 0 pages, LIFO batch:1 Built 1 zonelists Kernel command line: root=/dev/ram0 initrd=0x01300000,800K keepinitrd PID hash table entries: 32 (order 5: 256 bytes) Memory: 4MB = 4MB total Memory: 2448KB available (642K code, 92K data, 44K init) Calibrating delay loop. 15.87 BogoMIPS Dentry cache hash table entries: 1024 (order: 0, 4096 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) checking if image is initramfs.it isnt (ungzip failed); looks like an initrd POSIX conformance testing by UNIFIX Linux NoNET1.0 for Linux 2.6 Atmel USART driver version 0.99 ttyS0 at 0xfffd0000 (irq = 2) is a builtin Atmel APB USART ttyS1 at 0xfffcc000 (irq = 3) is a builtin Atmel APB USART RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize loop: loaded (max 8 devices) RAMDISK: romfs filesystem found at block 0 RAMDISK: Loading 771 blocks 1 disk into ram disk. done. VFS: Mounted root (romfs filesystem) readonly. Freeing init memory: 44K Shell invoked to run file: /etc/rc Command: hostname GDB-ARMulator Command: /bin/expand /etc/ramfs.img /dev/ram1 Command: mount -t proc proc /proc Command: mount -t ext2 /dev/ram1 /var Command: mkdir /var/tmp Command: mkdir /var/log Command: mkdir /var/run Command: mkdir /var/lock Command: mkdir /var/empty Command: cat /etc/motd Welcome to _ _ _ / _| |_| _ _| | | | _ _ _ _ _ _ | | | | | | | | _ | | | | / / | |_| | |_| | | | | | |_| |/ | _|_|_|_| |_|_|_/_/ | | |_| GDB/ARMulator support by For further information check: Execution Finished, Exiting Sash command shell (version 1.1.1) / ps PID PORT STAT SIZE SHARED %CPU COMMAND 1 S 163K 0K 48.0 /sbin/init 2 S 0K 0K 0.0 ksoftirqd/0 3 S 0K 0K 1.0 events/0 4 S 0K 0K 0.0 kblockd/0 5 S 0K 0K 0.0 pdflush 6 S 0K 0K 0.0 pdflush 7 S 0K 0K 0.0 kswapd0 8 S 0K 0K 0.0 aio/0 11 S0 R 165K 0K 0.0 /bin/sh / cd bin /bin ls -al drwxr-xr-x 1 0 0 32 Jan 1 00:00 . drwxr-xr-x 1 0 0 32 Jan 1 00:00 . -rwxr-xr-x 1 0 0 105980 Jan 1 00:00 boa -rwxr-xr-x 1 0 0 91104 Jan 1 00:00 dhcpcd -rwxr-xr-x 1 0 0 29624 Jan 1 00:00 expand -rwxr-xr-x 1 0 0 40504 Jan
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 个人车辆租赁标准合同4篇
- 市物业服务合同范本
- 装修工程服务合同范本
- 团队境内游合同范本
- 租店简易合同范本
- 农村名宿转让合同范本
- 超市耗材购买合同范本
- 车位出售协议合同范本
- 注册工商租房合同范本
- 2025年国家安全月安全知识考试题库及答案解析
- T-CACM 1212-2019 中医妇科临床诊疗指南 产后小便不通
- 2025年高考化学总复习《同分异构体的书写及数目判断》专项测试卷(带答案)
- 2025春季学期国开电大本科《管理英语3》一平台在线形考综合测试形考任务试题及答案
- 医疗机构水电气设备维护流程
- 数据的形式与记录载体(教学设计)2024-2025学年清华版信息技术四年级上册
- 合规管理战略规划范文
- 餐饮服务与数字化运营 习题及答案 项目一
- 消毒隔离的管理
- 纪委执纪场所审查谈话系统解决方案
- 两办意见、《条例》、八项硬措施、治本攻坚三年行动方案学习课件
- SuperKids1-第一单元测试卷-Unit-1-Unit-3
评论
0/150
提交评论