mmap on /dev/fd0 on pc686 BSP not working at all.

Pavel Pisa ppisa4lists at
Mon Sep 21 18:28:55 UTC 2020

Hello Gedare,

On Monday 21 of September 2020 18:17:24 Gedare Bloom wrote:
> I don't know if I can provide any answers, but I can provide some
> guidance maybe. I implemented mmap() in rtems to provide portability
> and compliance for mmap applications that use MAP_SHARED with fixed
> addresses. We don't do any real mapping or translating of memory since
> there is no virtual memory support in rtems. Kevin Kirsepl
> extended/fixed the file handler part of that implementation
> There is an mmap helper implemented in libbsd: rtems-libbsd.git:
> /rtemsbsd/sys/fs/devfs/devfs_devs.c:391 devfs_imfs_mmap()
> Vijay implemented that as part of the BBB framebuffer work. I haven't
> studied it closely enough to give any advice on how to replicate/use
> that in another FB. Hopefully he may be able to chime in, as he also
> did a lot of the work with lvgl porting.
> The pc386 FB was written by one of Pavel Pisa's students, Jan Dolezal.
> I had hopes we could generalize the code to other targets because it
> is relatively simple compared to other framebuffers. I think someone
> tried with raspberry pi. But that effort hasn't really moved in a few
> years.
> My guess is that the pc386 fb needs to have something like
> devfs_imfs_mmap().

OK, that can be a solution, the fbdev mmap should be a dummy implementation

void *mmap(void *addr, size_t length, int prot, int flags,
           int fd, off_t offset);

It should take offset argument, add farmebuffer base address and return
that to caller. For i386 driver the driver, mmap function should be

  return (uint8_t*)fb_fix.smem_start + offset

best wishes,


More information about the users mailing list