next up previous
Next: lseek System Call Up: The library Previous: Set the Address Modifier

read, write System Call

The read/write system calls for this device have a maximum number of bytes transferrable each call! Sorry, but I have chosen this way to prevent users from hogging the VMEbus for long times (say seconds). The maximum value is 16K, which is suitable for the hardware, because one read/write of 16K lasts around 20ms, which is near the heartbeat of the kernel (on Intel). This means, that a process will release the VMEbus in time. So you have to read/write in a loop to transfer all bytes. A normal user process will run for about 200ms, so if you have another process which must have minimal interrupt latency, you have to run it with SCHED_RR (see 1.6.4), in which case the normal user process will deschedule in time. I have included ArwvmeRead() and ArwvmeWrite() into the library, which do a sched_yield after each transfer of 16K. I recommend to use them for large amounts of data, to give other processes the chance of using the VMEbus. There is no easy way to do this cooperative work in the driver, because you can only call schedule() at the end of a system call (to release the CPU and the VMEbus to another process). By the way, you have no greater bandwidth without this limitation.


next up previous
Next: lseek System Call Up: The library Previous: Set the Address Modifier


Fri Jul 2 08:09:45 MEST 1999