• «
  • 1
  • 2
  • »
  • Pages: 1/2     Go
主题 : 移植linux2.6.29时出现file system readonly 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 11848
精华: 0
发帖: 7
金钱: 35 两
威望: 7 点
综合积分: 14 分
注册时间: 2009-12-22
最后登录: 2010-06-30
楼主  发表于: 2009-12-23 15:29

 移植linux2.6.29时出现file system readonly

在检测坏块时出现:
<6>Scanning device for bad blocks
Creating 8 MTD partitions on "NAND 128MiB 3,3V 8-bit":
<5>Creating 8 MTD partitions on "NAND 128MiB 3,3V 8-bit":
0x000000000000-0x000000030000 : "bootloader"
<5>0x000000000000-0x000000030000 : "bootloader"
mtd: partition<"bootloader" doesn't end on an erase block -- force read-only
4>mtd: partition "bootloader" doesn't end on an erase block -- force read-only
0x000000050000-0x000000250000 : "kernal"
<5>0x000000050000-0x000000250000 : "kernal"
mtd: partition "kerna<" doesn't start on an erase block boundary -- force read-only
4>mtd: partition "kernal" doesn't start on an erase block boundary -- force read-only
0x000000250000-0x000003ffc000 : "root"
<5>0x000000250000-0x000003ffc000 : "root"
mtd: partition "roo<" doesn't start on an erase block boundary -- force read-only
4>mtd: partition "root" doesn't start on an erase block boundary -- force read-only


最后又出现
VFS: Mounted root (yaffs filesystem) readonly on device 31:2.
VFS: Mounted root (yaffs filesystem) readonly on device 31:2.

请问这是什么为题,怎么解决,谢谢!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-12-23 21:54
<5>0x000000000000-0x000000030000 : "bootloader"
mtd: partition<"bootloader" doesn't end on an erase block -- force read-only

MTD分区的大小必须是NAND Flash块大小的整数倍。对于128M的NAND Flash来说,块大小是128K字节(0x20000)。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 11848
精华: 0
发帖: 7
金钱: 35 两
威望: 7 点
综合积分: 14 分
注册时间: 2009-12-22
最后登录: 2010-06-30
2楼  发表于: 2009-12-24 12:56
我设了三个分区:
static struct mtd_partition smdk_default_nand_part[] = {

       [0] = {
       .name = "bootloader",
       .offset = 0x00000000,
       .size = 0x00060000,
       },
       [1] = {
       .name = "kernel",
       .offset = 0x00060000,
       .size = 0x00500000,
       },
       [2] = {
       .name = "root",
       .offset = 0x00560000,
       .size = 0x07a00000,
       }
};

运行后出现I/O error,以下是我的启动信息
load Image of Linux...Uncompressing Linux.......................................................................................................................... done, booting the kernel.
<5>Linux version 2.6.29.1 (zhaojie@computer) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #12 Wed Dec 23 19:20:22 CST 2009
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: Study-S3C2440
<7>Converting old-style param struct to taglist
<4>ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
<7>On node 0 totalpages: 16384
<7>free_area_init_node: node 0, pgdat c03ba8e8, node_mem_map c03e9000
<7>  Normal zone: 128 pages used for memmap
<7>  Normal zone: 0 pages reserved
<7>  Normal zone: 16256 pages, LIFO batch:3
CPU S3C2440A (id 0x32440001)
<6>S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
<5>Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
<7>timer tcon=00000000, tcnt a4ca, tcfg 00000200,00000000, usec 00001e57
Console: colour dummy device 80x30
<6>console [ttySAC0] enabled
Linux version 2.6.29.1 (zhaojie@computer) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #12 Wed Dec 23 19:20:22 CST 2009
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: Study-S3C2440
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
irq: clearing subpending status 00000002
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
<Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
6>Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
<6>Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory:<6>Memory: 64MB 64MB = 64MB total
= 64MB total
Memory: 60876KB available (3508K code, 302K data, 156K init)
<5>Memory: 60876KB available (3508K code, 302K data, 156K init)
Calibrating delay loop... <6>Calibrating delay loop... 201.93 BogoMIPS (lpj=504832)
201.93 BogoMIPS (lpj=504832)
Mount-cache hash table entries: 512
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: <6>CPU: Testing write buffer coherency: ok
ok
net_namespace: 716 bytes
<6>net_namespace: 716 bytes
NET: Registered protocol family 16
<6>NET: Registered protocol family 16
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4808000, irq 33
DMA channel 0 at c4808000, irq 33
DMA channel 1 at c4808040, irq 34
DMA channel 1 at c4808040, irq 34
DMA channel 2 at c4808080, irq 35
DMA channel 2 at c4808080, irq 35
DMA channel 3 at c48080c0, irq 36
DMA channel 3 at c48080c0, irq 36
S3C244X: Clock Support, DVS off
S3C244X: Clock Support, DVS off
bio: create slab <bio-0> at 0
bio: create slab <bio-0> at 0
SCSI subsystem initialized
<5>SCSI subsystem initialized
usbcore: registered new interface driver usbfs
<6>usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
<6>usbcore: registered new interface driver hub
usbcore: registered new device driver usb
<6>usbcore: registered new device driver usb
NET: Registered protocol family 2
<6>NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
<6>IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TC< established hash table entries: 2048 (order: 2, 16384 bytes)
6>TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
<6>TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
<6>TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
<6>TCP reno registered
NET: Registered protocol family 1
<6>NET: Registered protocol family 1
J<FS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
6>JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
yaffs Dec 23 2009 19:15:19 Installing.
yaffs Dec 23 2009 19:15:19 Installing.
msgmni has been set to 119
<6>msgmni has been set to 119
io scheduler noop registered
<6>io scheduler noop registered
io scheduler anticipatory registered (default)
<6>io scheduler anticipatory registered (default)
io scheduler deadline registered
<6>io scheduler deadline registered
io scheduler cfq registered
<6>io scheduler cfq registered
Console: switching to colour frame buffer device 30x40
Console: switching to colour<frame buffer device 30x40
fb0: s3c2410fb frame buffer device
6>fb0: s3c2410fb frame buffer device
lp: driver loaded but no devices found
<6>lp: driver loaded but no devices found
ppdev: user-space parallel port driver
<6>ppdev: user-space parallel port driver
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
<6>Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
s3c2440-uart<0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
6>s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
<6>s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
<6>s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
<6>brd: module loaded
loop: module loaded
<6>loop: module loaded
dm9000 Ethernet Driver, V1.31
<6>dm9000 Ethernet Driver, V1.31
Uniform Multi-Platform E-IDE driver
<6>Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
<6>ide-gd driver 1.18
ide-cd driver 5.00
<6>ide-cd driver 5.00
Driver 'sd' needs updating - please use bus_type methods
<4>Driver 'sd' needs updating - please use bus_type methods
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c24<0-nand s3c2440-nand: Tacls=1, 9ns Twrph0=4 39ns, Twrph1=1 9ns
6>s3c2440-nand s3c2440-nand: Tacls=1, 9ns Twrph0=4 39ns, Twrph1=1 9ns
NAND device: Manufac<urer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
6>NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
<6>Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 128MiB 3,3V 8-bit":
<5>Creating 3 MTD partitions on "NAND 128MiB 3,3V 8-bit":
0x000000000000-0x000000060000 : "bootloader"
<5>0x000000000000-0x000000060000 : "bootloader"
0x000000060000-0x000000560000 : "kernel"
<5>0x000000060000-0x000000560000 : "kernel"
0x000000560000-0x000007f60000 : "root"
<5>0x000000560000-0x000007f60000 : "root"
usbmon: debugfs is not available
<5>usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
<6>ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
<6>s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-oh<i s3c2410-ohci: new USB bus registered, assigned bus number 1
6>s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
<6>s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
<6>usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
<6>hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
<6>hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver libusual
<6>usbcore: registered new interface driver libusual
usbcore: registered new interface driver usbserial
<6>usbcore: registered new interface driver usbserial
USB Serial support registered for generic
<6>USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
<6>usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
<6>usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
<6>USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
<6>usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
<6>ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
USB Serial support registered for pl2303
<6>USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
<6>usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
<6>pl2303: Prolific PL2303 USB to serial adaptor driver
mice: PS/2 mouse device common for all mice
<6>mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2440-i2c s3c2440-i2c: no platform data
<3>s3c2440-i2c s3c2440-i2c: no platform data
s3c2440-i2c: probe of s3c2440-i2c failed with error -22
<4>s3c2440-i2c: probe of s3c2440-i2c failed with error -22
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
<6>S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-w<t s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
6>s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
TCP cubic registered
<6>TCP cubic registered
NET: Registered protocol family 17
<6>NET: Registered protocol family 17
RPC: Registered udp transport module.
<6>RPC: Registered udp transport module.
RPC: Registered tcp transport module.
<6>RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)

uncorrectable error : <3>uncorrectable error : <3>end_request: I/O error, dev mtdblock2, sector 0<3>end_request: I/O error, dev mtdblock2, sector 0
Buffer I/O error on device mtdblock2, logical block 0
<3>Buffer I/O error on device mtdblock2, logical block 0
uncorrectable error : <3>uncorrectable error : <3>end_request: I/O error, dev mtdblock2, sector 0
<3>end_request: I/O error, dev mtdblock2, sector 0
Buffer I/O error on device mtdblock2, logical block 0
<3>Buffer I/O error on device mtdblock2, logical block 0
uncorrectable error : <3>uncorrectable error : <3>end_request: I/O error, dev mtdblock2, sector 8
<3>end_request: I/O error, dev mtdblock2, sector 8
Buffer I/O error on device mtdblock2, logical block 1
<3>Buffer I/O error on device mtdblock2, logical block 1
uncorrectable error : <3>uncorrectable error : <3>end_request: I/O error, dev mtdblock2, sector 8
<3>end_request: I/O error, dev mtdblock2, sector 8
Buffer I/O error on device mtdblock2, logical block 1
<3>Buffer I/O error on device mtdblock2, logical block 1
uncorrectable error : <3>uncorrectable error : <3>end_request: I/O error, dev mtdblock2, sector 16
<3>end_request: I/O error, dev mtdblock2, sector 16
Buffer I/O error on device mtdblock2, logical block 2
<3>Buffer I/O error on device mtdblock2, logical block 2
uncorrectable error : <3>uncorrectable error : <3>end_request: I/O error, dev mtdblock2, sector 16
<3>end_request: I/O error, dev mtdblock2, sector 16
Buffer I/O error on device mtdblock2, logical block 2
<3>Buffer I/O error on device mtdblock2, logical block 2
uncorrectable error : <3>uncorrectable error : <3>end_request: I/O error, dev mtdblock2, sector 24
<3>end_request: I/O error, dev mtdblock2, sector 24
Buffer I/O error on device mtdblock2, logical block 3
<3>Buffer I/O error on device mtdblock2, logical block 3
uncorrectable error : <3>uncorrectable error : <3>end_request: I/O error, dev mtdblock2, sector 24
<3>end_request: I/O error, dev mtdblock2, sector 24
Buffer I/O error on device mtdblock2, logical block 3
<3>Buffer I/O error on device mtdblock2, logical block 3
uncorrectable error : <3>uncorrectable error : <3>end_request: I/O error, dev mtdblock2, sector 64
<3>end_request: I/O error, dev mtdblock2, sector 64
isofs_fi<l_super: bread failed, dev=mtdblock2, iso_blknum=16, block=32
4>isofs_fill_super: bread failed, dev=mtdblock2, iso_blknum=16, block=32
yaffs: dev is 32505858 name is "mtdblock2"
<6>yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
<6>yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: auto selecting yaffs2
yaffs: auto selecting yaffs2
yaffs_read_super: isCheckpointed 0
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) on device 31:2.
VFS: Mounted root (yaffs filesystem) on device 31:2.
Freeing init memory: 156K
<6>Freeing init memory: 156K
Failed to execute /linuxrc.  Attempting defaults...
<4>Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - no< syncing: No init found.  Try passing init= option to kernel.
0>Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
级别: 新手上路
UID: 11848
精华: 0
发帖: 7
金钱: 35 两
威望: 7 点
综合积分: 14 分
注册时间: 2009-12-22
最后登录: 2010-06-30
3楼  发表于: 2009-12-24 13:01
usbmon: debugfs is not available
unable to open rtc device (rtc0)
这个又怎么解决,谢谢!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2009-12-24 13:27

 回 2楼(yumufenglin) 的帖子

问题不在于你分几个区,而在于你必须确保内核的分区表和镜像烧录时bootloader所用的分区表是一致的。
uncorrectable error :

这说明内核的MTD层读取NAND Flash上数据时ECC校验出错,多半是因为yaffs文件系统镜像没有正确烧录进NAND Flash。你最好把你是怎么制作,烧写yaffs镜像的步骤贴出来。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
5楼  发表于: 2009-12-24 13:29
引用第3楼yumufenglin于2009-12-24 13:01发表的  :
usbmon: debugfs is not available
unable to open rtc device (rtc0)
这个又怎么解决,谢谢!

debugfs可以忽略。rtc的问题在于内核镜像中没有包含S3C2440的RTC驱动,但这不会影响系统启动。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 11848
精华: 0
发帖: 7
金钱: 35 两
威望: 7 点
综合积分: 14 分
注册时间: 2009-12-22
最后登录: 2010-06-30
6楼  发表于: 2009-12-24 14:23
我是参考网上的移植流程,然后以下是我根据自己的板子后修改的:
有的网上说linuxrc要写一个脚本文件,但我参考的那个没有说要修改,
只是一个链接linuxrc->busybox,这边有关系吗?我的内核是2.6.29,是不是内核版本高了这个不需要了?再次谢谢!

2、移植内核
(1) 解压源码tar -jxvf linux-2.6.29.1.tar.bz2 -C /work/nfs_boot/
(2) 进入内核目录,修改makefile,并对内核进行默认配置进行修改
       193行,修改
       ARCH            ?=arm
       CROSS_COMPILE   ?=arm-linux-
(3) 修改平台输入时钟
找到内核源码arch/arm/mach-s3c2440/mach-smdk2440.c文件,在函数 static void __init smdk2440_map_io(void)中,修改成s3c24xx_init_clocks(12000000)。
(4) 修改machine名称(可以不改)
修改文件arch/arm/mach-s3c2440/mach-smdk2440.c,在文件中找到MACHINE_START( ),修改为MACHINE_START(S3C2440, “Study-S3C2440”)。
(5) 修改Nand flash分区信息
修改文件kernel.git/arch/arm/plat-s3c24xx/common-smdk.c。
第一,修改分区信息:
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
       .name = "bootloader",
       .offset = 0x00000000,
       .size = 0x00060000,
       },
[1] = {
       .name = "kernel",
       .offset = 0x00060000,
       .size = 0x00500000,
       },
[2] = {
       .name = "root",
       .offset = 0x00560000,
       .size = 0x07a00000,
       }
};

第二,再修改s3c2410_platform_nand_smdk_nand_info smdk_nand_info = {

.tacls = 0,
.twrph0 = 30,
.twrph1=0,

};
(6) 修改LCD背光
修改文件/arch/arm/mach-s3c2440/mach-smdk2440.c,因为友善的3.5寸液晶的背光控制是由S3C2440的GPG4引脚来控制的,故下面的改动将开启背光。
static void __init smdk2440_machine_init(void)
{
       s3c24xx_fb_set_platdata(&smdk2440_fb_info);
       platform_add_devices(smdk2440_devices,ARRAY_SIZE(smdk2440_devices));
       s3c2410_gpio_cfgpin(S3C2410_GPG4,S3C2410_GPG4_OUTP);
   s3c2410_gpio_setpin(S3C2410_GPG4,1);                                     smdk_machine_init();
}
(7) LCD参数修改
这里用的是NEC3.5英寸屏液晶屏,大小为320x240,需要修改修改文件arch/arm/mach-s3c2440/mach-smdk2440.c。
static struct s3c2410fb_display smdk2440_lcd_cfg __initdata =
{
       …
      .right_margin = 37,
.hsync_len = 6,  
.upper_margin =2,
.lower_margin = 6,
.vsync_len =2,
};
static struct s3c2410fb_mach_info smdk2440_fb_info   __initdata=
{

.default_display =0
.gpccon = 0xaa955699,
.gpccon_mask = 0xffc003cc,
.gpcup = 0x0000ffff,
.gpcup_mask = 0xffffffff,
.gpdcon = 0xaa95aaa1,
.gpdcon_mask = 0xffc0fff0,
  .gpdup = 0x0000faff,
  .gpdup_mask = 0xffffffff,
.lpcsel = 0xf82,
};
(7) 给内核打yaffs2文件系统的补丁
cd /work/nfs_boot
tar -zxvf /work/nfs_boot/cvs-root.tar.gz -C /work/nfs_boot
cd /work/nfs_boot/cvs/yaffs2/
./patch-ker.sh c /work/nfs_boot/linux-2.6.29.1/  
如果fs/Makefile中没有这句话ojb-$(CONFIG_YAFFS_FS) +=yaffs2/,则手动加上
(8) 修改S3C2440的机器号
由于Bootloader传递给Linux内核的机器号为1999,为与Bootloader传递参数一致,修改 arch/arm/tools/math-types文件。
s3c2440      ARCH_S3C2440       S3C2440      362
修改为:
s3c2440      ARCH_S3C2440       S3C2440      1999
(9) 配置内核模块的功能,有几种方式可以进行界面选择:
make menuconfig(文本选单的配置方式,在有字符终端下才能使用)
make xconfig(图形窗口模式的配置方式,图形窗口的配置比较直观,必须支持Xwindow下才能使用)
make oldconfig(文本配置方式,在原内核配置的基础修改时使用)
这里使用make menuconfig命令。
[*]Enable loadable module support--->
              [*]Forced module loading
              [*]Module unloading
System Type--->
           S3C2410 Machines--->
              [*]SMDK2410/A9M2410选上 其余不选
           S3C2440 Machines--->
              [*]SMDK2440
              [*]SMDK2440 with S3C2440 CPU module,其余不选
其余的Machines下选项全部不选(如2400,2412,2442,2443)
Kernel Features--->
[*]Use the ARM EABI to compile the kernel
Boot options-
noinitrd root=/dev/mtdblock2 init=/linuxrc  console=ttySAC0
Userspace binary formats--->
            [*]Kernel support for ELF binaries
其它的可以全部不选。
选择支持yaffs2文件系统
Filesystem--->
    Miscellaneous filesystems--->
             <*>YAFFS2 file system support
             [*]Lets Yaffs do its own ECC
             [*]Autoselect yaffs2 format
[*]Disable lazy loading
[*]Turn off wide tnodes
[*]Force chunk erase check
              Native language support
<*> Codepage 437 (United States,Canada)
<*>Simplified Chinese charset(GB2312)
<*>Traditional Chinese charset(Big5)
<*>NLS ISO 8859-1(Latin1:Western European Languages)
<*>NLS UTF-8
Device Drivers--->
     Graphics support--->
              <*>Support for frame buffer devices--->
                      [*]Enable firmware EDID
                      [*]Enable Video Mode Handling Helpers
                      <*>S3C2410 LCD framebuffer support
              Console display driver support--->
                     <*>Framebuffer Console support
                     [*]Select compiled-in fonts
                     [*] VGA8x8 font
                     [*]VGA8x16 font
[*]Bootup logo--->
       [*]Standard black and white Linux logo
       [*]Standard 16-color Linux logo
       [*]Standard 224-color Linux logo
在Bootup logo--->选择的那几项,将会在系统启动时在液晶上显示开机logo。
(10) 编译内核
在/work/nfs_boot/下make  zImage。
注:在2.4的内核版本中要make dep用来生成依赖关系,但是在2.6的内核中不需要,你可以试一下,会出现unnecessary。
如果你要清楚上次编译的结果,用make clean。
3、制作根文件系统
(1) 建立根文件系统目录, 进入到/work/nfs_boot目录,新建建立根文件系统目录的脚本文件create_rootfs_bash,使用命令chmod +x create_rootfs_bash改变文件的可执行权限,./create_rootfs_bash运行脚本,就完成了根文件系统目录的创建。
#!/bin/sh
echo "------Create rootfs directons start...--------"
mkdir rootfs
cd rootfs
echo "--------Create root,dev....----------"
mkdir root dev etc boot tmp var sys proc lib mnt home opt
mkdir etc/init.d etc/rc.d etc/sysconfig
mkdir usr/sbin usr/bin usr/lib usr/modules
mkdir mnt/usb mnt/nfs mnt/sd
mkdir var/lib var/lock var/run var/tmp
chmod 1777 tmp
chmod 1777 var/tmp
echo "-------make direction done---------"

如果在mkdir usr/sbin usr/bin usr/lib usr/modules这句话时出现错误,就手动创建,我就是在这无法创建。
(2) 建立动态链接库
cd /work/nfs_boot
tar –zxvf root_qtopia.tgz –C /work/nfs_boot
cp –rfd /work/nfs_boot/root_qtopia/lib/* /work/nfs_boot/rootfs/lib/*
(3) 交叉编译Bosybox
Bosybox是一个遵循GPL v2协议的开源项目,它在编写过程总对文件大小进行优化,并考虑了系统资源有限(比如内存等)的情况,使用Busybox可以自动生成根文件系统所需的bin、sbin、usr目录和linuxrc文件。
(3-1) 解压busybox
cd /work/nfs_boot
tar -zxvf busybox-1.13.3.tar.tgz –C /work/nfs_boot
(3-2) 进入源码,修改Makefile文件:
cd /work/nfs_boot/busybox-1.13.3
修改:
       CROSS_COMPILE   ?=arm-linux-       //第164行
       ARCH            ?=arm                  //第189行
(3-3) 配置busybox
输入make menuconfig进行配置
Busybox Settings--->
       General Configuration--->
            [*] Show verbose applet usage messages
            [*] Store applet usage messages in compressed form
            [*] Support –install [-s] to install applet links at runtime
            [*] Enable locale support(system needs locale for this to work)
            [*] Support for –long-options
[*] Use the devpts filesystem for unix98 PTYs
[*] Support writing pidfiles
[*] Runtime SUID/SGID configuration via /etc/busybox.config
[*]  Suppress warning message if /etc/busybox.conf is not readable
Build Options--->
[*] Build BusyBox as a static binary(no shared libs)
[*] Build with Large File Support(for accessing files>2GB)
Installation Options->
[]Don’t use /usr
Applets links (as soft-links) --->
(./_install) BusyBox installation prefix

Busybox Library Tuning --->
            (6)Minimum password legth
            (2)MD5:Trade Bytes for Speed
[*]Fsater /proc scanning code(+100bytes)
[*]Command line editing
(1024)Maximum length of input
[*]vi-style line editing commands
(15) History size
[*]History saving
[*]Tab completion
[*]Fancy shell prompts
(4) Copy buffer size ,in kilobytes      
[*]Use ioctl names rather than hex values in error messages
[*]Support infiniband HW
Linux Module Utilities--->
(/lib/modules)Default directory containing modules
(modules.dep)Default name of modules.dep
[*]insmod
[*]rmmod
[*]lsmod
[*]modprobe
-----options common to multiple modutils
[ ] support version 2.2/2.4 Linux kernels
[*]Support tainted module checking with new kernels
[*]Support for module .aliases file
[*] support for modules.symbols file
Linux System Utilities  --->              
        [*]Support /etc/mdev.conf        
        [*]Support command execution at device addition/removal
(3-4) 编译busybox
编译busybox到指定目录:
cd /work/nfs_boot/busybox-1.13.3
make CONFIG_PREFIX=/work/nfs_boot/rootfs install
在rootfs目录下会生成目录bin、sbin、usr和文件linuxrc的内容。
(4) 建立etc目录下的配置文件
(4-1) etc/mdev.conf文件
如果你的系统需要一些比默认的root/root 660更多的权限,你可以使用mdev的可选配置文件,以控制设备节点的所有者和权限。
文件的格式如下:
<device regex><uid>:<gid><octal permissions>
例如:
hd[a-z][0-9]*0:3 660
这个配置文件在第一个匹配处停止解析,如果没有匹配那么使用默认的0:0:660,
# system all-writable devices
full         0:0  0666
null         0:0  0666
ptmx         0:0  0666
random       0:0  0666
tty          0:0  0666
zero         0:0  0666
# console devices
tty[0-9]*    0:5  0660
vc/[0-9]*    0:5  0660
# serial port devices
s3c2410_serial0   0:5  0666      =ttySAC0
s3c2410_serial1   0:5  0666      =ttySAC1
s3c2410_serial2   0:5  0666      =ttySAC2
s3c2410_serial3   0:5  0666      =ttySAC3
# loop devices
loop[0-9]*    0:0  0660      =loop/
# i2c devices
i2c-0             0:0  0666      =i2c/0
i2c-1             0:0  0666      =i2c/1
# frame buffer devices
fb[0-9]           0:0  0666
# input devices
mice              0:0  0660      =input/
mouse.*           0:0  0660      =input/
event.*           0:0  0660      =input/
ts.*              0:0  0660      =input/
# rtc devices
rtc0              0:0  0644      >rtc
rtc[1-9]          0:0  0644
# misc devices
mmcblk0p1         0:0  0600      =sdcard */bin/hotplug
sda1              0:0  0600      =udisk * /bin/hotplug
(4-2) 拷贝主机etc目录下的passwd、group、shadow文件到rootfs/etc目录下。
注:shadow估计要用超级用户才能复制
(4-3) etc/sysconfig目录下新建文件HOSTNAME,内容为”zj”。
(4-4) etc/inittab文件:
#etc/inittab
::sysinit:/etc/init.d/rcS
::askfirst:-/bin/sh
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a –r
(4-5) etc/init.d/rcS文件
rcS在启动文件目录init.d下。

#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
runlevel=S
prevlevel=N
umask 022
export PATH runlevel prevlevel
/bin/hostname -F /etc/sysconfig/HOSTNAME
echo "----------munt all----------------">/dev/console
mkdir -p /dev/shm
/bin/mount -n -t proc none /proc
/bin/mount -n -t tmpfs tmpfs /dev/shm
/bin/mount -n -t tmpfs tmpfs /dev
/bin/mount -n -t ramfs none /tmp
/bin/mount -n -t ramfs none /var
/bin/mount -n -t sysfs sysfs /sys
echo /sbin/mdev>/proc/sys/kernel/hotplug
mdev -s
mkdir /dev/pts
mount -t devpts devpts /dev/pts -o mode=0622
mkdir -p /var/lock
echo "network interface">/dev/console
/sbin/ifconfig lo 127.0.0.1
/sbin/ifconfig eth0 192.168.1.230 up
sleep 1
echo "****************Studying ARM*********************">/dev/console
echo "Kernel version:linux-2.6.29.1">/dev/console
echo "Student:Feng dong rui">/dev/console
echo "Date:2009.07.15">/dev/console
echo "**************************************************">/dev/console

使用以下命令改变rcS的执行权限:
Chmod +x rcS
(4-6) etc/profile文件:
#Ash profile
#vim:syntax=sh
#No core file by defaults
#ulimit -S -c 0>/dev/null 2>&1
USER="id -un"
LOGNAME=$USER
PS1='[\u@\h=W]#'
PATH=$PATH
HOSTNAME='/bin/hostname'
export USER LOGNAME PS1 PATH
(4-7) resolv.conf
该文件存放DNS信息,访问外网时需要DNS。
nameserver 192.168.1.1
(5) 创建dev目录
mdev是调用init进程来启动的,在使用mdev构建dev目录前,init进程需要用到/dev/console和/dev/null这两个设备文件,所以在制作文件系统时要静态创建这两个设备文件。
sudo mknod -m 600 dev/console c 5 1
sudo mknod -m 600 dev/null    c 1 3
如果运行时有问题,看下dev/console、dev/null这两个设备是不是有普通用户权限
(6) 制作根文件系统映像文件
使用以下命令安装好yaffs文件系统制作工具:
cd /work/nfs_root
tar -zxvf mkyaffs2image.tgz –C /
在/work/nfs_root目录下,使用命令mkyaffs2image rootfs rootfs.img生成根文件系统映像文件。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
7楼  发表于: 2009-12-24 14:28
如果你不知道你在做什么,抄再多的步骤出来也是没用的。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 11848
精华: 0
发帖: 7
金钱: 35 两
威望: 7 点
综合积分: 14 分
注册时间: 2009-12-22
最后登录: 2010-06-30
8楼  发表于: 2009-12-24 14:28
具体烧写我用的是linux下的dnw。我的系统是ubuntu9.04
我的bootloader是supervivi-128.
我每次烧写是先分区,再烧supervivi-128、zImage、yaffs2文件系统。烧写的时候都是采用默认的地址
级别: 新手上路
UID: 11848
精华: 0
发帖: 7
金钱: 35 两
威望: 7 点
综合积分: 14 分
注册时间: 2009-12-22
最后登录: 2010-06-30
9楼  发表于: 2009-12-24 14:30
引用第7楼kasim于2009-12-24 14:28发表的  :
如果你不知道你在做什么,抄再多的步骤出来也是没用的。


我前几天刚买的板子,所以只是在初学,我想先烧写一个内核,就参考他们的来了。
  • «
  • 1
  • 2
  • »
  • Pages: 1/2     Go