Re: devfs user client
Re: devfs user client
- Subject: Re: devfs user client
- From: Godfrey van der Linden <email@hidden>
- Date: Mon, 11 Nov 2002 14:40:07 -0800
Darwin supports the use of dynamic devfs entry creation. A kext and
MODULE_START time can allocate a devfs entry and name iself anything
it wants.
An example of this can be found in IOSerialFamily/IOSerialBSDClient.cpp
Godfrey
At 21:28 +0100 02-11-11, Matthias Ringwald wrote:
Hi Andrew,
thanks for your answer.
Could somebody help me clarify things a bit more ?
For writing a working /dev/... device (driver)... (e.g. a device
that could echo data or just provides the current date.. )
Do I have to re-compile the kernel ?
Do I need to write a kernel extension ?
Do I need the darwin kernel sources to write a user land driver ?
I tried "Howto Add a Character Device to Darwin".
http://www.opendarwin.org/documentation/chardev.php
gcc failed because of the missing header <kernel/thread.h>
In this LIRC Linux project, they create a device node with mknod
(doesn't work on darwin)
and then create unix socket and then bind it to the /dev/lircd node.
looks pretty easy...
on mac os x, the bind fails 'operation not supported' (I already
failed making the dev node properly)
I just tried mkfifo. Looks good, but I can't make a fifo in /dev/ ..
when opening the fifo I get 'device is not configured'
Any ideas for this ?
thanks,
Matthias Ringwald
On Montag, November 11, 2002, at 08:16 Uhr, Andrew Gallatin wrote:
Matthias Ringwald writes:
hi
I found a discussion on providing /dev/.. devices by a user client on
this list from nov 2001.
Is it possible to write a pseudo device driver that can be used by
other applications over open/read/write/ioctl POSIX calls ?
I'm trying to port the lirc linux infrared control to mac os x and it
uses /dev/.. devices for their communication.
Sure. Using ioctls and devices is much more portable when
you've got code that runs on other UNIXes.
Note that MacOS X uses devfs (the older, uglier one, I think), so you
should make the special files from inside the driver. Also note that
unlike linux & solaris, MacOS & *BSD do not support factory devices.
Drew
PS: Here's working sample code ripped from my (real hardware) driver.
The idea is to make several /dev/sample* devices, with different
permissions based on device number.
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.