You need to expose a hypercall interface for this. Can anyone explain how that would be implemented, and does it restrict the kinds of kernels you can write? e.g. can I create a unikernel or microkernel with this?
Microkernel: yes, though strictly speaking you'd use rump kernels for the servers in a microkernel OS. (that was actually the first use case back in 2007)
There are multiple example implementations for the hypercall interface ("rumpuser") at http://repo.rumpkernel.org/
You can find full details from http://book.rumpkernel.org/ (it's a bit out of date in describing what has been built using rump kernels, but the parts describing basic functionality are accurate).
There are microkernels using the rump kernel code, eg Genode.