From mboxrd@z Thu Jan 1 00:00:00 1970 From: kai@kunfoo.org (Kai) Date: Wed, 30 Oct 2013 09:58:27 +0100 Subject: need advice on howto access memory from fpga and cpu Message-ID: <20131030085825.GM5630@kunfoo.org> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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@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?"