当前位置:Linux教程 - Linux文化 - S3C44B0开发板移植内核2.6 uclinux记录

S3C44B0开发板移植内核2.6 uclinux记录


Sam Fei (email: [email protected])

最新内核编译 2 这个编译器不支持.incbin的缘故, 下载新的编译器 2 现在注释掉gettimeoffset = s3c44b0x_gettimeoffset后,编译: 3 注释掉MOD_DEC_USE_COUNT和MOD_INC_USE_COUNT 3 2.6.9内核 5 开始动手 5 没有内核映象文件 6 修改Makefile,增加bzImage 6 还是没有希望的映象出现. 和2.4内核编译的Makefile进行比较: 7 修改Makefile,增加linux,images 7 运行试试看 8 修正RAM和FLASH地址问题 9 增加romfs 10 编译,运行 11 检查romfs/bin, 缺省配置的命令太少了. 12 增加了命令配置,重新编译,但好像内核映象没有改变.但命令确实编译出来了 12 增加串口驱动 13 增加了串口驱动,错误依然.应该跟串口驱动没有关系了. 15 Panic错误原因 17 串口驱动波特率问题 24 去除简易串口驱动配置 24 2个sh 27 串口正常后提示信息,第一阶段完成 27 最后说明 29

开发板: Micetek EV44B0-II board, CPU:S3C44B0X RAM:8M FLASH:2M SMSC LAN91C113网卡.

S3C44B0 CPU 2.6内核的官方网站是http://opensrc.sec.samsung.com/, 看了网站的资料后,我们首先要做的就是下载最新的内核来试试看.其中下面的文章值得一读. http://opensrc.sec.samsung.com/document/Getting_Familiar_with_uClinuxARM2_6.html

最新内核编译 http://opensrc.sec.samsung.com/下载补丁linux-2.6.11.8-hsc0.patch.gz www.kernel.org下载linux-2.6.11.8.tar.gz. [root@samfei ]# tar zxvf linux-2.6.11.8.tar.gz [root@samfei ]# cd linux-2.6.11.8 [root@samfei linux-2.6.11.8]# patch -p1 < ../linux-2.6.11.8-hsc0.patch [root@samfei linux-2.6.11.8]# ARCH=arm CROSS_COMPILE=arm-elf- make menuconfig [root@samfei linux-2.6.11.8]# ARCH=arm CROSS_COMPILE=arm-elf- make CC arch/arm/kernel/asm-offsets.s In file included from arch/arm/kernel/asm-offsets.c:13: include/linux/sched.h: In function `arch_pick_mmap_layout': include/linux/sched.h:1174: `TASK_UNMAPPED_BASE' undeclared (first use in this function) include/linux/sched.h:1174: (Each undeclared identifier is reported only once include/linux/sched.h:1174: for each function it appears in.) make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1 make: *** [arch/arm/kernel/asm-offsets.s] Error 2 include/asm/arch/memory.h中增加TASK_UNMAPPED_BASE定义 [root@samfei linux-2.6.11.8]# ARCH=arm CROSS_COMPILE=arm-elf- make usr/initramfs_data.S: Assembler messages: usr/initramfs_data.S:29: Error: Unknown pseudo-op: `.incbin' make[1]: *** [usr/initramfs_data.o] Error 1 make: *** [usr] Error 2

这个编译器不支持.incbin的缘故, 下载新的编译器 我现在使用的是arm-elf-tools-20030314.sh.下载新的编译器: http://opensrc.sec.samsung.com/download/arm-elf-tools-20040427.sh 并安装后,重新编译:

[root@samfei linux-2.6.11.8]# ARCH=arm CROSS_COMPILE=arm-elf- make arch/arm/mach-s3c44b0x/time.c: In function `s3c44b0x_time_init': arch/arm/mach-s3c44b0x/time.c:95: `gettimeoffset' undeclared (first use in this function) arch/arm/mach-s3c44b0x/time.c:95: (Each undeclared identifier is reported only once arch/arm/mach-s3c44b0x/time.c:95: for each function it appears in.) arch/arm/mach-s3c44b0x/time.c:99: warning: implicit declaration of function `s3c44b0x_clear_pb' arch/arm/mach-s3c44b0x/time.c:100: warning: implicit declaration of function `s3c44b0x_unmask_irq' make[1]: *** [arch/arm/mach-s3c44b0x/time.o] Error 1 make: *** [arch/arm/mach-s3c44b0x] Error 2 [root@samfei linux-2.6.11.8]#

现在注释掉gettimeoffset = s3c44b0x_gettimeoffset后,编译: [root@samfei linux-2.6.11.8]# ARCH=arm CROSS_COMPILE=arm-elf- make CC arch/arm/mach-s3c44b0x/driver/rtl8019.o arch/arm/mach-s3c44b0x/driver/rtl8019.c: In function `nic_8019_open': arch/arm/mach-s3c44b0x/driver/rtl8019.c:218: `MOD_INC_USE_COUNT' undeclared (first use in this function) arch/arm/mach-s3c44b0x/driver/rtl8019.c:218: (Each undeclared identifier is reported only once arch/arm/mach-s3c44b0x/driver/rtl8019.c:218: for each function it appears in.) arch/arm/mach-s3c44b0x/driver/rtl8019.c:216: warning: unused variable `j' arch/arm/mach-s3c44b0x/driver/rtl8019.c: In function `nic_8019_stop': arch/arm/mach-s3c44b0x/driver/rtl8019.c:286: `MOD_DEC_USE_COUNT' undeclared (first use in this function) arch/arm/mach-s3c44b0x/driver/rtl8019.c: In function `nic_8019_start_xmit': arch/arm/mach-s3c44b0x/driver/rtl8019.c:296: warning: unused variable `priv' make[2]: *** [arch/arm/mach-s3c44b0x/driver/rtl8019.o] Error 1 make[1]: *** [arch/arm/mach-s3c44b0x/driver] Error 2 make: *** [arch/arm/mach-s3c44b0x] Error 2 [root@samfei linux-2.6.11.8]#

注释掉MOD_DEC_USE_COUNT和MOD_INC_USE_COUNT

GEN .version CHK include/linux/compile.h UPD include/linux/compile.h CC init/version.o LD init/built-in.o LD .tmp_vmlinux1 arch/arm/mach-s3c44b0x/built-in.o(.text+0x170): In function `v3_dma_clean_range': : multiple definition of `v3_flush_user_cache_range' arch/arm/mm/built-in.o(.text+0x1480): first defined here arch/arm/mach-s3c44b0x/built-in.o(.text+0x170): In function `v3_dma_clean_range': : multiple definition of `v3_flush_user_cache_all' arch/arm/mm/built-in.o(.text+0x1480): first defined here arch/arm/mach-s3c44b0x/built-in.o(.text+0x170): In function `v3_dma_clean_range': : multiple definition of `v3_coherent_kern_range' arch/arm/mm/built-in.o(.text+0x148c): first defined here arch/arm/mach-s3c44b0x/built-in.o(.init.data+0x0): multiple definition of `v3_cache_fns' arch/arm/mm/built-in.o(.init.data+0x70): first defined here /usr/local/bin/arm-elf-ld.real: Warning: size of symbol `v3_cache_fns' changed from 36 in arch/arm/mm/built-in.o to 32 in arch/arm/mach-s3c44b0x/built-in.o arch/arm/mach-s3c44b0x/built-in.o(.text+0x170): In function `v3_dma_clean_range': : multiple definition of `v3_dma_flush_range' arch/arm/mm/built-in.o(.text+0x1490): first defined here arch/arm/mach-s3c44b0x/built-in.o(.text+0x170): In function `v3_dma_clean_range': : multiple definition of `v3_flush_kern_cache_all' arch/arm/mm/built-in.o(.text+0x1480): first defined here arch/arm/mach-s3c44b0x/built-in.o(.text+0x170): In function `v3_dma_clean_range': : multiple definition of `v3_flush_kern_dcache_page' arch/arm/mm/built-in.o(.text+0x1490): first defined here arch/arm/mach-s3c44b0x/built-in.o(.text+0x170): In function `v3_dma_clean_range': : multiple definition of `v3_dma_inv_range' arch/arm/mm/built-in.o(.text+0x1490): first defined here arch/arm/mach-s3c44b0x/built-in.o(.text+0x170): In function `v3_dma_clean_range': : multiple definition of `v3_dma_clean_range' arch/arm/mm/built-in.o(.text+0x1498): first defined here kernel/built-in.o(.text+0x1cfb4): In function `kallsyms_expand_symbol': : undefined reference to `kallsyms_names' kernel/built-in.o(.text+0x1cfb8): In function `kallsyms_expand_symbol': : undefined reference to `kallsyms_token_index' kernel/built-in.o(.text+0x1cfbc): In function `kallsyms_expand_symbol': : undefined reference to `kallsyms_token_table' kernel/built-in.o(.text+0x1d020): In function `kallsyms_get_symbol_type': : undefined reference to `kallsyms_names' kernel/built-in.o(.text+0x1d024): In function `kallsyms_get_symbol_type': : undefined reference to `kallsyms_token_index' kernel/built-in.o(.text+0x1d028): In function `kallsyms_get_symbol_type': : undefined reference to `kallsyms_token_table' kernel/built-in.o(.text+0x1d07c): In function `get_symbol_offset': : undefined reference to `kallsyms_markers' kernel/built-in.o(.text+0x1d080): In function `get_symbol_offset': : undefined reference to `kallsyms_names' kernel/built-in.o(.text+0x1d0fc): In function `kallsyms_lookup_name': : undefined reference to `kallsyms_num_syms' kernel/built-in.o(.text+0x1d100): In function `kallsyms_lookup_name': : undefined reference to `kallsyms_addresses' kernel/built-in.o(.text+0x1d300): In function `kallsyms_lookup': : undefined reference to `kallsyms_addresses' kernel/built-in.o(.text+0x1d318): In function `kallsyms_lookup': : undefined reference to `kallsyms_num_syms' kernel/built-in.o(.text+0x1d450): In function `get_ksymbol_mod': : undefined reference to `kallsyms_num_syms' kernel/built-in.o(.text+0x1d4a4): In function `get_ksymbol_core': : undefined reference to `kallsyms_addresses' kernel/built-in.o(.text+0x1d570): In function `update_iter': : undefined reference to `kallsyms_num_syms' make: *** [.tmp_vmlinux1] Error 1 [root@samfei linux-2.6.11.8]#

一直不太明白上面的错误,实在搞不定了.而且后面试了其他的方法,但都有不定的错误.实在不行,于是另寻办法.

2.6.9内核 经过网上资料的查询和阅读,还是觉得2.6.9内核比较容易,因为网站上有2.6.9的uclinux补丁.具体是: http://opensrc.sec.samsung.com/download/linux-2.6.9-uc0-hsc0.patch.gz

因此我们从www.kernel.org上下载了linux-2.6.9.tar.bz2. 从www.uclinux.org上下载了linux-2.6.9-uc0.patch,这样呢我们就有了3个文件.

-rw-r--r-- 1 root root 36261440 2004-10-19 linux-2.6.9.tar.bz2 -rw-r--r-- 1 root root 357214 2004-11-23 linux-2.6.9-uc0-hsc0.patch -rw-r--r-- 1 root root 1231190 2004-10-28 linux-2.6.9-uc0.patch

然后我们从头开始做. 另一个需要的就是uclinux-dist包,我们使用uClinux-dist-20041215.tar.gz,因为我们用这个版本已经可以跑2.4内核了.

开始动手 具体我们参考上面文章中提到的方法. 解压uclinux-dist包: [root@samfei 44b0]# tar zxvf /home/software/uClinux-dist-20041215.tar.gz [root@samfei 44b0]# mv uClinux-dist micetek [root@samfei 44b0]# cd micetek [root@samfei micetek]# rm -rf linux-2.6.x [root@samfei micetek]# mv linux-2.6.9 linux-2.6.x [root@samfei micetek]# cd linux-2.6.x [root@samfei linux-2.6.x]# patch -p1 < ../../linux-2.6.9-uc0.patch [root@samfei linux-2.6.x]# patch -p1 < ../../linux-2.6.9-uc0-hsc0.patch

按照2.4内核的方法,增加vendor的文件. [root@samfei micetek]# cp linux-2.6.x/arch/armnommu/configs/s3c44b0x_defconfig vendors/Micetek/44b0//config.linux-2.6.x

然后make menuconfig配置后,编译: [root@samfei micetek]# make dep; make make ARCH=armnommu CROSS_COMPILE=arm-elf- -C linux-2.6.x dep make[1]: Entering directory `/home/44b0/micetek/linux-2.6.x' *** Warning: make dep is unnecessary now. make[1]: Leaving directory `/home/44b0/micetek/linux-2.6.x' make ARCH=armnommu CROSS_COMPILE=arm-elf- -C linux-2.6.x || exit 1 make[1]: Entering directory `/home/44b0/micetek/linux-2.6.x' CHK include/linux/version.h UPD include/linux/version.h SYMLINK include/asm -> include/asm-armnommu SPLIT include/linux/autoconf.h -> include/config/* ……..

没有内核映象文件 编译完了,很正常,但没有看到我希望的images下面的映象文件,只有一个romfs.img: [root@samfei micetek]# ls -l images ×ÜÓÃÁ¿ 152 -rw-r--r-- 1 root root 150528 10Ô 3 17:11 romfs.img

修改Makefile,增加bzImage 增加 LINUXTARGET = bzImage

[root@samfei micetek]# make make ARCH=armnommu CROSS_COMPILE=arm-elf- -C linux-2.6.x bzImage || exit 1 make[1]: Entering directory `/home/44b0/micetek/linux-2.6.x' ……

[root@samfei micetek]# ls -l images ×ÜÓÃÁ¿ 152 -rw-r--r-- 1 root root 150528 10Ô 3 17:20 romfs.img [root@samfei micetek]#

还是没有希望的映象出现. 和2.4内核编译的Makefile进行比较: [root@samfei micetek]# diff Makefile ../xm44b0/Makefile 43d42 < 237a237,240 > .PHONY: images > images: > $(MAKE) -C $(VENDDIR) images > 271c274,275 < subdirs: linux --- > #subdirs: linux > subdirs:

修改Makefile,增加linux,images 20 all: subdirs romfs modules modules_install image linux images

237 .PHONY: images 238 images: 239 $(MAKE) -C $(VENDDIR) images 240

273 .PHONY: subdirs 274 #subdirs: linux 275 subdirs:

[root@samfei micetek]# make for dir in include lib include user ; do [ ! -d $dir ] || make ARCH=armnommu CROSS_COMPILE=arm-elf- -C $dir || exit 1 ; done make[1]: Entering directory `/home/44b0/micetek/include' ……..

[root@samfei micetek]# ls images/ linux_bootram.bin linux_bootrom.bin romfs.img [root@samfei micetek]#

这下有了.

运行试试看

Welcome to MICETEK World! M(icetek)B(oot)L(oader) v1.0.2 (Jan 21 2003 - 15:09:41)

MBL code range: 0x0c700000 -> 0x0c717a98 DRAM Configuration: Bank #0: start 0x0c000000 8 MB FLASH Configuration: Bank: 2 MB Hit any key to stop autoboot: 0 EV44B0II ethernet driver v1.0 2003/01/08 by Qinwei, MICETEK Shanghai ARP broadcast 1 Server eth addr: 00:e0:4c:b1:22:0c TFTP from server 192.168.1.25; our IP address is 192.168.1.101 Filename 'linux_bootram.bin'. Load address: 0xc008000 Loading: T T T *********************************************************************************************************************************************************************************************************************************************************** done Bytes transferred = 1283292 (1394dc hex) ## Starting application at 0x0c008000 ...

没有显示啊!肯定是串口设置的问题了.配置的时候也没有去修改时钟频率.我现在是用MBL(u-boot)来引导的,因此其他的CPU参数还可以不用管.

修正RAM和FLASH地址问题 修改了CONFIG_ARM_CLK,但依然还是一样.经过仔细检查,发现RAM和FLASH的地址没有配置对.

配置正确后,运行: Welcome to MICETEK World! M(icetek)B(oot)L(oader) v1.0.2 (Jan 21 2003 - 15:09:41)

MBL code range: 0x0c700000 -> 0x0c717a98 DRAM Configuration: Bank #0: start 0x0c000000 8 MB FLASH Configuration: Bank: 2 MB Hit any key to stop autoboot: 0 EV44B0II ethernet driver v1.0 2003/01/08 by Qinwei, MICETEK Shanghai ARP broadcast 1 Server eth addr: 00:e0:4c:b1:22:0c TFTP from server 192.168.1.25; our IP address is 192.168.1.101 Filename 'linux_bootram.bin'. Load address: 0xc008000 Loading: ****************************************************************************************************************************************************************************************************************************************************************************** done Bytes transferred = 1381596 (1514dc hex) ## Starting application at 0x0c008000 ... Linux version 2.6.9-hsc0 ([email protected]) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #5 Mon Oct 3 20:02:08 CST 2005 CPU: Samsung-S3C44B0x [44b07700] revision 0 (ARMv4T) Machine: S3C44B0X Development Board Built 1 zonelists Kernel command line: PID hash table entries: 64 (order: 6, 1024 bytes) Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory: 8MB = 8MB total Memory: 6664KB available (1239K code, 120K data, 52K init) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) NET: Registered protocol family 16 init_module Samsung S3C44B0 Rtl8019as driver version 0.1 (2002-02-20) init eth0: 12:34:56:78:90:ab get_stats RAMDISK driver initialized: 16 RAM disks of 2048K size 1024 blocksize loop: loaded (max 8 devices) NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 512) NET: Registered protocol family 1 NET: Registered protocol family 17 VFS: Cannot open root device "" or unknown-block(0,255) Please append a correct "root=" boot option Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255)

增加romfs 由于2.6内核中没有了blkmem,因此具体的romfs文件不能按照2.4内核的做法,网上查到下面文章: 在S3C4510B上运行uClinux-2.6的过程(romfs直接链入image.ram) http://bbs.edw.com.cn/dispbbs.asp?boardID=20&ID=46160&page=1 我们参考其romfs的方法,具体做法: 修改linux-2.6.x/arch/armnommu/arch/kernel/vmlinux.lds.S, 添加romfs.o 81 *(.got) /* Global offset table */ 82 romfs_start = .; 83 romfs.o 84 romfs_end = .; 修改linux-2.6.x/arch/armnommu/kernel/setup.c,添加变量romfs_start,romfs_end及设置default_command_line 64 extern int _stext, _text, _etext, _edata, _end; 65 extern int romfs_start,romfs_end; 683 char *from = default_command_line; 685 sprintf(default_command_line, "root=/dev/ram0 initrd=0x%08lx,%ldk keepinitrd", (unsigned long)&romfs_start,((unsigned long)&romfs_end - (unsigned long)&romfs_start)>>10);

由于root文件系统使用/dev/ram0, 因此rc时就不能使用/dev/ram0, 而使用/dev/ram1, /dev/ram2, 因此同时修改vendors/Micetek/44b0/rc文件. 2 /bin/expand /etc/ramfs.img /dev/ram1

编译,运行 Welcome to MICETEK World! M(icetek)B(oot)L(oader) v1.0.2 (Jan 21 2003 - 15:09:41)

MBL code range: 0x0c700000 -> 0x0c717a98 DRAM Configuration: Bank #0: start 0x0c000000 8 MB FLASH Configuration: Bank: 2 MB Hit any key to stop autoboot: 0 EV44B0II ethernet driver v1.0 2003/01/08 by Qinwei, MICETEK Shanghai ARP broadcast 1 Server eth addr: 00:e0:4c:b1:22:0c TFTP from server 192.168.1.25; our IP address is 192.168.1.101 Filename 'linux_bootram.bin'. Load address: 0xc008000 Loading: ************************************************************************************************************************************************************************************************************************************************************************************************************* done Bytes transferred = 1537244 (1774dc hex) ## Starting application at 0x0c008000 ... Linux version 2.6.9-hsc0 ([email protected]) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #6 Mon Oct 3 20:51:33 CST 2005 CPU: Samsung-S3C44B0x [44b07700] revision 0 (ARMv4T) Machine: S3C44B0X Development Board Built 1 zonelists Kernel command line: root=/dev/ram0 initrd=0x0c14aef0,147k keepinitrd PID hash table entries: 64 (order: 6, 1024 bytes) Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory: 8MB = 8MB total Memory: 6512KB available (1386K code, 125K data, 52K init) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) checking if image is initramfs...it isn't (ungzip failed); looks like an initrd NET: Registered protocol family 16 init_module Samsung S3C44B0 Rtl8019as driver version 0.1 (2002-02-20) init eth0: 12:34:56:78:90:ab get_stats RAMDISK driver initialized: 16 RAM disks of 2048K size 1024 blocksize loop: loaded (max 8 devices) NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 512) NET: Registered protocol family 1 NET: Registered protocol family 17 RAMDISK: romfs filesystem found at block 0 RAMDISK: Loading 147KiB [1 disk] into ram disk... done. VFS: Mounted root (romfs filesystem) readonly. Freeing init memory: 52K Warning: unable to open an initial console. Kernel panic - not syncing: Attempted to kill init!

检查romfs/bin, 缺省配置的命令太少了. [root@samfei micetek]# ls -l romfs/bin ×ÜÓÃÁ¿ 140 -rwxr--r-- 1 root root 28196 10Ô 3 20:51 expand -rwxr--r-- 1 root root 29692 10Ô 3 20:51 init -rwxr--r-- 1 root root 76236 10Ô 3 20:51 sh [root@samfei micetek]#

增加了命令配置,重新编译,但好像内核映象没有改变.但命令确实编译出来了 [root@samfei micetek]# ls -l romfs/bin ×ÜÓÃÁ¿ 2212 -rwxr--r-- 11 root root 166372 10Ô 3 21:31 busybox -rwxr--r-- 11 root root 166372 10Ô 3 21:31 df -rwxr--r-- 1 root root 29888 10Ô 3 21:31 erase -rwxr--r-- 1 root root 32900 10Ô 3 21:31 eraseall -rwxr--r-- 1 root root 28196 10Ô 3 21:31 expand -rwxr--r-- 11 root root 166372 10Ô 3 21:31 ifconfig -rwxr--r-- 1 root root 38888 10Ô 3 21:31 inetd -rwxr--r-- 1 root root 29692 10Ô 3 21:31 init -rwxr--r-- 11 root root 166372 10Ô 3 21:31 mount -rwxr--r-- 11 root root 166372 10Ô 3 21:31 netstat -rwxr--r-- 11 root root 166372 10Ô 3 21:31 ping -rwxr--r-- 11 root root 166372 10Ô 3 21:31 route -rwxr--r-- 1 root root 76236 10Ô 3 21:31 sh -rwxr--r-- 11 root root 166372 10Ô 3 21:31 tail -rwxr--r-- 11 root root 166372 10Ô 3 21:31 telnet -rwxr--r-- 1 root root 50288 10Ô 3 21:31 telnetd -rwxr--r-- 1 root root 54200 10Ô 3 21:31 tftp -rwxr--r-- 11 root root 166372 10Ô 3 21:31 umount -rwxr--r-- 11 root root 166372 10Ô 3 21:31 vi [root@samfei micetek]#

修改了命令配置后,编译出来的内核还是老的romfs.o,这个应该是Makefile文件关联的问题,romfs.o是后加的. 重新编译后,panic情况依然如此!

增加串口驱动 增加文件drivers/serial/serial_s3c44b0.c和include/asm/arch/uart.h,修改drivers/serial/Kconfig, drivers/serial/Makefile及/include/linux/serial_core.h文件. In file included from drivers/serial/serial_s3c44b0.c:59: include/asm/arch/system.h: In function `arch_reset': include/asm/arch/system.h:19: warning: implicit declaration of function `mdelay' drivers/serial/serial_s3c44b0.c: In function `raw_printk': drivers/serial/serial_s3c44b0.c:133: warning: implicit declaration of function `raw_vprintk' drivers/serial/serial_s3c44b0.c: In function `raw_vprintk': drivers/serial/serial_s3c44b0.c:172: warning: control reaches end of non-void function drivers/serial/serial_s3c44b0.c: In function `__s3c44b0_rx_char': drivers/serial/serial_s3c44b0.c:220: warning: unused variable `status' drivers/serial/serial_s3c44b0.c: At top level: drivers/serial/serial_s3c44b0.c:546: `PORT_S3C44B0' undeclared here (not in a function) drivers/serial/serial_s3c44b0.c:546: initializer element is not constant drivers/serial/serial_s3c44b0.c:546: (near initialization for `__s3c44b0_ports[0].type') drivers/serial/serial_s3c44b0.c:547: initializer element is not constant drivers/serial/serial_s3c44b0.c:547: (near initialization for `__s3c44b0_ports[0]') drivers/serial/serial_s3c44b0.c:556: `PORT_S3C44B0' undeclared here (not in a function) drivers/serial/serial_s3c44b0.c:556: initializer element is not constant drivers/serial/serial_s3c44b0.c:556: (near initialization for `__s3c44b0_ports[1].type') drivers/serial/serial_s3c44b0.c:557: initializer element is not constant drivers/serial/serial_s3c44b0.c:557: (near initialization for `__s3c44b0_ports[1]') include/asm/arch/system.h:12: warning: `arch_idle' defined but not used make[3]: *** [drivers/serial/serial_s3c44b0.o] Error 1 make[2]: *** [drivers/serial] Error 2 make[1]: *** [drivers] Error 2 上面错误是没有在serial_core.h中增加PORT_S3C44B0定义造成的.

Welcome to MICETEK World! M(icetek)B(oot)L(oader) v1.0.2 (Jan 21 2003 - 15:09:41)

MBL code range: 0x0c700000 -> 0x0c717a98 DRAM Configuration: Bank #0: start 0x0c000000 8 MB FLASH Configuration: Bank: 2 MB Hit any key to stop autoboot: 0 EV44B0II ethernet driver v1.0 2003/01/08 by Qinwei, MICETEK Shanghai ARP broadcast 1 Server eth addr: 00:e0:4c:b1:22:0c TFTP from server 192.168.1.25; our IP address is 192.168.1.101 Filename 'linux_bootram.bin'. Load address: 0xc008000 Loading: ********************************************************************************************************************************************************************************************************************************************************************************************************************************************************** done Bytes transferred = 1770576 (1b0450 hex) ## Starting application at 0x0c008000 ... Linux version 2.6.9-hsc0 ([email protected]) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #9 Mon Oct 3 22:26:53 CST 2005 CPU: Samsung-S3C44B0x [44b07700] revision 0 (ARMv4T) Machine: S3C44B0X Development Board Built 1 zonelists Kernel command line: root=/dev/ram0 initrd=0x0c12a66c,511k keepinitrd PID hash table entries: 64 (order: 6, 1024 bytes) drivers/serial/serial_s3c44b0.c:613 __s3c44b0_console_init Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory: 8MB = 8MB total Memory: 6300KB available (1616K code, 106K data, 56K init) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) checking if image is initramfs...it isn't (ungzip failed); looks like an initrd NET: Registered protocol family 16 init_module Samsung S3C44B0 Rtl8019as driver version 0.1 (2002-02-20) init eth0: 12:34:56:78:90:ab get_stats ttyS0 at I/O 0x1d00000 (irq = 3) is a Samsung S3C44B0X Internal UART ttyS1 at I/O 0x1d04000 (irq = 2) is a Samsung S3C44B0X Internal UART RAMDISK driver initialized: 16 RAM disks of 2048K size 1024 blocksize NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 512) NET: Registered protocol family 1 NET: Registered protocol family 17 RAMDISK: romfs filesystem found at block 0 RAMDISK: Loading 511KiB [1 disk] into ram disk... done. VFS: Mounted root (romfs filesystem) readonly. Freeing init memory: 56K Warning: unable to open an initial console. Kernel panic - not syncing: Attempted to kill init!

增加了串口驱动,错误依然.应该跟串口驱动没有关系了.

修改linux/init/main.c中: 732 #if 0 733 if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) 734 printk("Warning: unable to open an initial console.\n"); 735 #else 736 if (sys_open((const char __user *) "/dev/ttyS0", O_RDWR, 0) < 0) 737 printk("Warning: unable to open an initial console.\n"); 738 #endif

编译,运行后提示: Welcome to MICETEK World! M(icetek)B(oot)L(oader) v1.0.2 (Jan 21 2003 - 15:09:41)

MBL code range: 0x0c700000 -> 0x0c717a98 DRAM Configuration: Bank #0: start 0x0c000000 8 MB FLASH Configuration: Bank: 2 MB Hit any key to stop autoboot: 0 EV44B0II ethernet driver v1.0 2003/01/08 by Qinwei, MICETEK Shanghai ARP broadcast 1 Server eth addr: 00:e0:4c:b1:22:0c TFTP from server 192.168.1.25; our IP address is 192.168.1.101 Filename 'linux_bootram.bin'. Load address: 0xc008000 Loading: ********************************************************************************************************************************************************************************************************************************************************************************************************************************************************** done Bytes transferred = 1770576 (1b0450 hex) ## Starting application at 0x0c008000 ... Linux version 2.6.9-hsc0 ([email protected]) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #10 Mon Oct 3 22:32:44 CST 2005 CPU: Samsung-S3C44B0x [44b07700] revision 0 (ARMv4T) Machine: S3C44B0X Development Board Built 1 zonelists Kernel command line: root=/dev/ram0 initrd=0x0c12a66c,511k keepinitrd PID hash table entries: 64 (order: 6, 1024 bytes) drivers/serial/serial_s3c44b0.c:613 __s3c44b0_console_init Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory: 8MB = 8MB total Memory: 6300KB available (1616K code, 106K data, 56K init) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) checking if image is initramfs...it isn't (ungzip failed); looks like an initrd NET: Registered protocol family 16 init_module Samsung S3C44B0 Rtl8019as driver version 0.1 (2002-02-20) init eth0: 12:34:56:78:90:ab get_stats ttyS0 at I/O 0x1d00000 (irq = 3) is a Samsung S3C44B0X Internal UART ttyS1 at I/O 0x1d04000 (irq = 2) is a Samsung S3C44B0X Internal UART RAMDISK driver initialized: 16 RAM disks of 2048K size 1024 blocksize NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 512) NET: Registered protocol family 1 NET: Registered protocol family 17 RAMDISK: romfs filesystem found at block 0 RAMDISK: Loading 511KiB [1 disk] into ram disk... done. VFS: Mounted root (romfs filesystem) readonly. Freeing init memory: 56K divisor=32 没有任何信息了.panic错误信息也没有了,还是没有打印出来?

Panic错误原因 经过一点一点调试,应该可以确定: 1. Kernel panic - not syncing: Attempted to kill init! 应该是/etc/inittab为空(也就是没有一行有效的,全是#开头!), 增加了inetd的定义后,没有出现这个错误. 2. ttyS0串口设置后,后面printk就出不来,表示串口驱动还是有问题.下面的信息是去除串口驱动配置后的提示,/bin/sh启动的时候,由于串口打不开,而一直在重新启动.

Welcome to MICETEK World! M(icetek)B(oot)L(oader) v1.0.2 (Jan 21 2003 - 15:09:41)

MBL code range: 0x0c700000 -> 0x0c717a98 DRAM Configuration: Bank #0: start 0x0c000000 8 MB FLASH Configuration: Bank: 2 MB Hit any key to stop autoboot: 0 EV44B0II ethernet driver v1.0 2003/01/08 by Qinwei, MICETEK Shanghai ARP broadcast 1 Server eth addr: 00:e0:4c:b1:22:0c TFTP from server 192.168.1.25; our IP address is 192.168.1.101 Filename 'linux_bootram.bin'. Load address: 0xc008000 Loading: ******************************************************************************************************************************************************************************************************************************************************************************************************************************************************* done Bytes transferred = 1753456 (1ac170 hex) ## Starting application at 0x0c008000 ... Linux version 2.6.9-hsc0 ([email protected]) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #19 Mon Oct 3 23:32:35 CST 2005 CPU: Samsung-S3C44B0x [44b07700] revision 0 (ARMv4T) Machine: S3C44B0X Development Board Built 1 zonelists Kernel command line: root=/dev/ram0 initrd=0x0c125ff8,511k keepinitrd PID hash table entries: 64 (order: 6, 1024 bytes) Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory: 8MB = 8MB total Memory: 6316KB available (1598K code, 106K data, 56K init) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) fs/namei.c:932 path_lookup name=/dev fs/namei.c:932 path_lookup name=/dev fs/namei.c:932 path_lookup name=/dev fs/namei.c:932 path_lookup name=/dev/console fs/namei.c:932 path_lookup name=/dev/console fs/namei.c:932 path_lookup name=/dev/console fs/namei.c:932 path_lookup name=/root fs/namei.c:932 path_lookup name=/root fs/namei.c:932 path_lookup name=/root checking if image is initramfs...it isn't (ungzip failed); looks like an initrd fs/open.c:952 sys_open filename=/initrd.image fs/open.c:764 filp_open filename=/initrd.image fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/initrd.image fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open NET: Registered protocol family 16 init_module Samsung S3C44B0 Rtl8019as driver version 0.1 (2002-02-20) init eth0: 12:34:56:78:90:ab get_stats RAMDISK driver initialized: 16 RAM disks of 2048K size 1024 blocksize NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 512) NET: Registered protocol family 1 NET: Registered protocol family 17 fs/namei.c:932 path_lookup name=/init fs/namei.c:932 path_lookup name=/sys fs/namei.c:932 path_lookup name=/sys fs/open.c:952 sys_open filename=/sys/block/ram0/dev fs/open.c:764 filp_open filename=/sys/block/ram0/dev fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/sys/block/ram0/dev fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/namei.c:932 path_lookup name=/sys fs/namei.c:932 path_lookup name=/sys fs/namei.c:932 path_lookup name=/dev/ram fs/namei.c:932 path_lookup name=/dev/ram fs/open.c:952 sys_open filename=/dev/ram fs/open.c:764 filp_open filename=/dev/ram fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/dev/ram fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/initrd.image fs/open.c:764 filp_open filename=/initrd.image fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/initrd.image fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open RAMDISK: romfs filesystem found at block 0 RAMDISK: Loading 511KiB [1 disk] into ram disk... done. fs/namei.c:932 path_lookup name=/dev/ram fs/namei.c:932 path_lookup name=/initrd.image fs/namei.c:932 path_lookup name=/dev/root fs/namei.c:932 path_lookup name=/dev/root fs/namei.c:932 path_lookup name=/root fs/namei.c:932 path_lookup name=/dev/root fs/namei.c:932 path_lookup name=/root fs/namei.c:932 path_lookup name=/dev/root fs/namei.c:932 path_lookup name=/root VFS: Mounted root (romfs filesystem) readonly. fs/namei.c:932 path_lookup name=/ fs/namei.c:932 path_lookup name=. fs/namei.c:932 path_lookup name=. Freeing init memory: 56K fs/open.c:952 sys_open filename=/dev/console fs/open.c:764 filp_open filename=/dev/console fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/dev/console fs/namei.c:1429 open_namei error=0 fs/open.c:821 dentry_open Warning: unable to open an initial console. fs/namei.c:932 path_lookup name=/sbin/init fs/open.c:817 dentry_open fs/namei.c:932 path_lookup name=/etc/singleboot fs/open.c:952 sys_open filename=/dev/null fs/open.c:764 filp_open filename=/dev/null fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/dev/null fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/namei.c:932 path_lookup name=/bin/sh fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/etc/rc fs/open.c:764 filp_open filename=/etc/rc fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/etc/rc fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/namei.c:932 path_lookup name=/bin/hostname fs/namei.c:932 path_lookup name=/usr/bin/hostname fs/namei.c:932 path_lookup name=/etc/hostname fs/namei.c:932 path_lookup name=/sbin/hostname fs/namei.c:932 path_lookup name=/usr/sbin/hostname fs/namei.c:932 path_lookup name=/bin/expand fs/namei.c:932 path_lookup name=/bin/expand fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/etc/ramfs.img fs/open.c:764 filp_open filename=/etc/ramfs.img fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/etc/ramfs.img fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/dev/ram1 fs/open.c:764 filp_open filename=/dev/ram1 fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/dev/ram1 fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/namei.c:932 path_lookup name=/bin/mount fs/namei.c:932 path_lookup name=/bin/mount fs/open.c:817 dentry_open fs/namei.c:932 path_lookup name=proc fs/namei.c:932 path_lookup name=/proc fs/namei.c:932 path_lookup name=/bin/mount fs/namei.c:932 path_lookup name=/bin/mount fs/open.c:817 dentry_open fs/namei.c:932 path_lookup name=/dev/ram1 fs/namei.c:932 path_lookup name=/var fs/namei.c:932 path_lookup name=/dev/ram1 fs/namei.c:932 path_lookup name=/bin/mkdir fs/namei.c:932 path_lookup name=/usr/bin/mkdir fs/namei.c:932 path_lookup name=/etc/mkdir fs/namei.c:932 path_lookup name=/sbin/mkdir fs/namei.c:932 path_lookup name=/usr/sbin/mkdir fs/namei.c:932 path_lookup name=/var/config fs/namei.c:932 path_lookup name=/bin/mkdir fs/namei.c:932 path_lookup name=/usr/bin/mkdir fs/namei.c:932 path_lookup name=/etc/mkdir fs/namei.c:932 path_lookup name=/sbin/mkdir fs/namei.c:932 path_lookup name=/usr/sbin/mkdir fs/namei.c:932 path_lookup name=/var/tmp fs/namei.c:932 path_lookup name=/bin/mkdir fs/namei.c:932 path_lookup name=/usr/bin/mkdir fs/namei.c:932 path_lookup name=/etc/mkdir fs/namei.c:932 path_lookup name=/sbin/mkdir fs/namei.c:932 path_lookup name=/usr/sbin/mkdir fs/namei.c:932 path_lookup name=/var/log fs/namei.c:932 path_lookup name=/bin/mkdir fs/namei.c:932 path_lookup name=/usr/bin/mkdir fs/namei.c:932 path_lookup name=/etc/mkdir fs/namei.c:932 path_lookup name=/sbin/mkdir fs/namei.c:932 path_lookup name=/usr/sbin/mkdir fs/namei.c:932 path_lookup name=/var/run fs/namei.c:932 path_lookup name=/bin/mkdir fs/namei.c:932 path_lookup name=/usr/bin/mkdir fs/namei.c:932 path_lookup name=/etc/mkdir fs/namei.c:932 path_lookup name=/sbin/mkdir fs/namei.c:932 path_lookup name=/usr/sbin/mkdir fs/namei.c:932 path_lookup name=/var/lock fs/namei.c:932 path_lookup name=/bin/cat fs/namei.c:932 path_lookup name=/usr/bin/cat fs/namei.c:932 path_lookup name=/etc/cat fs/namei.c:932 path_lookup name=/sbin/cat fs/namei.c:932 path_lookup name=/usr/sbin/cat fs/open.c:952 sys_open filename=/etc/motd fs/open.c:764 filp_open filename=/etc/motd fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/etc/motd fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/namei.c:932 path_lookup name=/bin/ifconfig fs/namei.c:932 path_lookup name=/bin/ifconfig fs/open.c:817 dentry_open fs/namei.c:932 path_lookup name=/bin/route fs/namei.c:932 path_lookup name=/bin/route fs/open.c:817 dentry_open fs/namei.c:932 path_lookup name=/bin/dhcpcd fs/namei.c:932 path_lookup name=/usr/bin/dhcpcd fs/namei.c:932 path_lookup name=/etc/dhcpcd fs/namei.c:932 path_lookup name=/sbin/dhcpcd fs/namei.c:932 path_lookup name=/usr/sbin/dhcpcd fs/namei.c:932 path_lookup name=/bin/dhcpcd fs/namei.c:932 path_lookup name=/usr/bin/dhcpcd fs/namei.c:932 path_lookup name=/etc/dhcpcd fs/namei.c:932 path_lookup name=/sbin/dhcpcd fs/namei.c:932 path_lookup name=/usr/sbin/dhcpcd fs/open.c:952 sys_open filename=/etc/inittab fs/open.c:764 filp_open filename=/etc/inittab fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/etc/inittab fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/dev/inet fs/open.c:764 filp_open filename=/dev/inet fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/dev/inet fs/namei.c:932 path_lookup name=/bin/inetd fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/dev/ttyS0 fs/open.c:764 filp_open filename=/dev/ttyS0 fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/dev/ttyS0 fs/namei.c:1429 open_namei error=0 fs/open.c:821 dentry_open fs/namei.c:932 path_lookup name=/bin/sh fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/dev/null fs/open.c:764 filp_open filename=/dev/null fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/dev/null fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/dev/null fs/open.c:764 filp_open filename=/dev/null fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/dev/null fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/var/run/inetd.pid fs/open.c:764 filp_open filename=/var/run/inetd.pid fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/var/run/inetd.pid fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/etc/inetd.conf fs/open.c:764 filp_open filename=/etc/inetd.conf fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/etc/inetd.conf fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/etc/services fs/open.c:764 filp_open filename=/etc/services fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/etc/services fs/namei.c:1429 open_namei error=0 fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/etc/config/inetd.conf fs/open.c:764 filp_open filename=/etc/config/inetd.conf fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/etc/config/inetd.conf fs/open.c:952 sys_open filename=/dev/ttyS0 fs/open.c:764 filp_open filename=/dev/ttyS0 fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/dev/ttyS0 fs/namei.c:1429 open_namei error=0 fs/open.c:821 dentry_open fs/namei.c:932 path_lookup name=/bin/sh fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/dev/ttyS0 fs/open.c:764 filp_open filename=/dev/ttyS0 fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/dev/ttyS0 fs/namei.c:1429 open_namei error=0 fs/open.c:821 dentry_open fs/namei.c:932 path_lookup name=/bin/sh fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/dev/ttyS0 fs/open.c:764 filp_open filename=/dev/ttyS0 fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/dev/ttyS0 fs/namei.c:1429 open_namei error=0 fs/open.c:821 dentry_open fs/namei.c:932 path_lookup name=/bin/sh fs/open.c:817 dentry_open fs/open.c:952 sys_open filename=/dev/ttyS0 fs/open.c:764 filp_open filename=/dev/ttyS0 fs/namei.c:1335 open_namei fs/namei.c:932 path_lookup name=/dev/ttyS0 fs/namei.c:1429 open_namei error=0 fs/open.c:821 dentry_open fs/namei.c:932 path_lookup name=/bin/sh fs/open.c:817 dentry_open

串口驱动波特率问题 串口驱动增加后,原来是: fs/namei.c:1429 open_namei error=0 divisor=32 divisor=32 drivers/serial/serial_s3c44b0.c:472 __s3c44b0_set_termios baud=9600 drivers/serial/serial_s3c44b0.c:474 __s3c44b0_set_termios quot=391à 波特率不对!

原来2.4内核配置的时候有缺省的console波特率的,但2.6检查后没有找到. 如果没有设置过,那么uart_get_baud_rate返回的波特率就是9600.

缺省的波特率是在调用console_setup的时候初始话的,但我们现在用的console是简易的串口驱动的console,因此没有调用过.也就是没有设置过波特率.

这里面要说明的就是: 2.6内核中带了1个串口的驱动,只是只有console部分,还不是完整的串口驱动,但它对我们调试内核是非常有帮助的,因为串口能很早就输出了,对于我调试后面的串口驱动是非常有好处的.如果你仔细看程序,我里面增加了一个raw_printk函数,也是这样的作用.

去除简易串口驱动配置 具体显示信息: Welcome to MICETEK World! M(icetek)B(oot)L(oader) v1.0.2 (Jan 21 2003 - 15:09:41)

MBL code range: 0x0c700000 -> 0x0c717a98 DRAM Configuration: Bank #0: start 0x0c000000 8 MB FLASH Configuration: Bank: 2 MB Hit any key to stop autoboot: 0 EV44B0II ethernet driver v1.0 2003/01/08 by Qinwei, MICETEK Shanghai ARP broadcast 1 Server eth addr: 00:e0:4c:b1:22:0c TFTP from server 192.168.1.25; our IP address is 192.168.1.101 Filename 'linux_bootram.bin'. Load address: 0xc008000 Loading: ********************************************************************************************************************************************************************************************************************************************************************************************************************************************************* done Bytes transferred = 1761776 (1ae1f0 hex) ## Starting application at 0x0c008000 ... drivers/serial/serial_core.c:1840 uart_set_options baud=115200 drivers/serial/serial_s3c44b0.c:473 __s3c44b0_set_termios baud=115200 drivers/serial/serial_s3c44b0.c:475 __s3c44b0_set_termios quot=33 Linux version 2.6.9-hsc0 ([email protected]) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #28 Tue Oct 4 08:19:19 CST 2005 CPU: Samsung-S3C44B0x [44b07700] revision 0 (ARMv4T) Machine: S3C44B0X Development Board Built 1 zonelists Kernel command line: root=/dev/ram0 initrd=0x0c12994c,511k keepinitrd PID hash table entries: 64 (order: 6, 1024 bytes) drivers/serial/serial_s3c44b0.c:617 __s3c44b0_console_init drivers/serial/serial_s3c44b0.c:585 __s3c44b0_console_setup divisor=32 divisor=32 Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory: 8MB = 8MB total Memory: 6308KB available (1613K code, 101K data, 56K init) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) checking if image is initramfs...it isn't (ungzip failed); looks like an initrd NET: Registered protocol family 16 ttyS0 at I/O 0x1d00000 (irq = 3) is a Samsung S3C44B0X Internal UART ttyS1 at I/O 0x1d04000 (irq = 2) is a Samsung S3C44B0X Internal UART RAMDISK driver initialized: 16 RAM disks of 2048K size 1024 blocksize NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 512) NET: Registered protocol family 1 NET: Registered protocol family 17 RAMDISK: romfs filesystem found at block 0 RAMDISK: Loading 511KiB [1 disk] into ram disk... done. VFS: Mounted root (romfs filesystem) readonly. Freeing init memory: 56K divisor=32 divisor=32 drivers/serial/serial_s3c44b0.c:473 __s3c44b0_set_termios baud=115200 drivers/serial/serial_s3c44b0.c:475 __s3c44b0_set_termios quot=33 Shell invoked to run file: /etc/rc Command: hostname EV44B0II Command: /bin/expand /etc/ramfs.img /dev/ram1 Command: mount -t proc proc /proc Command: mount -t ext2 /dev/ram1 /var Command: mkdir /var/config Command: mkdir /var/tmp Command: mkdir /var/log Command: mkdir /var/run Command: mkdir /var/lock Command: cat /etc/motd Welcome to ____ _ _ / __| ||_| _ _| | | | _ ____ _ _ _ _ | | | | | | || | _ \| | | |\ \/ / | |_| | |__| || | | | | |_| |/ \ | ___\____|_||_|_| |_|\____|\_/\_/ | | |_| for MICETEK EV44B0-II board Support by MICETEK Shanghai 2003.01 For further information check: http://www.uclinux.org/

Command: ifconfig lo 127.0.0.1 Command: route add -net 127.0.0.0 netmask 255.255.255.0 lo Command: dhcpcd -p -a eth0 & dhcpcd: Bad command or file name [16] Execution Finished, Exiting

Sash command shell (version 1.1.1) /> Sash command shell (version 1.1.1) />

前面调用过console_setup后,后面的波特率就对了.

2个sh 一个sh是配置了enable console shell,一个sh是inittab里的ttyS0:unknow:/bin/sh. 只需要一个就可以. 串口正常后提示信息,第一阶段完成 使用正常的串口驱动作为console.

Welcome to MICETEK World! M(icetek)B(oot)L(oader) v1.0.2 (Jan 21 2003 - 15:09:41)

MBL code range: 0x0c700000 -> 0x0c717a98 DRAM Configuration: Bank #0: start 0x0c000000 8 MB FLASH Configuration: Bank: 2 MB Hit any key to stop autoboot: 0 EV44B0II ethernet driver v1.0 2003/01/08 by Qinwei, MICETEK Shanghai ARP broadcast 1 Server eth addr: 00:e0:4c:b1:22:0c TFTP from server 192.168.1.25; our IP address is 192.168.1.101 Filename 'linux_bootram.bin'. Load address: 0xc008000 Loading: ********************************************************************************************************************************************************************************************************************************************************************************************************************************************************* done Bytes transferred = 1761776 (1ae1f0 hex) ## Starting application at 0x0c008000 ... drivers/serial/serial_core.c:1840 uart_set_options baud=115200 drivers/serial/serial_s3c44b0.c:473 __s3c44b0_set_termios baud=115200 drivers/serial/serial_s3c44b0.c:475 __s3c44b0_set_termios quot=33 Linux version 2.6.9-hsc0 ([email protected]) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #31 Tue Oct 4 08:31:03 CST 2005 CPU: Samsung-S3C44B0x [44b07700] revision 0 (ARMv4T) Machine: S3C44B0X Development Board Built 1 zonelists Kernel command line: root=/dev/ram0 initrd=0x0c129950,511k keepinitrd PID hash table entries: 64 (order: 6, 1024 bytes) drivers/serial/serial_s3c44b0.c:617 __s3c44b0_console_init drivers/serial/serial_s3c44b0.c:585 __s3c44b0_console_setup divisor=32 divisor=32 Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory: 8MB = 8MB total Memory: 6308KB available (1613K code, 101K data, 56K init) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) checking if image is initramfs...it isn't (ungzip failed); looks like an initrd NET: Registered protocol family 16 ttyS0 at I/O 0x1d00000 (irq = 3) is a Samsung S3C44B0X Internal UART ttyS1 at I/O 0x1d04000 (irq = 2) is a Samsung S3C44B0X Internal UART RAMDISK driver initialized: 16 RAM disks of 2048K size 1024 blocksize NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 512 bind 512) NET: Registered protocol family 1 NET: Registered protocol family 17 RAMDISK: romfs filesystem found at block 0 RAMDISK: Loading 511KiB [1 disk] into ram disk... done. VFS: Mounted root (romfs filesystem) readonly. Freeing init memory: 56K divisor=32 divisor=32 drivers/serial/serial_s3c44b0.c:473 __s3c44b0_set_termios baud=115200 drivers/serial/serial_s3c44b0.c:475 __s3c44b0_set_termios quot=33 Shell invoked to run file: /etc/rc Command: hostname EV44B0II Command: /bin/expand /etc/ramfs.img /dev/ram1 Command: mount -t proc proc /proc Command: mount -t ext2 /dev/ram1 /var Command: mkdir /var/config Command: mkdir /var/tmp Command: mkdir /var/log Command: mkdir /var/run Command: mkdir /var/lock Command: cat /etc/motd Welcome to ____ _ _ / __| ||_| _ _| | | | _ ____ _ _ _ _ | | | | | | || | _ \| | | |\ \/ / | |_| | |__| || | | | | |_| |/ \ | ___\____|_||_|_| |_|\____|\_/\_/ | | |_| for MICETEK EV44B0-II board Support by MICETEK Shanghai 2003.01 For further information check: http://www.uclinux.org/

Command: ifconfig lo 127.0.0.1 Command: route add -net 127.0.0.0 netmask 255.255.255.0 lo Command: dhcpcd -p -a eth0 & dhcpcd: Bad command or file name [16] Execution Finished, Exiting

Sash command shell (version 1.1.1) /> ps ax PID PORT STAT SIZE SHARED %CPU COMMAND 1 S 147K 0K 13.8 /sbin/init 2 R 0K 0K 0.0 ksoftirqd/0 3 S 0K 0K 0.1 events/0 4 S 0K 0K 0.0 khelper 5 S 0K 0K 0.0 kblockd/0 6 S 0K 0K 0.0 pdflush 7 S 0K 0K 0.0 pdflush 9 S 0K 0K 0.0 aio/0 8 S 0K 0K 0.0 kswapd0 17 S 67K 0K 1.4 /bin/inetd 18 S0 R 133K 0K 4.2 /bin/sh /> 最后说明 后面我继续调试了网卡驱动和MTD驱动,但都没有成功,而且碰到了比较大的困难.本来准备完成后再发表这个记录.但目前无法完成,因此提前发表这个记录.如果有谁成功完成网卡或MTD驱动的,希望能共享相关的信息. 我的附件patch中也包含了网卡和mtd的一些修改内容,各位也可以试试.

我联系email: [email protected].,有什么问题也可以email联系我.

文章中说的2个补丁后的补丁.具体补丁用法:

#tar zxvf /home/software/uClinux-dist-20041215.tar.gz #mv uClinux-dist micetek #cd micetek #rm -rf linux-2.6.x #mv linux-2.6.9 linux-2.6.x # cd linux-2.6.x # patch -p1 < ../../linux-2.6.9-uc0.patch # patch -p1 < ../../linux-2.6.9-uc0-hsc0.patch #cd .. #patch -p1 < ../xm44b0-2.6-1215-20051005.patch

网卡使用的驱动是smc91113.c(从2.4内核移植过来,基本没有改动什么),前面检测都正常了,就是接受数据包错误,具体的错误是: RCV: STATUS 1000 LENGTH 42 Reading 31 words and 0 byte(s) Receiving Packet Packet of length 62 0051 510f 0f00 004c 4c22 2208 0800 0008 0806 0600 0000 004c 4c22 22c0 c001 0100 0051 510f 0fc0 c001 0120 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 ---我们接受的数据包

000b 5100 0fff 00e0 4cb1 220c 0806 0001 0800 0604 0002 00e0 4cb1 220c c0a8 0119 000b 5100 0fff c0a8 0165 2020 2020 2020 2020 2020 2020 2020 2020 2020 2040 ------------正常的数据包(2.4内核)

我们的mac地址是 00 0b 51 00 0f ff, 错误接受的数据包看起来就是第2个字节变成了第3个字节, 第4个字节变成了第5个字节, ...

偶数字节都变成了下1个奇数字节的值.奇数字节是对的.

读取网卡数据的时候采用的是16位.奇怪的就是同样的程序在2.4内核下都正常.


摘自:linuxforum.net