4
Parzi
2y

More linux driver woes:

Driver is passed a file position and byte count when asked to read from a device. Sounds easy, right? FUCK no.

For reads, driver is passed struct `filp` with field `f_pos`, a direct pointer to the same struct field, int `count` as a number of bytes to read, and `buf` to return those bytes with. Problem is, requesting, say, 256 bytes from location 10000000h will give the driver `filp->f_pos = 0`, `f_pos = 256`, and `count = 0`. I don't know how to fix this and there's NO help for this shit. None whatsoever.

This shit, right here, is why Linux drivers suck ass.

Comments
  • 2
    What are you trying to do?
  • 0
    @hjk101 Read/write to/from an incompatible CPU's address space for userland driver purposes. Everything but the driver works.
  • 1
    Maybe not enough device memory? copy_to_user?
  • 1
    @neriald The device has nearly 200MB of free RAM when the error occurs, and this is before being able to copy a buffer to userland, because there's nothing in it yet.
Add Comment