Skip to content

Device Driver API #4

@sam-falvo

Description

@sam-falvo

I've been thinking, why keep the distinction between character I/O and block I/O? Perhaps unifying them would make some sense?

For example, in Plan 9 from Bell Labs, all filesystem drivers implement a single read/write abstraction. In terms of a higher-level language like C, they would look like:

  • actual_size = read(fileHandle, buffer, size, offset);
  • actual_size = write(fileHandle, buffer, size, offset);

The idea is that "offset" tells the driver where to read or write, with buffer and size indicating how much data to preferentially transfer. actual_size is an indication of how much data was actually transferred.

But, for character devices, offset is simply ignored.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions