Link to Home page Main Banner


Downloads

Local Links

  

Motivation

Provide a client interface to RTEMS applications to access MySQL SQL Engine. Communication with the server uses TCP/IP sockets. The interface has an acceptable memory footprint to be used on development of embedded applications.

Version of MySQL

This porting was based on version 3.22.25 of MySQL.

BSP's Support

This porting is very generic, and should work with all platforms that MySQL runs on. The configuration available for download was done for the i386 PC386 bsp.

Installing and Building

This section describes a step by step procedure to compile the MySQL Client Interface for RTEMS. It assumes that you are familiar with the RTEMS build environment.

NOTE: The procedure described here, requires a Linux Box.

  • Install source code for MySQL that matches with your server, or one that at least uses the same protocol version as your server. The version tested was: 3.22.25

  • Configure it for Linux - clients only
    ./configure --without-server

  • Build the client library for Linux
    cd client
    make
    This step copy all files needed to build the client library to the client directory.

  • Do a make clean
    make clean
    This step delete all generated files keeping only the source.

  • Install the RTEMS specific files from the donwload location.

  • Now you ready to compile the library for RTEMS.
       cd client
       make
    

Testing the library

There is a test program in the directory "rtems" that shows how to interface with MySQL. It is a C++ example and requires full C++ support from your cross-compiler. The interface for MySQL provided by the library is C based, and you should be able to use it straight from C programs.

What changed

Actually the changes to get access to MySQL from RTEMS are very simple. Below you have a description, file by file, of what got changed.

config.h ---> this file has been configured for RTEMS. It was renamed to config_rtems.h, and the include global.h was changed to include it.
It was based on the generated version for Linux.

include\global.h ---> requires to include "errno.h".
Change this module to include the specialized RTEMS config file( config_rtems.h), and also include the proper errno.h.

client\libmysql.c --> RTEMS does not provide getservbyname() at this point in time.
Added preprocessor conditional compilation to avoid call to this function.



Visitors:


Last modified May 27, 2000
Copyright ©1999-2000 Rosimildo da Silva. All rights reserved.


   e-mail me