Add your new program to the compiled uClinux system
Source: Internet
Author: User
Add your new program-general Linux technology-Linux programming and kernel information to the compiled uClinux system. The following is a detailed description. After compiling uClinux some time ago, I never took the time to test it. Today I took skyeye out and tried it. It was normal before! The following describes the related steps in detail:
I. First install skyeye
[Root @ localhost root] # wget 192.168.5.89/skyeye.tar.tar
[Root @ localhost root] # tar jxvf skyeye.tar.tar
[Root @ localhost root] # skyeye-v1 cd
[Root @ localhost skyeye-v1] # make
In this way, skyeye is installed, which is very simple. If you have any questions, you can view README
[Root @ localhost skyeye-v1] # cat READ | less
II. Test whether uClinux can run in 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: initi4510b
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 = jx4510b, name = uart0
# Uart: type = maid, name = uart1
# Timer: type = jx4510b, name = timer0
# Timer: type = jx4510b, 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 = 0x0000760.
Not load section. bss: addr = 0x001cb60size = 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 March 13, September 6 18:23:36 CST 2006
Processor: Samsung s34510b 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: 8 MB = 8 MB total
Memory: 6128KB available (1730 K code, 161 K data, 40 K init)
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)
/>
Okay, you can run it!
3. Add your own program to the system:
[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. c
[Root @ localhost uClinux-dist] # cp./test./romfs/bin/
Run the following command to generate the file system image 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
Then try again
[Root @ localhost uClinux-dist] #./skyeye-e./linux-2.4.x/linux-c skyeye. conf
We can see the entered information:
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 = 0x0000760.
Not load section. bss: addr = 0x001cb60size = 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 March 13, September 6 18:23:36 CST 2006
Processor: Samsung s34510b 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: 8 MB = 8 MB total
Memory: 6128KB available (1730 K code, 161 K data, 40 K init)
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
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.