IO support in kernel

Do not merge this.