Port an OpenGL Implementation to RTEMS

I am currently interested in porting an OpenGL implementation to RTEMS. My options are mesa3d, portablegl, and tinygl. Could you give me some suggestions to choose one from these three?

This is an open project in our issue database

This should give you some ideas feel free to ask questions on the issue as well if you like or here.

I updated the issue cited by @amar to include TinyGL as an option.

Often when choosing an implementation of a standard, one of the options has licensing that is incompatible with RTEMS. In this case, the three meet the license concerns.

Just a guess but starting with TinyGL or PortableGL should reduce the challenges because they have smaller code bases. Video driver support is going to be required by any of them. Dive in and see what looks challenging. Without trying to compile them for RTEMS, there isn’t a good way to guess.

ok!I will do it. I will take a look at this topic, participate in the discussion and conduct in-depth research.

Ok. I will attempt to conduct in-depth research starting from TingGL and PortableGL, and try to compile them using rtems.

Sounds good let us know how it goes. :slight_smile:

Sorry, due to some unexpected matters that need to be dealt with, I have stalled my progress. I have now finished handling those matters and I will continue to start the research of this project. I will keep updating my progress under this topic.

Hi @JoelSherrill and @amar,

I like to contribute to this project.

In the first step, I built the RTEMS for the arm realview_pbx_a9_qemu, and enabled the Framebuffer /dev/fb0 node (using #define CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER)in the init.c.

The crash occurs specifically when calling open("/dev/fb0", O_RDWR). The assertion suggests a double-initialization or a corruption of a semaphore object, possibly within the PL111 driver initialization sequence.

Press any key to start file I/O sample (19s remaining)

Attempting to open /dev/fb0…

assertion “_Chain_Is_node_off_chain( &the_semaphore->Object.Node )” failed: file “…/…/…/cpukit/include/rtems/rtems/semimpl.h”, line 85, function: _Semaphore_Get_flags

*** FATAL ***

fatal source: 7 (RTEMS_FATAL_SOURCE_ASSERT)

fatal code: 2163536 (0x00210350)

RTEMS version: 7.0.0.9b1a9ec16350408413f79c45ca5dea5a50461c20-modified

RTEMS tools: 15.2.0 20250808 (RTEMS 7, RSB 3546aa1e5662aa475bc0521ad2d1c66c39fe47ec, Newlib 038afec1)

executing thread ID: 0x0a010002

executing thread name: FMNU

I request your guidance on how to proceed further and resolve the above issue.
Thanks

This should be fixed now by cpukit: fix off-chain state checks and pointer clearing (!1067) · Merge requests · RTEMS / RTOS / RTEMS · GitLab use git pull and try again, looks like your branch is a couple months out of date.

Thanks @gedare, after the git pull, the above issue was solved. Sorry for the inconvenience caused.

But still, I am facing the kernel crash. Based on my understanding, it is happening in the pl111_fb_initialize(…) function, where the pl111 register is getting updated. I have highlighted the place where the crash happened in the image below.

It seems to be the issue regarding the mmu.

I was able to solve the crash by changing the mmu sections in the bsps/arm/realview-pbx-a9/start/bspstarthooks.c, please find the patch below

diff --git a/bsps/arm/realview-pbx-a9/start/bspstarthooks.c b/bsps/arm/realview-pbx-a9/start/bspstarthooks.c
index 23fc580225..d0961fc5b7 100644
--- a/bsps/arm/realview-pbx-a9/start/bspstarthooks.c
+++ b/bsps/arm/realview-pbx-a9/start/bspstarthooks.c
@@ -41,7 +41,11 @@ rvpbxa9_mmu_config_table[] = {
   ARMV7_CP15_START_DEFAULT_SECTIONS,
   {
     .begin = 0x10000000U,
-    .end = 0x10020000U,
+    .end = 0x1001e000U,
+    .flags = ARMV7_MMU_DEVICE
+  }, {
+    .begin = 0x10020000U,               // PL111 memory region
+    .end = 0x100DFFFFU,
     .flags = ARMV7_MMU_DEVICE
   }, {
     .begin = 0x1f000000U,

Should I raise this as an issue?

After this, the issue was solved.

Yes, you should open an issue and submit an MR.