1
开始
insert module & remove module
insert modle
includes
--"probe board"
--"get and analyse board infomation "
--"request irq"
--"register board as some type(character type, block type, and so on..)" *这里有一个参数是文件跳转表*
... as Ur need
FYI: <linux/pci.h> <linux/moudle.h> ...
NOTE: linux/GNU system is a VM system, so after you get board infomation, the board base access address is PHYS_ADDR,
if yr pci board don't use DMA mode to transfer data, you have to call IOREMAP() routine tp get VIRT_ADDR.
remove module (release resouce)
-- ioumap, unregister, freeirq ...
2
根据文件跳转表去一一完善各个子功能
e.g.
brd_open
brd_close
brd_read
brd_write
brd_ioctl
....
这样在user level,open/close/read/write /dev/brd, 就会对应到这些routines,也就是打开/关闭/读写/控制 target board.
3.
如果在insert module routine 里面 request irq, 在加一个interrupt service routine,通常就是set 一下flag
That‘s all
12[/SIZE]