2

I want to write a linux driver which maps my specified memory address space to /dev/fb0.

the driver should be specified by what part of linux? drm or frame buffer or server X or somthing else? Which properties should I have in my driver?

2
  • 1
    As I recall, although I am going by memory only as the question has since been deleted, in an earlier incarnation of this question you said that with one kernel you could send output to your LCD screen with cat via a framebuffer. So it would seem from that that there already is a Linux driver for your device. Commented Sep 11, 2018 at 8:53
  • @JdeBP yes you are right. I deleted my question in order to clarify what i am looking for. Although I got nearer to it by what is said. In fact I have a zynq board and an LCD that want to display desktop environment on it. LCD turns on at boot time but when startx calls, the LCD turns off and I can not display desktop environment. Commented Sep 11, 2018 at 12:26

1 Answer 1

3

The driver is a linux kernel module.

Download the source of the linux kernel, have a look at the code of the existing framebuffer drivers in drivers/video/fbdev (github here) and the documentation in Documentation/fb (github). Google for tutorials how to write kernel modules, practice with a simple module first.

Just mapping memory won't be enough, you'll have to implement a few ioctls.

Writing kernel drivers is not easy. If you have to ask this kind of questions (and you asked a lot in the past few days), you probably won't be able to do it.

X is a server for the X protocol. It can use hardware via the DRM kernel modules, and it can also use hardware via framebuffer drivers (with the fbdev X driver). Details about that are easy to find online, google. /dev/fb0 is a framebuffer device, so you don't need to concern yourself with X or DRM.

1
  • 1
    thank you. I asked because answers were confusing and in different forums, different answers were given. and I was looking for simpler and faster way. I know this work is not easy, so I should try more and spend more time. thank you anyway for your helpful response :) Commented Sep 11, 2018 at 6:03

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.