#仅适用于友善提供的Mini2440开发板内核源码!!!
1.修改内核根目录Makefile(友善已修改):
#ARCH ?= $(SUBARCH)
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-
2. 拷贝内核配置文件:
$ cp config_mini2440_p35 .config
3. 配置内核:
$ make menuconfig
4. 编译内核:
$ make uImage //生成zImage + uImage
...
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
UIMAGE arch/arm/boot/uImage
Image Name: Linux-2.6.32.2-FriendlyARM
Created: Sun Jun 15 17:38:32 2014
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2268716 Bytes = 2215.54 kB = 2.16 MB
Load Address: 30008000
Entry Point: 30008000
Image arch/arm/boot/uImage is ready
5. 启动u-boot(重启开发板并按一次任意键),并设置u-boot环境参数:
U-Boot 2010.03 ( 4鏈20 2014 - 11:20:52)
modified by tekkamanninja (tekkamanninja@163.com)
Love Linux forever!!
I2C: ready
DRAM: 64 MB
Flash: 2 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
USB slave is enable!
Net: dm9000
Hit any key to stop autoboot: 0
##### FriendlyARM U-Boot(2012-07) for 2440 #####
[f] Format the nand flash
[v] Download u-boot.bin
[k] Download Linux kernel
[y] Download root yaffs2 image
[a] Download Absolute User Application
[s] Set the boot parameter of Linux
[b] Boot Linux
[r] Reboot
[q] Quit to shell
Enter your Selection:q //进入shell
[u-boot@MINI2440]#
//查看当前环境参数设置
[u-boot@MINI2440]# printenv
bootargs=noinitrd root=/dev/mtdblock3 console=ttySAC0 init=/linuxrc
bootcmd=nand read.i 0x30008000 60000 500000;bootm
bootdelay=1
baudrate=115200
ethaddr=08:08:11:18:12:27
ipaddr=192.168.0.230
serverip=192.168.0.1
gatewayip=192.168.0.1
netmask=255.255.255.0
stdin=serial
stdout=serial
stderr=serial
ethact=dm9000
Environment size: 313/131068 bytes
//设置环境参数
[u-boot@MINI2440]# setenv ipaddr 192.168.1.230 //开发板(target)IP
[u-boot@MINI2440]# setenv serverip 192.168.1.110 //开发主机(host)IP(FTP服务器所在主机)
[u-boot@MINI2440]# setenv gatewayip 192.168.1.1 //网关IP
[u-boot@MINI2440]# saveenv //保存设置(至开发板nand flash)
Saving Environment to NAND...
Erasing Nand...
Erasing at 0x40000 -- 100% complete.
Writing to Nand... done
6. 通过TFTP下载内核镜像(至开发板外部RAM(64M bytes)):
[u-boot@MINI2440]# tftp 0x30008000 uImage
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 192.168.1.110; our IP address is 192.168.1.230
Filename 'zImage'.
Load address: 0x30008000
Loading: T #################################################################
#################################################################
#########################
done
Bytes transferred = 2268716 (229e2c hex)
7. 擦除Nand flash以用来烧写内核镜像uImage(地址: 0x60000,大小: 0x500000):
[u-boot@MINI2440]# nand erase 0x60000 0x500000
NAND erase: device 0 offset 0x60000, size 0x500000
Erasing at 0x540000 -- 1000% complete.
OK
8. (从开发板RAM)拷贝内核镜像uImage至Nand flash(RAM地址(实际的内核代码存放地址)=0x30008000(uImage镜像文件入口地址)+0x40(uImage文件头部大小); Nand flash 地址: 0x60000,大小: 0x500000):
[u-boot@MINI2440]# nand write 0x30008040 0x60000 0x500000
NAND write: device 0 offset 0x60000, size 0x500000
Writing at 0x540000 -- 100% is complete. 5242880 bytes written: OK
9. 重启开发板以启动内核:
U-Boot 2010.03 ( 4鏈20 2014 - 11:20:52)
modified by tekkamanninja (tekkamanninja@163.com)
Love Linux forever!!
I2C: ready
DRAM: 64 MB
Flash: 2 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
USB slave is enable!
Net: dm9000
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0x6000
1.修改内核根目录Makefile(友善已修改):
#ARCH ?= $(SUBARCH)
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-
2. 拷贝内核配置文件:
$ cp config_mini2440_p35 .config
3. 配置内核:
$ make menuconfig
4. 编译内核:
$ make uImage //生成zImage + uImage
...
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
UIMAGE arch/arm/boot/uImage
Image Name: Linux-2.6.32.2-FriendlyARM
Created: Sun Jun 15 17:38:32 2014
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2268716 Bytes = 2215.54 kB = 2.16 MB
Load Address: 30008000
Entry Point: 30008000
Image arch/arm/boot/uImage is ready
5. 启动u-boot(重启开发板并按一次任意键),并设置u-boot环境参数:
U-Boot 2010.03 ( 4鏈20 2014 - 11:20:52)
modified by tekkamanninja (tekkamanninja@163.com)
Love Linux forever!!
I2C: ready
DRAM: 64 MB
Flash: 2 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
USB slave is enable!
Net: dm9000
Hit any key to stop autoboot: 0
##### FriendlyARM U-Boot(2012-07) for 2440 #####
[f] Format the nand flash
[v] Download u-boot.bin
[k] Download Linux kernel
[y] Download root yaffs2 image
[a] Download Absolute User Application
[s] Set the boot parameter of Linux
[b] Boot Linux
[r] Reboot
[q] Quit to shell
Enter your Selection:q //进入shell
[u-boot@MINI2440]#
//查看当前环境参数设置
[u-boot@MINI2440]# printenv
bootargs=noinitrd root=/dev/mtdblock3 console=ttySAC0 init=/linuxrc
bootcmd=nand read.i 0x30008000 60000 500000;bootm
bootdelay=1
baudrate=115200
ethaddr=08:08:11:18:12:27
ipaddr=192.168.0.230
serverip=192.168.0.1
gatewayip=192.168.0.1
netmask=255.255.255.0
stdin=serial
stdout=serial
stderr=serial
ethact=dm9000
Environment size: 313/131068 bytes
//设置环境参数
[u-boot@MINI2440]# setenv ipaddr 192.168.1.230 //开发板(target)IP
[u-boot@MINI2440]# setenv serverip 192.168.1.110 //开发主机(host)IP(FTP服务器所在主机)
[u-boot@MINI2440]# setenv gatewayip 192.168.1.1 //网关IP
[u-boot@MINI2440]# saveenv //保存设置(至开发板nand flash)
Saving Environment to NAND...
Erasing Nand...
Erasing at 0x40000 -- 100% complete.
Writing to Nand... done
6. 通过TFTP下载内核镜像(至开发板外部RAM(64M bytes)):
[u-boot@MINI2440]# tftp 0x30008000 uImage
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
operating at 100M full duplex mode
Using dm9000 device
TFTP from server 192.168.1.110; our IP address is 192.168.1.230
Filename 'zImage'.
Load address: 0x30008000
Loading: T #################################################################
#################################################################
#########################
done
Bytes transferred = 2268716 (229e2c hex)
7. 擦除Nand flash以用来烧写内核镜像uImage(地址: 0x60000,大小: 0x500000):
[u-boot@MINI2440]# nand erase 0x60000 0x500000
NAND erase: device 0 offset 0x60000, size 0x500000
Erasing at 0x540000 -- 1000% complete.
OK
8. (从开发板RAM)拷贝内核镜像uImage至Nand flash(RAM地址(实际的内核代码存放地址)=0x30008000(uImage镜像文件入口地址)+0x40(uImage文件头部大小); Nand flash 地址: 0x60000,大小: 0x500000):
[u-boot@MINI2440]# nand write 0x30008040 0x60000 0x500000
NAND write: device 0 offset 0x60000, size 0x500000
Writing at 0x540000 -- 100% is complete. 5242880 bytes written: OK
9. 重启开发板以启动内核:
U-Boot 2010.03 ( 4鏈20 2014 - 11:20:52)
modified by tekkamanninja (tekkamanninja@163.com)
Love Linux forever!!
I2C: ready
DRAM: 64 MB
Flash: 2 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
USB slave is enable!
Net: dm9000
Hit any key to stop autoboot: 0
NAND read: device 0 offset 0x6000