1、将源码网卡驱动整个目录(假设叫DM9000,呵呵)放在你的BSP(如smdk2410)DRIVERS目录下;
2、将DM9000目录写入dirs文件(加入这个文件后才会被编译):
eg:
DIRS= \
drvlib \
serial \
wavedev \
…… \
DM9000
3、在platform.bib(或project.bib)的MODULES段内添加,告诉编译器dm9000.dll(名字由驱动源码目录
下的*.def指定,LIBRARY后的名字就是,假设就叫dm9000)将被打包进内核
dm9000.dll $(_FLATRELEASEDIR)\dm9000.dll NK SH
4、在platform.reg(或project.reg)里注册驱动,可以参考下面的例子,不过最好看源码里的参数的需求,
有些驱动的在初始化时需要从注册表项读取参数,如中断号,GPIO之类的。
eg:
[HKEY_LOCAL_MACHINE\Comm\DM9CE]
"DisplayName"="DM9000 ISA Fast Ethernet Adapter"
"Group"="NDIS"
"ImagePath"="dm9000.dll"
[HKEY_LOCAL_MACHINE\Comm\DM9CE\Linkage]
"Route"=multi_sz:"DM9CE1"
[HKEY_LOCAL_MACHINE\Comm\DM9CE1]
"DisplayName"="DM9000 ISA Fast Ethernet Adapter"
"Group"="NDIS"
"ImagePath"="dm9000.dll"
[HKEY_LOCAL_MACHINE\Comm\Tcpip\Linkage]
"Bind"="dm9pci1"
[HKEY_LOCAL_MACHINE\Comm\DM9CE1\Parms]
"BusNumber"=dword:0
"BusType"=dword:1
"XmitBuffer"=dword:A
"RecvBuffer"=dword:20
"SysIntr"=dword:13
[HKEY_LOCAL_MACHINE\Comm\DM9CE1\Parms\TcpIp]
"EnableDHCP"=dword:0
"UseZeroBroadcast"=dword:0
"DefaultGateway"="x.x.x.x."
"IpAddress"="x.x.x.x."
"Subnetmask"="x.x.x.x"
"DNS"="x.x.x.x"
"WINS"="x.x.x.x"