[PATCH 6/6] i386/pc386: VESA based frame buffer utilizing real mode interrupt 10h

Gedare Bloom gedare at rtems.org
Wed Nov 12 16:08:50 UTC 2014


On Wed, Nov 12, 2014 at 10:07 AM, Jan Dolezal <dolezj21 at fel.cvut.cz> wrote:
> ---
>  c/src/lib/libbsp/i386/pc386/Makefile.am          |   5 +
>  c/src/lib/libbsp/i386/pc386/configure.ac         |  13 +
>  c/src/lib/libbsp/i386/pc386/console/fb_vesa_rm.c | 851 +++++++++++++++++++++++
>  c/src/lib/libbsp/i386/pc386/include/fb_vesa.h    | 131 ++++
>  c/src/lib/libbsp/i386/pc386/preinstall.am        |   6 +
>  c/src/lib/libbsp/i386/pc386/start/start.S        |   8 +
>  6 files changed, 1014 insertions(+)
>  create mode 100644 c/src/lib/libbsp/i386/pc386/console/fb_vesa_rm.c
>  create mode 100644 c/src/lib/libbsp/i386/pc386/include/fb_vesa.h
>
> diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am b/c/src/lib/libbsp/i386/pc386/Makefile.am
> index 2e60947..7fb6747 100644
> --- a/c/src/lib/libbsp/i386/pc386/Makefile.am
> +++ b/c/src/lib/libbsp/i386/pc386/Makefile.am
> @@ -106,13 +106,18 @@ libbsp_a_SOURCES += console/printk_support.c
>  libbsp_a_SOURCES += console/vgacons.c
>  libbsp_a_SOURCES += console/exar17d15x.c
>  libbsp_a_SOURCES += console/rtd316.c
> +if USE_VBE_RM
>  include_HEADERS += include/vbe3.h
>  include_HEADERS += include/edid.h
> +include_HEADERS += include/fb_vesa.h
> +libbsp_a_SOURCES += console/fb_vesa_rm.c
> +else
>  if USE_CIRRUS_GD5446
>  libbsp_a_SOURCES += console/fb_cirrus.c
>  else
>  libbsp_a_SOURCES += console/fb_vga.c
>  endif
> +endif
>
>  # gdb
>  libbsp_a_SOURCES += ../../i386/shared/comm/i386-stub.c
> diff --git a/c/src/lib/libbsp/i386/pc386/configure.ac b/c/src/lib/libbsp/i386/pc386/configure.ac
> index ecec056..a74d6cb 100644
> --- a/c/src/lib/libbsp/i386/pc386/configure.ac
> +++ b/c/src/lib/libbsp/i386/pc386/configure.ac
> @@ -82,6 +82,19 @@ RTEMS_BSPOPTS_HELP([USE_CIRRUS_GD5446],
>   NOTE: This has only been tested on Qemu.])
>  AM_CONDITIONAL(USE_CIRRUS_GD5446,test "$USE_CIRRUS_GD5446" = "1")
>
> +RTEMS_BSPOPTS_SET([USE_VBE_RM],[*],[0])
> +RTEMS_BSPOPTS_HELP([USE_VBE_RM],
> +[If defined, enables use of the Vesa Bios Extensions - real mode interface,
> + which enables graphical mode and introduce it upon bootup.])
> +AM_CONDITIONAL(USE_VBE_RM,test "$USE_VBE_RM" = "1")
> +
> +if test "${USE_VBE_RM}" = "1" ; then
> +  if test -z "${NUM_APP_DRV_GDT_DESCRIPTORS}"; then
> +      NUM_APP_DRV_GDT_DESCRIPTORS=2 ;
> +  else
> +      NUM_APP_DRV_GDT_DESCRIPTORS+=2 ;
> +  fi
> +fi
>  RTEMS_BSPOPTS_SET([NUM_APP_DRV_GDT_DESCRIPTORS],[*],[0])
>  RTEMS_BSPOPTS_HELP([NUM_APP_DRV_GDT_DESCRIPTORS],
>  [Defines how many descriptors in GDT may be allocated for application or
> diff --git a/c/src/lib/libbsp/i386/pc386/console/fb_vesa_rm.c b/c/src/lib/libbsp/i386/pc386/console/fb_vesa_rm.c
> new file mode 100644
> index 0000000..0087c82
> --- /dev/null
> +++ b/c/src/lib/libbsp/i386/pc386/console/fb_vesa_rm.c
> @@ -0,0 +1,851 @@
> +/*
> + *  FB driver for graphic hardware compatible with VESA Bios Extension
> + *  Real mode interface utilized
> + *  Tested on real HW.
> + *
> + *  Copyright (c) 2014 - CTU in Prague
> + *                       Jan Doležal ( dolezj21 at fel.cvut.cz )
> + *
> + *  The license and distribution terms for this file may be
> + *  found in the file LICENSE in this distribution or at
> + *  http://www.rtems.org/license/LICENSE.
> + *
> + *  The code is based on following information sources:
> + *    - doc/bsp_howto/bsp_howto.pdf
> + *    - VESA BIOS EXTENSION (VBE) Core Function Standard, Ver: 3.0, Sep 16, 1998
> + *    - RTEMS fb_vga.c - Rosimildo da Silva ( rdasilva at connecttel.com )
> + *    - RTEMS fb_cirrus.c - Alexandru-Sever Horin (alex.sever.h at gmail.com)
> + */
Based on is fine if you just read some things, but if you actually
copied code from other sources, you need to also copy the copyrights
and license info. Please make the distinction more clear, as saying
"based on" is too vague.

I don't have time right now to review this code. Some quick notes though:
* assuming pthreads, make sure there is a compile-time check.
* use typedefs for struct and union types.
* check that your code is consistent with the RTEMS coding conventions
(http://wiki.rtems.org/wiki/index.php/Coding_Conventions)

Gedare


More information about the devel mailing list