need advice on howto access memory from fpga and cpu

Kai kai at kunfoo.org
Wed Oct 30 04:58:27 EDT 2013


Greetings,

I need advice about a programming project I am doing at my university.
The goal basically is to implement a framebuffer in RAM on a Zedboard
SoC (www.zedboard.org).

The problem is, that both the integrated FPGA and "the software" need to
access the framebuffer, e.g. need access to the same memory region. I am
not sure if I have to write a kernel driver for this at all, or if it's
sufficient to do some mmap'ing on /dev/mem from userspace. Also, it
would be really nice if I could reserve some memory (< 1MB), so that
Linux will not touch it, and the framebuffer will always lie at the same
address in RAM. Otherwise I would have to tell the FPGA the addresses.
I don't really need direct memory access from userspace, I just have to
get some images out of the vga port.

So my plan currently is to tell Linux somehow to not touch the first X
bytes of the RAM. Thus the memory region of the framebuffer is already
known. Then I want to implement a kernel driver that's setting up a
character device, say /dev/fb0, to receive frames from userspace.

I already read this[1] post on Stackoverflow, which is going in the
right direction, and started reading "Linux Device Drivers 3rd Edition",
but I would really like to get some comment from the more experienced
programmers, whether there's a better approach to this.

[1] http://stackoverflow.com/questions/647783/direct-memory-access-in-linux
-- 
Grüße, Kai

"In a world without walls and fences, who needs Windows and Gates?"



More information about the Kernelnewbies mailing list