beyond infinity wrote:
see: a harddisk behaves like a block device be it on IDE/SCSI/USB. Just how to talk to the device is different - but that's the task of the driver. Others just want to tell the driver: He, you, gimme two blocks of device 1 you're responsible for.
sure, that's how it'll work in e.g. windows or Linux (afaik). Know if you just ask "gimme two blocks from device 1" it may require the driver to do things that are too much related to the OS proper -- such as waiting for interrupts, etc.
So far, in clicker i've tried to break those things so that you rather say "prepare things to get me two blocks when you can" and the black-box driver says "okay, i'll do". It may enqueue some state (aouch, true: we'll need kernel interaction for that) and there's another function (invoked by interrupt handler most of the time) that will process this state when time comes.
It looks like i've underestimated some issues with the "black-box kernel" and "black-box driver", at least when it comes to asynchronous requests (mosts are).
Yet we can make it OS-agnostic by saying "you must provide two functions enqueue_state(), cancel_state() and dequeue_state() to the black-box driver so that it works properly."
That's a bit of a double-side "proxy" pattern where you abstract behaviour of the driver for the kernel and abstract the behaviour of the kernel for the driver. I'd get flamed to hell by LKM if i say that, but yes: i believe nvidia approach more than UDI or SNAP ... and yes,
i challenge myself to run the nvidia driver within clicker. (i know: i'm insane)...