Linux-2.6.33.1内核编译——基于AT91SAM9G20

Linux-2.6.33.1内核编译——基于AT91SAM9G20

 

编译环境:VMware Workstation+Red Hat 9

编译工具:arm-2007-01-21.iso

下载内核Linux-2.6.33.1.tar.bz2

#tar xvjf Linux-2.6.33.1.tar.bz2(注:后缀为bz2xvjf解压,后缀为gzvxzf解压)

#cd Linux-2.6.33.

修改Makefile

ARCH ?=$(SUBARCH)

CROSS_COMPILE ?=

改为:    ARCH ?=arm

CROSS_COMPILE ?=arm-linux-

#make destclean

#cp arch/arm/configs/at91sam9g20ek_defconfig ./

#make at91sam9g20ek_defconfig

#make uImage

 

[root@FriendlyARM linux-2.6.33.1]# make uImage

scripts/kconfig/conf -s arch/arm/Kconfig

  CHK     include/linux/version.h

  UPD     include/linux/version.h

  CHK     include/generated/utsrelease.h

  UPD     include/generated/utsrelease.h

  Generating include/generated/mach-types.h

  CC      kernel/bounds.s

kernel/bounds.c:1: error: invalid ABI option: -mabi=aapcs-linux

make[1]: *** [kernel/bounds.s] Error 1

make: *** [prepare0] Error 2

 

错误,郁闷。Baidu一下,在thousands_out君的百度空间中有答案:

http://hi.baidu.com/thousands_out/blog/item/d220e443e3a96e1b9313c61b.html

9G20内核编译出错

2009-11-30 22:40

使用LINUX-2.6.30版本的内核:
invalid option `abi=aapcs-linux'
选项错误提示如下:
scripts/kconfig/conf -s arch/arm/Kconfig
CHK     include/linux/version.h
SYMLINK include/asm-arm/arch -> include/asm-arm/arch-s3c2410
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK     include/linux/utsrelease.h
CC      arch/arm/kernel/asm-offsets.s
cc1: error: invalid option `abi=aapcs-linux'
make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2


解决方法:
You're building an EABI kernel with an OABI compiler. You can either turn off the EABI option in your config file (Kernel Features->Use EABI),or, you can use an EABI toolchain such as the ARM/GNU Linux one from <http://www.codesourcery.com/gnu_toolchains/arm/download.html>.I recommend the latter, because then you can run Arjan's new images.
上述的关掉EABI选项可以通过测试

OABI
EABI compiler的区别:

Strictly speaking, both the old and new ARM ABIs are subsets of the ARM EABI specification, but in everyday usage the term "EABI" is used to mean the new one described here and "OABI" or "old-ABI" to mean the old one. However, there are one or two programs that sometimes describe an old ABI binary as "EABI".

 

呵呵,英文的,看得不是太懂,谁叫咱四级没过呢。没办法,硬着头皮看下去,应该是在配置里面kernel Featurs中去掉EABI,先试一下。

 

#make menuconfig

 

Kernel Featurs à

       []Use the ARMEABI to compile the kernel(去掉)

退出保存

 

继续#make uImage

 Image Name:   Linux-2.6.33.1

Created:      Mon Jul 26 18:56:08 2010

Image Type:   ARM Linux Kernel Image (uncompressed)

Data Size:    1623124 Bytes = 1585.08 kB = 1.55 MB

Load Address: 0x20008000

Entry Point:  0x20008000

  Image arch/arm/boot/uImage is ready

 

竟然成功了,受惊若宠,下载到板子上,

DRAM:  32 MB

NAND:  256 MiB

DataFlash:AT45DB161

Nb pages:   4096

Page Size:    528

Size= 2162688 bytes

Logical address: 0xD0000000

Area 0: D0000000 to D00041FF (RO) Bootstrap

Area 1: D0004200 to D00083FF      Environment

Area 2: D0008400 to D0041FFF (RO) U-Boot

Area 3: D0042000 to D0251FFF      Kernel

Area 4: D0252000 to D020FFFF      FS

In:    serial

Out:   serial

Err:   serial

Net:   macb0

macb0: Starting autonegotiation...

macb0: Autonegotiation complete

macb0: link up, 100Mbps full-duplex (lpa: 0xcde1)

Hit any key to stop autoboot:  0

macb0: link up, 100Mbps full-duplex (lpa: 0xcde1)

Using macb0 device

TFTP from server 192.168.0.149; our IP address is 192.168.0.10

Filename 'uImage'.

Load address: 0x22200000

Loading: #################################################################

         ##############################################

done

Bytes transferred = 1623160 (18c478 hex)

macb0: link up, 100Mbps full-duplex (lpa: 0xcde1)

Using macb0 device

TFTP from server 192.168.0.149; our IP address is 192.168.0.10

Filename 'ramdisk.gz'.

Load address: 0x21100000

Loading: #################################################################

         #################################################################

         ####################

done

Bytes transferred = 2192768 (217580 hex)

## Booting kernel from Legacy Image at 22200000 ...

   Image Name:   Linux-2.6.33.1

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:    1623096 Bytes =  1.5 MB

   Load Address: 20008000

   Entry Point:  20008000

   Verifying Checksum ... OK

   Loading Kernel Image ... OK

OK

 

Starting kernel ...

 

Uncompressing Linux... done, booting the kernel.

Linux version 2.6.33.1 (root@FriendlyARM) (gcc version 4.0.0 (DENX ELDK 4.1 4.0.

0)) #2 Mon Jul 26 17:41:36 CST 2010

CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177

CPU: VIVT data cache, VIVT instruction cache

Machine: Atmel AT91SAM9G20-EK

Memory policy: ECC disabled, Data cache writeback

Clocks: CPU 396 MHz, master 132 MHz, main 18.432 MHz

Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128

Kernel command line: root=/dev/ram rw ramdisk_size=16000 mem=32M initrd=0x211000

00,6000000 console=ttyS0,115200

PID hash table entries: 128 (order: -3, 512 bytes)

Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)

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

Memory: 32MB = 32MB total

Memory: 23220KB available (2992K code, 241K data, 128K init, 0K highmem)

Hierarchical RCU implementation.

RCU-based detection of stalled CPUs is enabled.

NR_IRQS:192

AT91: 96 gpio irqs in 3 banks

Console: colour dummy device 80x30

console [ttyS0] enabled

Calibrating delay loop... 197.83 BogoMIPS (lpj=989184)

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

NET: Registered protocol family 16

AT91: Power Management

AT91: Starting after user reset

bio: create slab <bio-0> at 0

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

Advanced Linux Sound Architecture Driver Version 1.0.21.

Switching to clocksource pit

NET: Registered protocol family 2

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

TCP established hash table entries: 1024 (order: 1, 8192 bytes)

TCP bind hash table entries: 1024 (order: 0, 4096 bytes)

TCP: Hash tables configured (established 1024 bind 1024)

TCP reno registered

UDP hash table entries: 256 (order: 0, 4096 bytes)

UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)

NET: Registered protocol family 1

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

RPC: Registered tcp NFSv4.1 backchannel transport module.

Trying to unpack rootfs image as initramfs...

rootfs image is not initramfs (no cpio magic); looks like an initrd

Freeing initrd memory: 5856K

NetWinder Floating Point Emulator V0.97 (double precision)

JFFS2 version 2.2. (NAND) (SUMMARY)  2001-2006 Red Hat, Inc.

msgmni has been set to 56

io scheduler noop registered (default)

atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL

atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL

atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL

brd: module loaded

loop: module loaded

ssc ssc.0: Atmel SSC device at 0xc2878000 (irq 14)

NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bi

t)

Scanning device for bad blocks

Bad eraseblock 333 at 0x0000029a0000

Bad eraseblock 1153 at 0x000009020000

Bad eraseblock 1423 at 0x00000b1e0000

Creating 3 MTD partitions on "atmel_nand":

0x000000000000-0x000000400000 : "Bootstrap"

0x000000400000-0x000004000000 : "Partition 1"

0x000004000000-0x000010000000 : "Partition 2"

atmel_spi atmel_spi.0: Atmel SPI Controller at 0xfffc8000 (irq 12)

MACB_mii_bus: probed

eth0: Atmel MACB at 0xfffc4000 irq 21 (00:22:33:11:44:55)

eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:00, irq=-1)

usbmon: debugfs is not available

ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

at91_ohci at91_ohci: AT91 OHCI

at91_ohci at91_ohci: new USB bus registered, assigned bus number 1

at91_ohci at91_ohci: irq 20, io mem 0x00500000

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 2 ports detected

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

udc: at91_udc version 3 May 2006

mice: PS/2 mouse device common for all mice

input: gpio-keys as /devices/platform/gpio-keys/input/input0

rtc-at91sam9 at91_rtt.0: rtc core: registered at91_rtt as rtc0

IRQ 1/rtc0: IRQF_DISABLED is not guaranteed on shared IRQs

rtc-at91sam9 at91_rtt.0: rtc0: SET TIME!

Registered led device: ds5

Registered led device: ds1

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

ALSA device list:

  No soundcards found.

TCP cubic registered

NET: Registered protocol family 17

rtc-at91sam9 at91_rtt.0: hctosys: unable to read the hardware clock

RAMDISK: gzip image found at block 0

VFS: Mounted root (ext2 filesystem) on device 1:0.

Freeing init memory: 128K

INIT: version 2.86 booting

/ # eth0: link up (100/Full)

 

成功了,呵呵,虽然还有很多地方没弄明白,但起码成功了一步,今天到此为止了,明天再弄。

       本人在linux里还是小学生,把自己的一些心得写出来,不对的地方很多,希望大哥大姐们多多指点,谢谢。

 

 

 

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值