On Tue, Aug 22, 2006 at 01:49:01PM +0300, Constantine Kousoulos wrote: > Hello, > > As it seems, mach has a "dual" device interface. Firstly, there > is the native device interface (device_open, device_close etc). > Secondly, there is the linux emulation device interface (again > device_open, device_close, etc in seperate files) that glues linux > drivers with mach. > > How does mach decide which routine to call (native or emulation)? > I am in the process of writing glue code for linux-2.6 drivers, so > an answer would speed development.
Actually, there is only one interface, the device_xxx() routines. These can be found in i386/i386at/device_emul.h. Each driver, or driver class must create a structure with pointers to the corresponding functions, which are usually declared static, and named device_open(), device_close(), and so on. Once this structure is set, you must "register" it in i386/i386at/i386at_ds_routines.c. You can use [1] and [2] as "working" examples (I have problems with my network access, so my CVS repository is currently not always reachable :-/). Good luck. -- Richard Braun [1] http://cvs.sceen.net/index.cgi/gnumach/linux/sound/glue/sound.c?rev=1.1&view=markup [2] http://cvs.sceen.net/index.cgi/gnumach/i386/i386at/i386at_ds_routines.c?rev=1.3&view=markup
signature.asc
Description: Digital signature
_______________________________________________ Bug-hurd mailing list Bug-hurd@gnu.org http://lists.gnu.org/mailman/listinfo/bug-hurd