[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bypassing the MMU on the lx chip



On Fri, 11 May 2001, Adam Felson wrote:
> Our company is developing a board with the 100lx chip that has one of the
> memory banks containing 128K SRAM.
> I had always figured that I'd simply put the address into a variable and
> address it indirectly as if that variable had received it's value from
> malloc.
> 
> I think the MMU is going to make that impossible.  Can I bypass memory
> management and access this memory directly?

From a driver or from user-mode ?

Inside the kernel, you just do an ioremap to map any physical memory
section into the kernel-space. 

From user-mode it's slightly more complicated - the "right" way to do it
is to write a driver that exports mmap functionality through its
device-node, so user-space mmap's /dev/yourdriver and accesses it, and the
MMU translates that into the SRAM physical adresses using the mapping your
driver code has done.

The bad way of doing it is to do the ioremap but hack the page-table
entries so that they are not kernel-only, and let user-mode use those
"absolute addresses" in some way. That is really bad. :)

User-mode cannot access whole kernel-segments no matter what, so you
cannot bypass the MMU in that sense.

-BW