eal: add generic I/O device read/write implementation