Sys Calls from Device Drivers

Sys Calls from Device Drivers

Post by ELSID Software Systems LTD » Tue, 09 May 2000 04:00:00



Greetings:

I would like to be able to open a socket from within a device driver to
a data resource on another system and use it to communicate with that
resource.

Is this possible, has any one done this, are there any examples
anywhere?

Regards
Robert

 
 
 

Sys Calls from Device Drivers

Post by Marc SCHAEFE » Wed, 10 May 2000 04:00:00



: I would like to be able to open a socket from within a device driver to

One way would be to have your driver communicate with a user-space process
which would do ioctl(), get the data packet, then communicate with the
socket, and send the results back with ioctl().

Advantage: main code in user space, no tricks, maybe even portable between
           UNIX systems.

: a data resource on another system and use it to communicate with that

You can always use the sys_() stuff *provided you are running in a task
context* (thread, user process. Certainly not from interrupts).

Also you could generate low-level skb buffers ... but I really strongly
suggest you the user-space solution.

NB: you might want to look at the `network block device'.

 
 
 

1. Device driver calling another device driver.

Hi.

I am having a problem writing a "meta-driver", ie one that is sandwiched
between the kernel and a real device driver. The platform I am using
consists of a Sun IPC, running SunOS 4.1.1.

My problem is that in attempting to use the OPEN(2V) system call from within
the "xxopen" routine of my metadriver (to open another device-driver (which
then opens the device)); OPEN(2V) "fails".

It appears that calling OPEN(2V) from within the kernel requires a different
calling sequence and argument list. Viz-a-viz: instead of a file descriptor
being returned by OPEN(2V), it seems a pointer is returned (which itself is
a pointer to something else).

Is this true? Is the OPEN(2V) syscall different for a process executing in
user address space, compared to the OPEN call executed by a process running
in kernel mode/address space?

If this is true for OPEN, what about CLOSE, READ, WRITE, etc? Unfortunately,
I don't have (easy) access to any Unix (source) code, to verify this.

Thanks in advance for help/advice.

2. Triple Boot?

3. Driver calling driver and multiple physio() calls

4. Solaris 2.x certification class .. which one??

5. Information requested- understanding Device Drivers(sys V)

6. How to search the archives

7. Adding Device Driver in Sys V, intr #, i/o addr, etc.

8. Can someone tell me what i am doing wrong. Unix sockets

9. Device driver question (generic device driver)

10. Solaris 2.4: system calls in device driver

11. call function of device driver

12. Calling device-driver strategy routines

13. When is the attach entry point called (Device Drivers)