#2634 closed defect (fixed)

New warning in pc386 VESA driver

Reported by: Joel Sherrill Owned by: Pavel Pisa <ppisa@…>
Priority: normal Milestone: 5.1
Component: arch/i386 Version: 5
Severity: normal Keywords:
Cc: Pavel Pisa, Chris Johns Blocked By:


Pavel.. can you look into this?

./../../../../../../../rtems/c/src/lib/libbsp/i386/pc386/console/fb_vesa_rm.c: In function 'find_mode_using_EDID':
../../../../../../../../rtems/c/src/lib/libbsp/i386/pc386/console/fb_vesa_rm.c:502:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

if (*(uint16_t*)&edid.STI[index] == EDID_STI_DescriptorUnused)

Attachments (1)

correct-fb_vesa_rm-warning.diff (1.4 KB) - added by Pavel Pisa on Mar 9, 2016 at 7:51:08 PM.
Proposed solution to make GCC happy and made code readable better than worse

Download all attachments as: .zip

Change History (11)

Changed on Mar 9, 2016 at 7:51:08 PM by Pavel Pisa

Proposed solution to make GCC happy and made code readable better than worse

comment:1 Changed on Mar 9, 2016 at 7:53:24 PM by Pavel Pisa

Hello all, I have attached proposal for fixup. I have checked that it compiles against 4.11 without warning but I have not test that it by run of compiled code under QEMU. I need to find more time for that in some of next days.

comment:2 Changed on Mar 9, 2016 at 8:59:53 PM by Joel Sherrill

Cc: Chris Johns added

comment:3 Changed on Mar 9, 2016 at 9:03:07 PM by Joel Sherrill

Thanks. I don't know if I can test this or not.

The RSB build of qemu doesn't turn on the graphics module so I don't know if it hits this code or not. And from what my five minute at trying to turn it on made me think you needed Xen development files to use it and they were only available for 64-bit CentOS 6. If that's the case, the code isn't portable at all off of Linux so we should disable video, unfortunately.

The real PC I have been using to test on prints a message (from memory) that indicates it didn't initialize it or find it. Not sure which.

What setup is required to test this?

comment:4 Changed on Mar 9, 2016 at 9:44:22 PM by Pavel Pisa

Hello Chris, I have minimal experience with RSB based RTEMS OS builds, but regular configure make builds of RTEMS is by default with VESA graphic support which can be then initialized at runtime by RTEMS kernel option --video=auto. This result in switch to graphic mode early in RTEMS boot. But you need some graphic application to open frame-buffer a draw to it. Regular standard output to video console does not emulate characters drawing/text mode yet. Initial version of such text mode emulation on graphic frame-buffer is implemented in experimental branch of RPi support only till now and is in shape that it could be adapted to be generic for more architectures.

I use Microwindows/Nano?-X builds for testing (manual by RTEMS graphic toolkit do_it -A) or by RSB. Required packages recipes have been integrated to mainline RSB as a result of Qiao Yang GSoC project during 2015 autumn and previous work is already integrated to Micowindows mainline as well, so we can even switch scrips to use that directly instead of the Alex GSoC Microwindows fork. Microwindows demos can be run then on QEMU (VirtualBox? not tested but should work too) a we have run some tests on real PC hardware during driver development as well.

Documentation for (now default) VESA configuration is there


RSB build of graphic libraries against regular configure make installed RTEMS in /opt

../source-builder/sb-set-builder \
    --log=graphic-build-log.txt \
    --prefix=/opt/rtems4.11 \
    --rtems-bsp=i386/pc686 \
    --with-rtems-bsp=pc686 \
    --pkg-tar-files \

My QEMU command line

qemu-system-x86_64 -gdb tcp::1234 -enable-kvm -kernel $APP_BINARY \
      -vga cirrus \
      -net nic,vlan=0,model=e1000 -net user,vlan=0 \
      -serial stdio \
      -append "--console=com1 --video=auto"

where $APP_BINARY is RTEMS+application image.

I use serial output for messages and RTEMS standard output then and graphic frame-buffer for tested application.

Suitable QEMU (qemu-system-x86_64 or qemu-system-i386) should be available in all GNU/Linux distributions.

comment:5 Changed on Mar 9, 2016 at 10:04:38 PM by Pavel Pisa

I have tested patched 4.11 build with some of my experimental applications and video setup seems OK. I need build tool-chains and switch to 4.12, I have it on my TODO, but ... .

comment:6 Changed on Mar 9, 2016 at 10:26:07 PM by Joel Sherrill

If you have tested this patch on 4.11, we should just apply it to both branches. You just seemed concern it would break something.

comment:7 Changed on Apr 16, 2016 at 10:25:36 PM by Pavel Pisa <ppisa@…>

Owner: set to Pavel Pisa <ppisa@…>
Resolution: fixed
Status: newclosed

In b752f9454fd412b0c4e3b15ee853afd4870ccc54/rtems:

i386/pc386: reimplemented check for unused EDID entry in fb_vesa.c to suppress GCC 6 warning.

closes #2634

comment:8 Changed on May 11, 2017 at 7:31:02 AM by Sebastian Huber


comment:9 Changed on Oct 10, 2017 at 6:55:23 AM by Sebastian Huber

Component: bspsarch/i386

comment:10 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber


Milestone renamed

Note: See TracTickets for help on using tickets.