2

I'm writing a ptrace based debugging/testing suite for an embedded application. The application runs on raraspbery-pi-like hardware and writes directly to the Linux framebuffer, without any display server involved. The testing suite should run on usual Linux/Amd64 with X-server. The main goal is that I don't want to change the source of the app and test it like it would run in the field.

Running this app in a X-session could cause the x-Server to crash and changing the app isn't an option right now. Hence my idea is, to redirect writes from the app to /dev/fb0 and generate some sort of image or stream of it. This interception of calls to open/ioctl/mmap could be done by using ptrace and/or LD_PRELOAD.

I'm not quite sure if this works at all. Isn't it possible on Linux to create a "faked" /dev/fbX device, or is there maybe an existing tool which I haven't found yet?

hannesh
  • 21
  • 1
  • http://cateee.net/lkddb/web-lkddb/FB_VIRTUAL.html – Erki Aring Aug 03 '17 at 08:12
  • I've tried it and it just works fine. Just compile a new kerenl/module load it and override the argument /dev/fb0 with /dev/fb1 in each open call. Thanks! – hannesh Aug 07 '17 at 07:02

0 Answers0