1.make menuconfig出错
[root@stevenking linux-3.7]# make menuconfig
*** Unable to find the ncurses libraries or the
*** required header files.
*** 'make menuconfig' requires the ncurses libraries.
***
*** Install ncurses (ncurses-devel) and try again.
***
make[1]: *** [scripts/kconfig/dochecklxdialog] 错误 1
make: *** [menuconfig] 错误 2
[root@stevenking linux-3.7]# yum install ncurses
OK
2.添加对ARM的支持
makefile文件修改:ARCH ?= $(SUBARCH)
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
为:
ARCH ?= arm
CROSS_COMPILE ?= arm-linux-
OK
3.读取默认配置单
4.System Type
5.General Setup
6.Kernel Features
7.Device Drivers添加NAND Flash支持
![](https://img-my.csdn.net/uploads/201302/17/1361102446_4678.png)
![](https://img-my.csdn.net/uploads/201302/17/1361102461_1254.png)
![](https://img-my.csdn.net/uploads/201302/17/1361102283_9672.png)
8.生成默认配置
保存为.config,即为默认编译配置
9.杂七杂八
9.1 修改匹配机器码
arch/arm/tools/mach-types
修改s3c2440 ARCH_S3C2440 S3C2440362 为 168
9.2 修改nand flash相关文件
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "Boot Loader",
.size = SZ_256K,
.offset = 0,
},
[1] = {
.name = "params",
.offset = MTDPART_OFS_APPEN0,
.size = SZ_128K,
},
[2] = {
.name = "kernel",
.offset = 0x200000,
.size = 0x300000,
},
[3] = {
.name = "rootfs",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL,
}
};
static struct s3c2410_platform_nand smdk_nand_info = {
.tacls = 10,
.twrph0 = 25,
.twrph1 = 10,
.nr_sets = ARRAY_SIZE(smdk_nand_sets),
.sets = smdk_nand_sets,
};
chip->ecc.mode = NAND_ECC_NONE;//NAND_ECC_HW;
9.3 修改频率
arch/arm/mach-s3c24xx/mach-smdk2440.c
s3c24xx_init_clocks(16934400);改为12000000
以下为运行结果:
Boot Loader By Steven King 2013.2.12
Starting ......
Copying kernel from nand flash ......
Senel params ......
Booting kernel .Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.7.0-StevenKing (root@stevenking.localdomain) (gcc version 4.3.23
CPU1129200] revision 0 (ARMv4T), cr=c0: VIVT data cache, VIVT instruction cache
Mach40
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C24XX Clocks, Copyright 2004 ronics
S3C244X: core 4 memory 100.000 MHz, peripheral 50.000 MHz
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone orde grouping on. Total pages: 16256
Kernel command line: no/dev/mtdblock2 init=/linuxrc console=ttySAC0,1ash table )
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 59948k/59948k available, 5588k reserved, 0K highmem
Virtual kernel m:
vector : 0xffff0000 - 0xffff1000 ( fixmap : 0xfff00000 - 0xfffe0000 )
vmalloc : 0xc4800000 - 0xff000000 ( 936 MB)
lo000000 - 0x 64 MB)
modules : - 0xc0000000 ( 16 MBext : 0xc0008000 - 0xc044d370 (4373 kB)
xc044e000 - 0xc0471dd4 ( 144 kB)
.dat00 - 0xc049f420 ( 182 kB)
.bss : 0xcg subpending status 000_clock: 32 bits at 200 Hz, resolution 5s
Console: colour dummy device 80x30
Calibrating delay loop... 199.47 BogoMIPS (lpj=498688)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entPU: Testing ok
Setting up static identity map for 0x30346638 - 0x30346690
NET: Registered mily 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
S3C Power Management, Copyright 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C244X: Clock Support, DVS off
bio: create0> at 0
SCSI subsystem initialized
usbcore: registered new interfacefs
usbcore: registered new interface driver hub
usbcore:new device driver usb
Advanced Linux Sound Arriver Initialized.
NET: Registered protocol family 2
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
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
RPX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (extended precision)
jffs2: version 2.2. (NAND) (SUMMARY) �© 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 117
io scheduler noop registered
io schedue registered
io scheduler cfq regiault)
Consong to colour frame buffer device 30x40
s3c2410-lcd s3c2410-lcd: fb0: s3c2410fb frame buffer device
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
s3c2440-uart.0: ttySAC0 at MMIO 0x50000000 (irq = 70) is a S3C2440
console [ttySAC0] enabled
s3c2440-uart.1: ttySAC1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: ttySAC2 at MMIO 0x50008000 (irq = 76) is a S3C2440
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
brd: module loaded
loodule loaded
s3c24xx-nand s3c2440-nand: Tacls=1, 10ns Twrph0=3 30ns, Twrph1=1 10ns
s3c24xx-nand s3c2440-nand: NAND ECC disabled
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-b4
NAND_ECC_NONE selected by board driver. This is not recommended!
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND":
0x000000000000-0x000000200000 : "Boot Loader"
0x000000200000-0x000000500000 : "Kernel"
00x000010000000 : "RootFS"
dm9000 Ethernet Driver, V1.31
ohci_hcd: USB 1.1 'Open' Host OHCI) Driver
s3c2410-oohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: regisnterface driver usbserial
usbcore: registered new interfaial: USB Serial support registered for generic
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI Ure: registered new interface3
usbserial: USB Serial support registered for pl2303
mousedev: PS/2 mouse device common for all mice
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq disabled
TCP: cubic registered
NET: Registered protocol family 17
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
ALSA device list:
No soundcards found.
List of all partitions:
1f00 2048 mtdblock0 (drik1 (driver?)
1f02 257024 mtdblock2 (driver?)
No filesystem could mount root, tried: ext3 ext2 cramfs vfat msdos iso9660 roms
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
[<c001a958>] (unwind_backtrace+0x0/0xf8) from [<c0343f98>] (panic+0x80/0x1e8)
[<c0343f98>] (panic+0x80/0x1e8) from [<c044ecd4>] (mount_block_root+0x1fc/0x264)
[<c044ecd4>] (mount_block_root+0x1fc/0x264) from [<c044edbc>] (mount_root+0x80/)
[<c0unt_root+0x80/0x100) from [<c044ef48>] (prepare_namespace+0x10c/0x1cc)
[<c044ef48>] (prepare_namespace+0x10c/0x1cc) from [<c0340094>] (kernel_init+0x1)
[<c0340094>] (kernel_init+0x168/0x3ret_from_fork+0x14/0x24)