On Fri, Oct 28, 2016 at 2:36 PM, Stas Sergeev <stsp@xxxxxxx> wrote:Well, yes, even today: if the ram size is large enough to last
Has it ever worked for you?Hello.On Fri, Oct 28, 2016 at 2:03 PM, Stas Sergeev <stsp@xxxxxxx> wrote:
For the long time dosemu used /dev/mem for vga pass-through.
Now it appears /dev/mem has this check:
http://lxr.free-electrons.com/source/drivers/char/mem.c#L51
which prevents an accesses to PCI memory regions if the
"high_memory" points low enough. It seems "high_memory"
just points to the end of the physical ram, so depending on
the ram size you either can access PCI devices or you get
EFAULT.
Was it wrong to use /dev/mem for accessing the PCI devices?
How should I do that now?
That code is ancient, going back in someYes, indeed, I can see that on lxr now...
form or another at least ten years.
So /dev/mem does not allow "read()/write()" on IO memory, and reallyYes, thanks, I was confused. mmap() is indeed unaffected,
hasn't in a long long time (maybe ever, quite frankly). It does allow
it on regular RAM, but STRICT_DEV_MEM then disallows that too for
security reasons (and realistically, everybody uses STRICT_DEV_MEM
these days).
What people do use /dev/mem for is to mmap() PCI memory, and then you
can access it from user space. That's the traditional model that X.org
used to do etc.