Chinaunix首页 | 论坛 | 博客
  • 博客访问: 336004
  • 博文数量: 92
  • 博客积分: 2500
  • 博客等级: 少校
  • 技术积分: 960
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-21 19:38
文章分类

全部博文(92)

文章存档

2010年(71)

2009年(21)

我的朋友

分类: 嵌入式

2009-09-22 18:42:06

Transplanting CS8900A Ethernet driver in the Linux2.6.26.5,and mount it to the file root system through nfs
1.Download and extract the linux kernel to the specified directory

$/source/kernel# tar-xjvf linux2.6.26.5tar.bz2 ;

$/source/kernel/linux2.6.26.5# cp arch/arm/configs/s3c2314_defconfig .config

/source/kernel/linux2.6.26.5:In this directory to modify or edit something.

 

2.Modify Makefile

Modify the root directory of the kernel Makefile, identify cross-cutting Editor:

#vim Makefile

Find ARCH and CROSS_COMPILE, modifying as following

ARCH = arm

CROSS_COMPILE = arm-softfloat-linux-gnu-

wq!

Setting PATH environment variable so that it can find your cross-editing tool chain:

#export PATH=$PATH:/home/linux/crosstool/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin

 

3.Adding NIC drivers to the kernel

#cp /mnt/hgfs/share/cs8900a.* drivers/net  

 

4.Modify Makefile

#vim drivers/net/Makefile

Adding one line in the file:

obj-$(CONFIG_CS8900a) += cs8900a.o

Saving and quit

 

5.Modify Kconfig

#vim drivers/net/Kconfig

Find the content as following:

config DM9000

        tristate "DM9000 support"

        depends on ARM && NET_ETHERNET

        select CRC32

        select MII

        ---help---

          Support for DM9000 chipset.

          To compile this driver as a module, choose M here.  The module
          will be called dm9000.
Adding content beneath that code:

config CS8900a
        tristate "CS8900a support"
        depends on ARM && NET_ETHERNET
        ---help---

 

6.Configuring the kernel support for Ethernet CS8900A

#make menuconfig

Device Drivers  ---> //Configure the network card driver

 Network device support  ---> 

 [*] Network device support  ---> 

 Ethernet (10 or 100Mbit)  ---> 

 [*]   Ethernet (10 or 100Mbit)  ---> 

 <*>   CS8900a support

Saving and quit, then generating config file

 

7.Compiling the kernel and then generating zImage

#make zImage

# cp /source/kernel/linux2.6.26/arch/arm/boot/zImage /tftpboot

 

8.Start super-terminal, there is some problem

FS2410#boot

 

mount: server 192.168.1.110 not responding, timed out
Root-NFS: Server returned error -5 while mounting /source/rootfs
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
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(2,0)

This kernel is compiled for ARM13bc-2410, however what we use is FS2410, through comparing two boards, we finally find the difference of IRQ

/source/kernel/linux-2.6.26.5/drivers/net# vim cs8900a.c

Find IQR18,change into IRQ9.

#boot

succeed!

阅读(1261) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~