- 论坛徽章:
- 0
|
作者: D版乞丐
时间: 2008-09-30
邮箱: ihacker8@163.com
主页: http://blog.chinaunix.net/u1/59345/
版权: 该文章版权由D版乞丐所有。可在非商业目的下任意传播和复制。
对于商业目的下对本文的任何行为需经作者同意。
终于开始移植LINUX内核,买QQ2440开发板几个月了,始终没有多少时间来开到,现在回到学校也算比较清闲,有时间开始好好弄一下了.
现有资源:
软件方面:vm(Fedora 9+arm-linux-gcc 4.0.0)+windows+cuteftppro+soureinsight3.5;
硬件方面:QQ2440开发板,友善之臂出的板子,做工不错价格也非常便宜,比较适合初学者;
参考资料:>作者:韦东山,书完全是根据作者的经验写的,
和2410 2440的板子比较配套,我觉得这是一本非常好的参考书,特别是用2410或者是2440的初学者.
现在开始移植了,bootloader我还是用的qq2440的supervivi,这个比较方便,但源代码没有公开,u-boot就留给以后吧.2440的板子移植内核还是比较简单的,因为内核里面已经有了2410的配置文件,简单的改一下,基本就可以了,再就是外设驱动的修改了.
本着,出现问题解决问题的精神,一步一步修改,哪里出现问题改哪里.
1.什么都不改的情况下
直接将Makefile文件里面的
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?=
改为:
ARCH ?= arm
CROSS_COMPILE ?=arm-linux-
然后用S3C2410的默认配置文件
#make s3c2410_defconfig
#make menuconfig
#make zImage
将生成的zImage通过supervivi下载到NAND里面,启动之后出现了乱码,看来是频率不一致造成的.
2..修改Arch/arm/mach-s3c2440/mach-smdk2440
S3c24xx_init_clocks(16934400);
改为:
S3c24xx_init_clocks(12000000);
启动之后出现:
Copy linux kernel from 0x00050000 to 0x30008000, size = 0x00200000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
MACH_TYPE = 782
NOW, Booting Linux......
Uncompressing Linux.................................................................................................. done, booting the kernel.
Error: unrecognized/unsupported machine ID (r1 = 0x0000030e).
Available machine support:
ID (hex) NAME
000000c1 SMDK2410
0000015b IPAQ-H1940
00000290 Acer-N30
0000014b Simtec-BAST
000002a8 Nex Vision - Otom 1.1
00000400 AML_M5900
000001db Thorcom-VR1000
00000454 QT2410
000003fe SMDK2413
000003f1 SMDK2412
00000377 S3C2413
00000474 VSTMS
000002de Simtec-Anubis
0000034a Simtec-OSIRIS
00000250 IPAQ-RX3715
0000016a SMDK2440
000002a9 NexVision - Nexcoder 2440
0000043c SMDK2443
Please check your kernel config and/or bootloader
这可能是supervivi和内核之间的参数传递出现了问题,因为supervivi没有源代码,所以这个问题先放一放,等学习U-BOOT的时候再解决,网上搜了一下,可以通过supervivi进行修改,具体如下:
Supervivi> menu
##### FriendlyARM BIOS for 2440 #####
[v] Download vivi
[k] Download linux kernel
[y] Download root_yaffs image
[c] Download root_cramfs image
[n] Download Nboot
[e] Download Eboot
Download WinCE NK.nb0
[w] Download WinCE NK.bin
[d] Download & Run
[f] Format the nand flash
[p] Partition for Linux
Boot the system
Set the boot parameters
[t] Print the TOC struct of wince
[q] Goto shell of vivi
Enter your selection: s
##### Parameter Menu #####
[r] Reset parameter table to default table
Set parameter
[v] View the parameter table
[w] Write the parameter table to flash memeory
[q] Quit
Enter your selection: s
Enter the parameter's name(mach_type, media_type, linux_cmd_line, etc): mach_type
Enter the parameter's value(if the value contains space, enclose it with "): 362
Change 'mach_type' value. 0x0000030e(782) to 0x0000016a(362)
##### Parameter Menu #####
[r] Reset parameter table to default table
Set parameter
[v] View the parameter table
[w] Write the parameter table to flash memeory
[q] Quit
Enter your selection: w
Found block size = 0x0000c000
Erasing... ... done
Writing... ... done
Written 49152 bytes
Saved vivi private data
##### Parameter Menu #####
[r] Reset parameter table to default table
Set parameter
[v] View the parameter table
[w] Write the parameter table to flash memeory
[q] Quit
Enter your selection: v
Number of parameters: 9
name : hex integer
-------------------------------------------------------------
mach_type : 0000016a 362
media_type : 00000003 3
boot_mem_base : 30000000 805306368
baudrate : 0001c200 115200
xmodem : 00000001 1
xmodem_one_nak : 00000000 0
xmodem_initial_timeout : 000493e0 300000
xmodem_timeout : 000f4240 1000000
boot_delay : 01000000 16777216
Linux command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200
##### Parameter Menu #####
[r] Reset parameter table to default table
Set parameter
[v] View the parameter table
[w] Write the parameter table to flash memeory
[q] Quit
Enter your selection: q
修改之后再启动可以看见如下的启动信息
Copy linux kernel from 0x00050000 to 0x30008000, size = 0x00200000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
MACH_TYPE = 362
NOW, Booting Linux......
Uncompressing Linux.................................................................................................. done, booting the kernel.
Linux version 2.6.22.6 (root@localhost.localdomain) (gcc version 4.0.0 (DENX ELDK 4.1 4.0.0)) #2 Mon Sep 29 10:37:24 EDT 2008
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: SMDK2440
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
..................省略
FAT: unable to read boot sector
VFS: Cannot open root device "mtdblock2" or unknown-block(31,2)
Please append a correct "root=" boot option; here are the available partitions:
1f00 16 mtdblock0 (driver?)
1f01 2048 mtdblock1 (driver?)
1f02 4096 mtdblock2 (driver?)
1f03 2048 mtdblock3 (driver?)
1f04 4096 mtdblock4 (driver?)
1f05 10240 mtdblock5 (driver?)
1f06 24576 mtdblock6 (driver?)
1f07 16384 mtdblock7 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
通过以上信息可以知道MTD分区还没有设置好,解决方法等会再写吧..
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/59345/showart_1270685.html |
|