News for hackers. Stuff that matters.
Re:I/O Is Faster Than CPU – Let’s Partition Resources and El... by kazinator on Friday May 03, 2019 @04:49PM (#19822140)
We can't expose a DMA controller directly to programs, but an API could be devised for it. Such a thing is needed even just from the mere portability point of view: making different DMA controllers on different systems look the same.

Applications will typically specify transfers using virtual addresses, but DMA controllers will understand physical memory (usually, but maybe there are virtually mapped ones out there). Plus there are other issues like restricted ranges: DMA that cannot acces all physical memory but just a certain range. The API will have to convert ranges of virtual addresses to one or more physical ranges, which are then queued as one or more DMA operations and somehow deal with the problem that not just any old memory allocation in the application is DMA-able.

Applications talking to channel hardware directly using dedicated CPU instructions is only possible in some vendor-locked IBM mainframe world. It's not otherwise feasible simply for business/market/economic reasons having nothing to do with technical feasibility.

An operating system API is basically a set of extensions to the instruction set available in the application's virtual machine; it's no different from some dedicated I/O instructions, just perhaps less efficient (which may or may not matter).

Re:I/O Is Faster Than CPU – Let’s Partition Resources and El... by Unklejoe on Friday May 03, 2019 @08:22PM (#19823416)
> but DMA controllers will understand physical memory

Yup, this is what I’ve found on many embedded SoCs. It’s unfortunate. The fact that they need physical addresses makes them not worth using in many cases (mainly when trying to move user buffers around).

Re:I/O Is Faster Than CPU – Let’s Partition Resources and El... by hyc_symas on Saturday May 04, 2019 @01:58PM (#19828054)
Sun supported DMA to virtual addresses in SunOS / Solaris. Made some aspects of drivers easier.