uClinux編譯方法

admin @ 2014-03-25 , reply:0

概述
在http://www.uclinux.org/pub/uClinux/arm-elf-tools/下載arm-elf-tools-20030314.sh在http://www.uclinux.org……

在http://www.uclinux.org/pub/uClinux/arm-elf-tools/ 下載arm-elf-tools-20030314.sh

在http://www.uclinux.org/pub/uClinux/dist/ 下載uClinux-dist-20041215.tar.gz

執行./arm-elf-tools-20030314.sh,安裝工具鏈,執行tar zxvf uClinux-dist-20041215.tar.gz並進入uClinux-dist目錄。 

  • 在linux-2.4.x/arch/armnommu/vmlinux-armv.lds.in文件中找到以下行:

*(got) /* Global Offset table */

在其之後添加如下語句:

 

romfs_data = .;

romfs.o

romfs_data_end = .;

注意,等號兩邊都要有空格。

 

  • 在vendors/Samsung/4510B/Makefile 文件中添加image目標的第三行,增加一條語句:arm-elf-ld -r -o $(ROOTDIR)/$(LINUXDIR)/romfs.o -b binary $(ROMFSIMG)

如下為增加之後:

image:

[ -d $(IMAGEDIR) ] || mkdir -p $(IMAGEDIR)

genromfs -v -V "ROMdisk" -f $(ROMFSIMG) -d $(ROMFSDIR)

arm-elf-ld –r –o /root/uclinux/uClinux-dist/linux-2.4.x/romfs.o –b binary /root/uclinux/uClinux-dist/images/romfs.img

(/root/uclinux是我存放uClinux-dist的目錄) 

  •  修改linux-2.4.x/drivers/char/serial_samsung.c, 找到uart_config數組,把如下項:

{ "S3C4510B", 1, 0}, /* Samsung S3C4510B uart support */

修改為:

{ "S3C4510B", 128, 0}, /* Samsung S3C4510B uart support */

 

  • 執行make menuconfig

                此處設置成S3C44B0X 

  • 修改config/.config,註釋掉CONFIG_USER_OLD_PASSWORDS
  •  執行make dep
  •  執行make lib_only
  •  執行make user_only
  •  執行make romfs
  • 修改linux-2.4.x/arch/armnommu/mach-S3C44B0X/arch.c

                         將23行的S3C44B0X改為S3C44B0

                         在代碼末尾添加”}”

                         修改linux-2.4.x/arch/armnommu/kernel/head-armv.S

                         將206行以及439行的S3C44B0X改為S3C44B0 

  •  執行make

 make成功后,uClinux-dist目錄里將出現一個images目錄。

我編譯的是uClinux-dist-20041215.tar.gz
在編譯過程中並沒有出現錯誤。


代碼:

***********************************************************************
****                                                               ****
****   SkyEye  Simulator Ver 0.9.5 with  GDB/Insight 5.3 Interface ****
****                                                               ****
***********************************************************************
GNU gdb 5.3
Copyright 2002 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 SkyEye was configured as "--host=i686-pc-linux-gnu --target=arm-elf"...
(SkyEye) target sim
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x8160154
nic[0] info: state=1, ethmod num=1, mac addr=0:5:3:2:1:f, hostip=192.168.0.99
nic_init_begin
tapif_init begin
tapif_init: fd 6
tapif_init: system("ifconfig tap0 inet 192.168.0.99");
tapif_init end
nic_init_end
SKYEYE: use arm7100 mmu ops
Loaded ROM   ./boot.rom
Connected to the simulator.
(SkyEye) load
Loading section .init, size 0xa000 vma 0x1000000
Loading section .text, size 0xd72e8 vma 0x100a000
Loading section .data, size 0x9b30 vma 0x10e2000
Start address 0x1000000
Transfer rate: 7696576 bits in <1 sec.
(SkyEye) r
Starting program: /root/uClinux/Source/uclinux/uClinux-dist/linux-2.4.x/linux
Linux version 2.4.24-uc0 (root@TEST) (gcc version 2.95.3 20010315 (release)) #11 Fri Jul 1 15:35:29 CST 2005
Processor: Atmel AT91M40xxx revision 0
Architecture: EB01
On node 0 totalpages: 1024
zone(0): 0 pages.
zone(1): 1024 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0
Calibrating delay loop... 15.82 BogoMIPS
Memory: 4MB = 4MB total
Memory: 2952KB available (860K code, 185K data, 40K init)
Dentry cache hash table entries: 512 (order: 0, 4096 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: 1024 (order: 0, 4096 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
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
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 1400000-15103FF [VIRTUAL 1400000-15103FF] (RO)
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
pktgen.c: v1.3: Packet Generator for packet performance testing.
pktgen: Error: your machine does not have working cycle counter.
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)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
VFS: Mounted root (romfs filesystem) readonly.
BINFMT_FLAT: reloc outside program 0x74790000 (0 - 0x1bb5c/0x6d50), killing init!
BINFMT_FLAT: reloc outside program 0x74790000 (0 - 0x1bb5c/0x6d50), killing init!
BINFMT_FLAT: reloc outside program 0x74790000 (0 - 0x1bb5c/0x6d50), killing init!
BINFMT_FLAT: reloc outside program 0x74790000 (0 - 0x1bb5c/0x6d50), killing init!
BINFMT_FLAT: reloc outside program 0x84340100 (0 - 0x14248/0x10950), killing sh!
BINFMT_FLAT: reloc outside program 0x84340100 (0 - 0x14248/0x10950), killing sh!
Kernel panic: No init found.  Try passing init= option to kernel.


代碼:

#skyeye config file sample
cpu: arm7tdmi
mach: at91
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00004000
mem_bank: map=M, type=RW, addr=0x01000000, size=0x00400000
mem_bank: map=M, type=R,  addr=0x01400000, size=0x00400000, file=./boot.rom  #romfs.img並沒有超過這個size
mem_bank: map=M, type=RW, addr=0x02000000, size=0x00400000
mem_bank: map=M, type=RW, addr=0x02400000, size=0x00008000
mem_bank: map=M, type=RW, addr=0x04000000, size=0x00400000
mem_bank: map=I, type=RW, addr=0xf0000000, size=0x10000000
#set nic info state=on/off  mac=xx:xx:xx:xx:xx:xx  ethmod=tuntap/vnet hostip=dd.dd.dd.dd
net: state=on, mac=0:5:3:2:1:f, ethmod=tuntap, hostip=192.168.0.99
我的tool-chain是都是下面這個URL的RPM包

代碼:

http://www.uclinux.org/pub/uClinux/arm-tools/RPMS/
arm-elf-binutils-2.12.1-5.i386.rpm  
arm-elf-gcc-2.95.3-5.i386.rpm
arm-elf-gdb-5.2-0.i386.rpm
arm-elf-uClibc-0.9.20-2.i386.rpm


操作系統是FC1 for x86
skyeye的版本是0.9.5
可能是tool-chain中的rpm包又問題
我換了一個tool-chain(arm-elf-tools-20030314.sh)可以正常運行了。。




[admin via 研發互助社區 ] uClinux編譯方法已經有2592次圍觀

http://cocdig.com/docs/show-post-42710.html