| 
					阅读:3755回复:13
				 application如何与driver进行交互?
					在windows和liunx下面的driver都是把device当做file来操作,在application里面直接调用open,write等函数就可以直接和driver交互数据,可是在Mac OS X是如何实现的呢?我在Mac OS X下面用I/O Kit开发了一个简单的PCI driver,我想请教一下,那么如何来安装我的driver,同时如何来和application交互数据呢?				 | |
| 沙发#发布于:2003-04-17 10:15 
					大概得实现一个user client吧				 | |
| 板凳#发布于:2003-04-17 18:14 
					yes.paranoid may be right .I use user clint to talk to my usb device.				 | |
| 
 | 
| 地板#发布于:2003-04-21 09:16 
					macWin,你能不能把你的实现原理,给我讲讲,如果能把你的代码email给我,那就太好了。3x				 | |
| 地下室#发布于:2003-04-21 09:56 
					你可以先参照苹果网站上的例子simpleuserclient,simpledataqueue
 | |
| 5楼#发布于:2003-04-21 11:05 
					paranoid is right!
 参照苹果网站上的例子simpleuserclient | |
| 
 | 
| 6楼#发布于:2003-04-22 17:04 
					paranoid,这两个例子实在是太好了。可是我有个问题:既然user client也是运行在kernel上,那么如何安装user client呢?是不是安装driver的时候也就已经安装上了user client呢?或者说user client就是driver的一部分?				 | |
| 7楼#发布于:2003-04-22 17:29 
					You are right ! The user client is a part of driver . It will be loaded when driver loaded .				 | |
| 
 | 
| 8楼#发布于:2003-04-22 17:56 
					多谢macwin回答。
 我还想问问你,你是否用过POSIX里的device file来实现过和driver交互过数据吗?就象在liunx下的driver一样?我觉得用user client来实现有点复杂,是不是? | |
| 9楼#发布于:2003-04-23 09:32 
					You may be right . I am always looking for a simple way to 
 commute data between AP and Driver .And I known little about device file . | |
| 
 | 
| 10楼#发布于:2003-04-23 09:55 
					苹果网站上有两个pdf是关于app和driver之间的通信的
 AccessingHardware,WritingDeviceDriver 按照她的文档来讲,当前只有storage,serial,network devices可以通过使用device file这种形式的接口来通信。 而pci,文当中说There are no device interface for PIC and AGP devices.看来只能自力更生了。 | |
| 11楼#发布于:2003-04-23 11:23 
					多谢二位的回答,决定放分了! :D :D :D				 | |
| 12楼#发布于:2003-04-23 11:32 
					To paranoid : I am writting a utility to send vendor command (like scsi cmd format) to the U Disk on Mac OS X.
 I use use client. But It runs not stable enough . I want to find a way like device file to send scsi command to the U disk . Do u have some idear about that ? Thanks . | |
| 
 | 
| 13楼#发布于:2003-04-23 13:23 
					简单的情形下可以使用setProperties,这样接口比较简单,不易出错。方法为在user client端实现setProperties函数,app中调用IOConnectSetCFProperties传递你的消息
 To paranoid : I am writting a utility to send vendor command (like scsi cmd format) to the U Disk on Mac OS X. | |
 
							
 
				 
				