热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

向已经编译好的uClinux系统里加入自己的新程序

向已经编译好的uClinux系统里加入自己的新程序--Linux通用技术-Linux编程与内核信息,下面是详情阅读。
前段时间编译了uClinux后,一直没有抽出时间来测试,今天把skyeye拿出来实验了一下,以前正常!下面详细的说一说相关的步骤:

一。首先安装skyeye
[root@localhost root]#wget 192.168.5.89/skyeye.tar.tar
[root@localhost root]#tar jxvf skyeye.tar.tar
[root@localhost root]#cd skyeye-v1
[root@localhost skyeye-v1]#make

这样skyeye就安装完了,很简单,如果有什么不懂的地方,可以查看README
[root@localhost skyeye-v1]#cat READ | less

二。测试uClinux能否在skyeye下运行。
[root@localhost skyeye-v1]#cp ./binary/skyeye /root/uClinux-dist/
[root@localhost skyeye-v1]#cd /root/uClinux-dist
[root@localhost uClinux-dist]#vi skyeye.conf
#skyeye config file sample
cpu: arm7tdmi
mach: s3c4510b
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00800000
mem_bank: map=M, type=R, addr=0x01000000, size=0x00200000, file=images/romfs.img
#mem_bank: map=M, type=R, addr=0x01000000, size=0x00200000
mem_bank: map=I, type=RW, addr=0x03ff0000, size=0x00100000 #uart:type=s3c4510b,name=uart0
#uart:type=s3c4510b,name=uart1
#timer:type=s3c4510b,name=timer0
#timer:type=s3c4510b,name=timer1
#net: state=off, hostip=10.0.0.2, ethmod=tuntap, mac=b0:c4:20:00:00:00
[root@localhost uClinux-dist]#./skyeye -e ./linux-2.4.x/linux -c skyeye.conf

Loaded ROM images/romfs.img
exec file "./linux-2.4.x/linux"'s format is elf32-little.
load section .init: addr = 0x00008000 size = 0x0000a000.
load section .text: addr = 0x00012000 size = 0x001b0aa8.
load section .data: addr = 0x001c4000 size = 0x00007c60.
not load section .bss: addr = 0x001cbc60 size = 0x0001f3a0 .
not load section .debug_abbrev: addr = 0x00000000 size = 0x00032084 .
not load section .debug_info: addr = 0x00000000 size = 0x0141b225 .
not load section .debug_line: addr = 0x00000000 size = 0x00241819 .
not load section .debug_pubnames: addr = 0x00000000 size = 0x0000a6d7 .
not load section .debug_aranges: addr = 0x00000000 size = 0x00001e88 .
start addr is set to 0x00008000 by exec file.
Linux version 2.4.27-uc1 (root@localhost) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #4 三 9月 6 18:23:36 CST 2006

Processor: Samsung S3C4510B revision 6

Architecture: SNDS100

On node 0 totalpages: 2048

zone(0): 0 pages.

zone(1): 2048 pages.

zone(2): 0 pages.

Kernel command line: root=/dev/rom0

Calibrating delay loop... 20.78 BogoMIPS

Memory: 8MB = 8MB total

Memory: 6128KB available (1730K code, 161K data, 40K init)

Dentry cache hash table entries: 1024 (order: 1, 8192 bytes)

Inode cache hash table entries: 512 (order: 0, 4096 bytes)

Mount cache hash table entries: 512 (order: 0, 4096 bytes)

Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)

Page-cache hash table entries: 2048 (order: 1, 8192 bytes)

POSIX conformance testing by UNIFIX

Linux NET4.0 for Linux 2.4

Based upon Swansea University Computer Society NET3.039

Initializing RT netlink socket

Starting kswapd

Samsung S3C4510 Serial driver version 0.9 (2001-12-27) with no serial options enabled

ttyS00 at 0x3ffd000 (irq = 5) is a S3C4510B

ttyS01 at 0x3ffe000 (irq = 7) is a S3C4510B

Blkmem copyright 1998,1999 D. Jeff Dionne

Blkmem copyright 1998 Kenneth Albanowski

Blkmem 1 disk images:

0: C9EA8-1C2AA7 [VIRTUAL C9EA8-1C2AA7] (RO)

RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize

NET4: Linux TCP/IP 1.0 for NET4.0

IP Protocols: ICMP, UDP, TCP

IP: routing cache hash table of 512 buckets, 4Kbytes

TCP: Hash tables configured (established 512 bind 512)

VFS: Mounted root (romfs filesystem) readonly.

Freeing init memory: 40K

Shell invoked to run file: /etc/rc
Command: hostname Samsung
Command: /bin/expand /etc/ramfs.img /dev/ram0
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram0 /var
Command: mkdir /var/config
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
____ _ _
/ __| ||_|
_ _| | | | _ ____ _ _ _ _
| | | | | | || | _ \| | | |\ \/ /
| |_| | |__| || | | | | |_| |/ \
| ___\____|_||_|_| |_|\____|\_/\_/
| |
|_|

For further information check:
http://www.uclinux.org/

Command: ifconfig lo 127.0.0.1
Command: route add -net 127.0.0.0 netmask 255.255.255.0 lo
Command: dhcpcd &
Jan 1 00:00:00 dhcpcd[14]: dhcpStart: ioctl SIOCGIFHWADDR: No such device



sh 7: Child 14 died
[14]
Execution Finished, Exiting

Sash command shell (version 1.1.1)
/>
还好,可以运行!


三。向系统里加入自己的程序:

[root@localhost uClinux-dist]#vi test.c
#include
int main()
{
printf("this is an test program\n");
printf("written by 1jjk\n");
printf("Email:lingjiujianke@gmail.com")
printf("blog: http://1jjk.cublog.cn");
return 0;
}

:wq

[root@localhost uClinux-dist]#arm-elf-gcc -Wall -elf2flt -o test test.c
[root@localhost uClinux-dist]#cp ./test ./romfs/bin/
生成文件系统映像 直接执行下面的命令生成文件系统映像romfs.img:
[root@localhost uClinux-dist]#genromfs -v -V "ROMdisk" -f ./images/romfs.img -d ./romfs
[root@localhost uClinux-dist]#make image
[root@localhost uClinux-dist]#make
这时再重新
[root@localhost uClinux-dist]#./skyeye -e ./linux-2.4.x/linux -c skyeye.conf
就可以看到我们输入的信息了:

Loaded ROM images/romfs.img
exec file "./linux-2.4.x/linux"'s format is elf32-little.
load section .init: addr = 0x00008000 size = 0x0000a000.
load section .text: addr = 0x00012000 size = 0x001b0aa8.
load section .data: addr = 0x001c4000 size = 0x00007c60.
not load section .bss: addr = 0x001cbc60 size = 0x0001f3a0 .
not load section .debug_abbrev: addr = 0x00000000 size = 0x00032084 .
not load section .debug_info: addr = 0x00000000 size = 0x0141b225 .
not load section .debug_line: addr = 0x00000000 size = 0x00241819 .
not load section .debug_pubnames: addr = 0x00000000 size = 0x0000a6d7 .
not load section .debug_aranges: addr = 0x00000000 size = 0x00001e88 .
start addr is set to 0x00008000 by exec file.
Linux version 2.4.27-uc1 (root@localhost) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #4 三 9月 6 18:23:36 CST 2006

Processor: Samsung S3C4510B revision 6

Architecture: SNDS100

On node 0 totalpages: 2048

zone(0): 0 pages.

zone(1): 2048 pages.

zone(2): 0 pages.

Kernel command line: root=/dev/rom0

Calibrating delay loop... 20.78 BogoMIPS

Memory: 8MB = 8MB total

Memory: 6128KB available (1730K code, 161K data, 40K init)

Dentry cache hash table entries: 1024 (order: 1, 8192 bytes)

Inode cache hash table entries: 512 (order: 0, 4096 bytes)

Mount cache hash table entries: 512 (order: 0, 4096 bytes)

Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)

Page-cache hash table entries: 2048 (order: 1, 8192 bytes)

POSIX conformance testing by UNIFIX

Linux NET4.0 for Linux 2.4

Based upon Swansea University Computer Society NET3.039

Initializing RT netlink socket

Starting kswapd

Samsung S3C4510 Serial driver version 0.9 (2001-12-27) with no serial options enabled

ttyS00 at 0x3ffd000 (irq = 5) is a S3C4510B

ttyS01 at 0x3ffe000 (irq = 7) is a S3C4510B

Blkmem copyright 1998,1999 D. Jeff Dionne

Blkmem copyright 1998 Kenneth Albanowski

Blkmem 1 disk images:

0: C9EA8-1C2AA7 [VIRTUAL C9EA8-1C2AA7] (RO)

RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize

NET4: Linux TCP/IP 1.0 for NET4.0

IP Protocols: ICMP, UDP, TCP

IP: routing cache hash table of 512 buckets, 4Kbytes

TCP: Hash tables configured (established 512 bind 512)

VFS: Mounted root (romfs filesystem) readonly.

Freeing init memory: 40K

Shell invoked to run file: /etc/rc
Command: hostname Samsung
Command: /bin/expand /etc/ramfs.img /dev/ram0
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram0 /var
Command: mkdir /var/config
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
____ _ _
/ __| ||_|
_ _| | | | _ ____ _ _ _ _
| | | | | | || | _ \| | | |\ \/ /
| |_| | |__| || | | | | |_| |/ \
| ___\____|_||_|_| |_|\____|\_/\_/
| |
|_|

For further information check:
http://www.uclinux.org/

Command: ifconfig lo 127.0.0.1
Command: route add -net 127.0.0.0 netmask 255.255.255.0 lo
Command: dhcpcd &
Jan 1 00:00:00 dhcpcd[14]: dhcpStart: ioctl SIOCGIFHWADDR: No such device



sh 7: Child 14 died
[14]
Execution Finished, Exiting

Sash command shell (version 1.1.1)
/> test

this is an test program
written by 1jjk
Email:lingjiujianke@gmail.com
blog: http://1jjk.cublog.cn
推荐阅读
  • 在Docker中,将主机目录挂载到容器中作为volume使用时,常常会遇到文件权限问题。这是因为容器内外的UID不同所导致的。本文介绍了解决这个问题的方法,包括使用gosu和suexec工具以及在Dockerfile中配置volume的权限。通过这些方法,可以避免在使用Docker时出现无写权限的情况。 ... [详细]
  • 本文介绍了Python高级网络编程及TCP/IP协议簇的OSI七层模型。首先简单介绍了七层模型的各层及其封装解封装过程。然后讨论了程序开发中涉及到的网络通信内容,主要包括TCP协议、UDP协议和IPV4协议。最后还介绍了socket编程、聊天socket实现、远程执行命令、上传文件、socketserver及其源码分析等相关内容。 ... [详细]
  • 学习SLAM的女生,很酷
    本文介绍了学习SLAM的女生的故事,她们选择SLAM作为研究方向,面临各种学习挑战,但坚持不懈,最终获得成功。文章鼓励未来想走科研道路的女生勇敢追求自己的梦想,同时提到了一位正在英国攻读硕士学位的女生与SLAM结缘的经历。 ... [详细]
  • 本文介绍了数据库的存储结构及其重要性,强调了关系数据库范例中将逻辑存储与物理存储分开的必要性。通过逻辑结构和物理结构的分离,可以实现对物理存储的重新组织和数据库的迁移,而应用程序不会察觉到任何更改。文章还展示了Oracle数据库的逻辑结构和物理结构,并介绍了表空间的概念和作用。 ... [详细]
  • 本文介绍了Linux系统中正则表达式的基础知识,包括正则表达式的简介、字符分类、普通字符和元字符的区别,以及在学习过程中需要注意的事项。同时提醒读者要注意正则表达式与通配符的区别,并给出了使用正则表达式时的一些建议。本文适合初学者了解Linux系统中的正则表达式,并提供了学习的参考资料。 ... [详细]
  • Ubuntu 9.04中安装谷歌Chromium浏览器及使用体验[图文]
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • 概述H.323是由ITU制定的通信控制协议,用于在分组交换网中提供多媒体业务。呼叫控制是其中的重要组成部分,它可用来建立点到点的媒体会话和多点间媒体会议 ... [详细]
  • Linux防火墙配置—允许转发
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • SQL Server 2008 到底需要使用哪些端口?
    SQLServer2008到底需要使用哪些端口?-下面就来介绍下SQLServer2008中使用的端口有哪些:  首先,最常用最常见的就是1433端口。这个是数据库引擎的端口,如果 ... [详细]
  • 三、寻找恶意IP并用iptables禁止掉找出恶意连接你的服务器80端口的IP,直接用iptables来drop掉它;这里建议写脚本来运行, ... [详细]
  • Ansem 最新雄文:软着陆后,加密市场下阶段趋势与核心叙事
    市场最糟糕的时候已经过去,以太坊合并前不太会看到新的低点;但仍需来自关注宏观市场的不确定风险。撰文:Ansem ... [详细]
  • 解决Cydia数据库错误:could not open file /var/lib/dpkg/status 的方法
    本文介绍了解决iOS系统中Cydia数据库错误的方法。通过使用苹果电脑上的Impactor工具和NewTerm软件,以及ifunbox工具和终端命令,可以解决该问题。具体步骤包括下载所需工具、连接手机到电脑、安装NewTerm、下载ifunbox并注册Dropbox账号、下载并解压lib.zip文件、将lib文件夹拖入Books文件夹中,并将lib文件夹拷贝到/var/目录下。以上方法适用于已经越狱且出现Cydia数据库错误的iPhone手机。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 拥抱Android Design Support Library新变化(导航视图、悬浮ActionBar)
    转载请注明明桑AndroidAndroid5.0Loollipop作为Android最重要的版本之一,为我们带来了全新的界面风格和设计语言。看起来很受欢迎࿰ ... [详细]
  • 关键词:Golang, Cookie, 跟踪位置, net/http/cookiejar, package main, golang.org/x/net/publicsuffix, io/ioutil, log, net/http, net/http/cookiejar ... [详细]
author-avatar
cjcstc@163.com
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有