科研日志-编译内核for AT91SAM9260

 

Get and patch the Linux kernel

To get an experimental Linux4SAM kernel up and running on an AT91 product, you have to go through the following steps:

    1. identify on which linux kernel revision the experimental patches will apply 
    2. download the corresponding Linux kernel

wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.33.tar.bz2
tar xvjf linux-2.6.33.tar.bz2
cd linux-2.6.xx

    3. download the AT91 Maintainer's patch and apply it

wget http://maxim.org.za/AT91RM9200/2.6/2.6.33-at91.patch.gz
zcat 2.6.33-at91.patch.gz | patch -p1
   4.Compile kernel ( a prebuilt image is provided : linux-sam9260-cn.img)
	
	-wget http://www.at91.com/linux4sam/pub/Linux4SAM/LinuxKernel/at91sam926yek_defconfig
	- make ARCH=arm at91sam9260ek_defconfig
	- make ARCH=arm CROSS_COMPILE=arm-linux-gcc
	- the cmdline is mem=64M console=ttyS0,115200 initrd=0x21100000,17000000 root=/dev/ram0 rw
	- this kernel includes following drivers :
		- USART (ttySx)
		- Ethernet
		- USB host (Mass storage)
		- USB device
		- I2C


  5.   Build a u-boot kernel image	
	- mkimage -A arm -O linux -C none -T kernel -a 20008000 -e 20008000 -n linux-2.6 -d arch/arm/boot/Image linux-2.6.15.4-sam9260ek.img
	
Command to generate an uncompressed uImage file 2 :
mkimage -A arm -O linux -C none -T kernel -a 20008000 -e 20008000 -n linux-2.6 -d arch/arm/boot/Image uImage

Commands to generate a compressed uImage file 2 :

mkimage -A arm -O linux -C none -T kernel -a 20008000 -e 20008000 -n linux-2.6 -d arch/arm/boot/zImage uImage
6. booting the kernel with a tftp server - copy kernel image (linux-2.6.15.4-sam9260ek.img) & ramdisk (armv5l-uclibc-sam9260.gz) on tftp server - Set u-boot environment variables U-Boot> setenv ethaddr the_device_mac_address (ex:12:34:56:78:99:aa) U-Boot> setenv serverip the_tftp_server_ip_address U-Boot> setenv ipaddr the_device_ip_address U-Boot> saveenv - Load kernel & ramdisk U-Boot> tftp 21400000 linux-2.6.15.4-sam9260ek.img U-Boot> tftp 21100000 armv5l-uclibc-sam9260.gz - Boot kernel U-Boot> bootm 21400000 (none) login: root 7. booting the kernel with a USB drive - copy kernel image(linux-sam9260-cn.img) & ramdisk (armv5l-uclibc-sam9260.gz) on an USB drive - Load kernel & ramdisk U-Boot> usb start U-Boot> fatload usb 0:1 21400000 linux-2.6.15.4-sam9260ek.img U-Boot> fatload usb 0:1 21100000 armv5l-uclibc-sam9260.gz - Boot kernel U-Boot> bootm 21400000 (none) login: root 8.- Using Ethernet - After login enter the command : ifconfig eth0 board_ip_address - command available : telnet wget ftpput ftpget telnetd (daemon) 9. Using USB Gadget - g_file_storage enter the command : insmod g_file_storage file=your_block_device stall=0 plug usb cable on a PC computer for example you can use an USB driver; Plug an USB drive on EK board. Do not mount the device enter the command : insmod g_file_storage file=/dev/sda1 stall=0 plug usb cable

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值