Re: devfs user client
Re: devfs user client
- Subject: Re: devfs user client
- From: Matthias Ringwald <email@hidden>
- Date: Mon, 11 Nov 2002 21:28:12 +0100
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.