文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>uclinux(2.6内核)在s3c44b0上的移植(二)

uclinux(2.6内核)在s3c44b0上的移植(二)

时间:2006-08-24  来源:szarm

昆明理工大学嵌入式实验室([email protected] [email protected]) (转载请注明出处) ====================================================================   7,增加串口驱动。内核源代码中只带了44b0的简易串口驱动。要自己编写串口驱动程序:
(1), 增加文件。(文件可参考4510的串口驱动,有需要的请与我联系)
     linux-2.6.x/drivers/serial/serial_s3c44b0.c
     linux-2.6.x/include/asm-armnommu/arch-s3c44b0x/uart.h
(2),修改linux-2.6.x/drivers/serial/Kconfig,添加44B0X串口相关内容
config SERIAL_S3C44B0X
       bool 'S3C44B0X Serial Support'
       default y
       select SERIAL_CORE
       help
       Samsung S3C44B0X Chips has built-in serial controler
config SERIAL_S3C44B0X_CONSOLE
       bool "Support for console on S3C44B0X Serial port"
       depends on SERIAL_S3C44B0X=y
       select SERIAL_CORE_CONSOLE
       help
          Allow selection of the S3C44B0X on-board serial ports for use as
          an virtual console.
(3),修改linux-2.6.x/drivers/serial/Makefile,添加44B0x的相关内容:
  obj-$(CONFIG_SERIAL_S3C44B0X) += serial_s3c44b0.o
(4),修改linux-2.6.x/include/linux/serial_core.h,在其中加入PORT_S3C44B0的定义:
 #define PORT_S3C44B0   62
(5),修改linux-2.6.x/arch/armnommu/mach-s3c44b0x/driver中Makefile和Kconfig文件,注释掉原来与简易串口相关的内容。 (6),linux-2.6.x/drivers/serial/serial_s3c44b0.c中将有
      CONFIG_SERIAL_S3C44B0_CONSOLE改为:CONFIG_SERIAL_S3C44B0X_CONSOLE
     并设置波特率为正确的值。
(7)记得要根据自己板子配置serial_s3c44b0.c中的static void __s3c44b0_init(struct uart_port *port, int baud)函数中的寄存器的值。
  8,增加网卡驱动。我的网络芯片用的是RTL8019AS,不出意外的话,市面上所有44B0板子上都是用的该芯片,只是有的用的是8bit,有的用的是16bit模式,驱动也要做相应的改动才行。我的是用的8bit模式。 这里只讲一下要注意的地方:网卡的中断号,中断的初始化,网卡的基址等等。 网卡驱动后,可以配置一下NFS和FTP来测试一下网络。 (1).配置内核:
   进入File Systems --->Network file systems --->选项选中:
 [*]NFS file system support
 [*]Provide NFSv3 client support
(2).配置用户选项
   进入Network Applications ---> 选项选中:
 [*]portmap  
   进入BusyBox --->选项选中:
 [*]mount 
 [*]mount:support NFS mounts
 [*]umount
(3). 在linux主机上,配置NFS server
   (1),编辑/etc/exportfs文件,添加如下内容:
      /test  *(rw, sync, no_root_squash)
   (2),输入以下命令:
      #service portmap start
      #service nfs start
      #exportfs -rv   (重新共享/etc/exports中共享出来的目录)
      #showmount -e   (查看所有共享目录)
(4).编译内核,下载到开发板运行时,用如下方法进行NFS挂接
   输入如下命令:
 #portmap& (记住一定要运行该命令,否则NFS客户机无法找到从NFS服务器共享的目录)
        #mount –t nfs 192.168.0.110:/test        /mnt 
 #ls /mnt
   完成网卡驱动后,测试ftp,出现问题:
   在测试ftp时,登录进去后运行ls命令和其他命令,网络会变得很慢,bye命令后会出现错误:
skput:over: 0c01e530:80 put: dev:eth0221 Goodbye. 然后用ping命令来测试网络,网络延时会变得很长。

 
9,boa web server的移植。
   (1),配置用户选项时,进入Network Applications ---> 选项选中:boa
        进入lib选项,选中build libZ
   (2),修改uClinux-dist/user/boa/src/defines.h文件,添加定义 #define SERVER_ROOT "/home/web"
   (3),修改uClinux-dist/user/boa/examples/boa.conf文件
 Port 80
 User 0
 Group 0
 ServerAdmin  root@localhost
 DocumentRoot  /home/web/html
 UserDir  public_html
 DirectoryIndex  index.html
 KeepAliveMax  100
 KeepAliveTimeout  10
 MimeTypes  /home/web/mime.types
 DefaultType  text/plain
 ScriptAlias  /cgi-bin  /home/web/cgi-bin
 ScriptAlias  /index.html  /home/web/html/index.html
        以上就是boa.conf的最简单配置,其他都可屏蔽掉,有些内容不屏蔽掉会出错。
   (4),修改romfs/etc/inittab文件,添加如下内容:
        boa:unknown:/bin/boa  -c/home/web
   (5),将uClinux-dist/user/boa/examples/boa.conf和mime.types两个文件copy到romfs/home/web。
   这样配置后,html文件全部放到/home/web/html文件夹里,cgi文件放到/homt/web/cgi-bin文件夹里,可以将html和cgi-bin文件夹设成nfs文件系统,这样可以马上测试编写的网页程序。(mount -t nfs 192.168.0.100:/web /home/web/html)
相关阅读 更多 +
排行榜 更多 +
改善老人生活

改善老人生活

飞行射击 下载
跑酷大冲刺最新版

跑酷大冲刺最新版

休闲益智 下载
商场女孩

商场女孩

休闲益智 下载