Changeset 1d4048b2 in rtems


Ignore:
Timestamp:
Aug 11, 1999, 11:45:57 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
8aefe83
Parents:
91e9ab8
Message:

Patch from Tony R. Ambardar <tonya@…>:

I'm attaching a big patch for the ts_386ex BSP which adds and includes
the following:

1) Conversion to ELF format + minor code cleanups + documentation.

2) An Ada95 binding to FreeBSD sockets, based on Samuel Tardieu's

adasockets-0.1.3 package. This includes some sample applications.

3) Some Ada and C interfaces to add serial-port debugging to

programs. Comes with examples, too; the Ada one shows how
transparent adding the support can be. Note that Rosimildo sent me
the original C code.

The network stuff is not BSP specific, and could be added to your Ada
code collection. The debugging stuff is specific to the i386. Right
now, everything sits in my "tools" directory.

Location:
c/src/lib/libbsp/i386/ts_386ex
Files:
44 added
8 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/ts_386ex/README

    r91e9ab8 r1d4048b2  
    1212cross-compilation tools with this support. The BSP also supports the
    1313on-board RTC, and an NE2000 compatible network card. It has been used
    14 successfully with C (gcc-2.8.1) and Ada95 (gnat-3.11p), including
    15 networking applications in both languages.
     14successfully with C/C++ (egcs-1.1.2) and Ada95 (gnat-3.11p), including
     15networking applications.
    1616
    1717The TS-1325 runs a version of DOS, and should be configured with a RAM
     
    2626A typical development cycle involves these steps:
    2727
    28 1. Cross-compile the application, yielding a COFF executable. Convert this
    29    to raw binary format, using objcopy or the coff2bin script (see the
    30    tools subdirectory in the BSP).
     281. Cross-compile the application, yielding an ELF executable. Convert
     29   this to raw binary format, using objcopy or the elf2exe script (see
     30   the tools subdirectory in the BSP).
    3131
    32 2. Use Zmodem to download the raw exec to the TS-1325's ram-disk
     322. Use Zmodem to download the raw executable to the TS-1325's ram-disk
    3333   (faster than  the A: flash disk). A terminal program supporting
    3434   Zmodem is needed on the host e.g. minicom under Linux.
    3535
    36363. Use the DOS-based RTEMS loader "loader.com" (see tools
    37    subdirectory) to load and run the executable.
     37   subdirectory) to load and run the executable on the TS-1325.
    3838
    39 Additional documentation and support software is in the tools BSP subdirectory.
     39Additional documentation and support software is in the tools subdirectory
     40of the BSP.
    4041
    4142Happy Coding!
    4243
    43 Tony Ambardar, 4/21/99
     44Tony Ambardar, 8/8/99
  • c/src/lib/libbsp/i386/ts_386ex/bsp_specs

    r91e9ab8 r1d4048b2  
    1717%{!qrtems: %(old_startfile)} %{qrtems: \
    1818%{!qrtems_debug: start.o%s} \
    19 %{qrtems_debug: start_g.o%s}}
     19%{qrtems_debug: start_g.o%s} crti.o%s crtbegin.o%s}
    2020
    2121*link:
    2222%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e _init_i386ex}
    2323
     24*endfile:
     25%{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s crtn.o%s}
  • c/src/lib/libbsp/i386/ts_386ex/console/console.c

    r91e9ab8 r1d4048b2  
    219219    console_last_close,       /* lastClose */
    220220    NULL,                     /* poll read  */
    221     BSP_uart_termios_write_com2, /* write */
     221    BSP_uart_termios_write_com1, /* write */
    222222    conSetAttr,               /* setAttributes */
    223223    NULL,                     /* stopRemoteTx */
  • c/src/lib/libbsp/i386/ts_386ex/startup/Makefile.in

    r91e9ab8 r1d4048b2  
    5252#DEFINES  += -DPRINTON
    5353
    54 DEFINES += -I$(srcdir)
     54DEFINES += -DUSE_INIT_FINI
    5555CPPFLAGS +=
    5656CFLAGS +=
  • c/src/lib/libbsp/i386/ts_386ex/startup/bspstart.c

    r91e9ab8 r1d4048b2  
    7979    heap_size &= 0xfffffff0;  /* keep it as a multiple of 16 bytes */
    8080
    81     heap_size &= 0xfffffff0;  /* keep it as a multiple of 16 bytes */
    8281    bsp_libc_init((void *) heap_start, heap_size, 0);
    8382
  • c/src/lib/libbsp/i386/ts_386ex/startup/linkcmds

    r91e9ab8 r1d4048b2  
    2222
    2323        ENTRY(_init_i386ex) ;
     24
    2425SECTIONS
    2526{
     
    2829 * initial section:
    2930 *
    30  * This section is the first in memory, preceding the text and data sections.
    31  * It initializes the i386ex, sets up the gdt in RAM, loads the gdt,
     31 * This subsection of ".text" is the first in memory, and executed by the DOS
     32 * loader. It initializes the i386ex, sets up the gdt in RAM, loads the gdt,
    3233 * jumps to protected mode, loads the idt, zeros the bss section, sets up
    3334 * the stack and calls the rest of the RTEMS initialization.
     
    3536
    3637        _DOS_ld_addr    =       0x0008000 ;
    37 
    38         .initial _DOS_ld_addr :
    39         {
    40         *(.initial);
    41         }
    4238
    4339/***************************************************************************
     
    4743 ***************************************************************************/
    4844
    49         .text BLOCK(0x10) :
     45        .text _DOS_ld_addr :
    5046        {
    51          CREATE_OBJECT_SYMBOLS
     47        CREATE_OBJECT_SYMBOLS
    5248        text_start = . ;
    5349        _text_start = . ;
    54         *(.text ) ;
    55         . = ALIGN (16);
    5650
    57         *(.eh_fram)
    58         . = ALIGN (16);
     51        *(.initial);
     52        . = ALIGN(0x20);
     53
     54        *(.text );
     55        . = ALIGN (0x20);
     56
     57        *(.eh_frame)
     58        . = ALIGN (0x20);
     59
     60        *(.gnu.linkonce.t*)
     61        . = ALIGN(0x20);
    5962
    6063        /*
    6164         * C++ constructors
    6265         */
     66
    6367        __CTOR_LIST__ = .;
    6468        LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
     
    7276        LONG(0)
    7377        __DTOR_END__ = .;
     78
    7479        _rodata_start = . ;
    7580        *(.rodata)
     81        . = ALIGN(0x20);
     82        _erodata = .;
     83
    7684        *(.gnu.linkonce.r*)
    77         _erodata = ALIGN( 0x10 ) ;
    78         _etext = ALIGN( 0x10 );
     85        . = ALIGN(0x20);
    7986        _endtext = . ;
    8087        }
     88
     89/***************************************************************************
     90 * ctor/dtor sections:
     91 *
     92 * These sections house the  global constructors and destructors. 
     93 ***************************************************************************/
     94
     95        .init BLOCK(0x20) :
     96        {
     97        *(.init)
     98        } = 0x9090
     99
     100        .fini BLOCK(0x20) :
     101        {
     102        *(.fini)
     103        } = 0x9090
    81104
    82105/***************************************************************************
     
    86109 ***************************************************************************/
    87110
    88         .data  BLOCK(0x10) :
     111        .data  BLOCK(0x20) :
    89112        {
    90113        _sdata = .;
    91114        *(.data);
     115        . = ALIGN(0x20);
     116        *(.gnu.linkonce.d*)
     117        . = ALIGN(0x20);
     118        *(.gcc_except_table)
     119        . = ALIGN(0x20);
    92120        _edata = .;
    93121        }
     
    105133        *(.bss);
    106134        *(COMMON);
    107         _ebss = ALIGN(0x10);
     135        _ebss = ALIGN(0x20);
    108136        }
    109137        _bss_size   = _ebss - _bss_start ;
     138
     139/***************************************************************************
     140 * discard section:
     141 *
     142 * This section is used to throw away stuff we don't want. 
     143 ***************************************************************************/
     144
     145        /DISCARD/ :
     146        {
     147        *(.comment);
     148        *(.note);
     149        }
    110150
    111151/***************************************************************************
  • c/src/lib/libbsp/i386/ts_386ex/tools/README

    r91e9ab8 r1d4048b2  
    1010included.
    1111
    12 Once an application has been compiled and the resulting COFF
     12Once an application has been compiled and the resulting ELF format
    1313executable converted to raw binary format and transferred to the
    1414TS-1325, the DOS loader program must be used to load and execute
     
    2121the C: disk. Once completed, an application may copied to the
    2222(non-volatile) A: disk. Additionally, one may add the line "loader
    23 filename" to the AUTOEXEC.BAT file, allow ing the application to be
     23filename" to the AUTOEXEC.BAT file, allowing the application to be
    2424run automatically at boot time.
    2525
    2626Note that the DOS loader will abort and exit if it detects that the
    2727push-button switch is pressed, thus allowing one to break out of a
    28 patho logical "boot loop" situation.
     28pathological "boot loop" situation i.e. abort an automatic load from
     29the AUTOEXEC.BAT file.
    2930
    3031
    31 coff2bin
     32elf2exe
    3233========
    3334
    34 The coff2bin script is just a convenient wrapper for the objcopy
    35 command. It can convert a list of RTEMS-generated COFF files to raw
     35The elf2exe script is just a convenient wrapper for the objcopy
     36command. It can convert a list of RTEMS-generated ELF files to raw
    3637binary images that can be loaded on the TS-1325. The converted files
    37 are saved in the current directory with a ".bin" extension.
     38are saved in the current directory with a ".exe" extension.
    3839
    3940
     
    4344The TS-1325 includes a few peripherals which are very useful for
    4445embedded development: a push-button switch, an LED, and a parallel
    45 port which may be used for digital I/O. Note that the pinout for the
     46port which may be used for digital I/O. Note that the pin-out for the
    4647parallel port is given in the TS-1325 manual.
    4748
     
    6566
    6667
    67 Tony Ambardar, 4/21/99
     68Serial Debugging Support
     69========================
    6870
     71RTEMS supports an Ada95 and RTEMS aware version of the GNU gdb
     72debugger, which can be configured to debug targets over a serial
     73line.
     74
     75The port COM2 on the TS-1325 is normally used for console I/O, leaving
     76COM1 for use by gdb; an appropriate cable should be connected from the
     77development host to the TS-1325's COM1. The serial port used on the host
     78should match the line "target remote /dev/tty??" in the "cmds" file.
     79
     80Sample C and Ada95 applications showing how to add debugging support
     81are given in the debug_c and debug_ada sub-directories. Once the
     82debugging-enabled executable is running on the TS-1325, gdb must be
     83started on the Linux host, taking as argument the RTEMS ELF executable.
     84
     85Using a graphical front end to gdb such as the program ddd is highly
     86recommended. The script ddd-rtems shows how to invoke gdb using ddd as
     87a front end.
     88
     89
     90Ada95 Networking Support
     91========================
     92
     93The sub-directory network_ada contains code and examples for an Ada95
     94binding to BSD network sockets. The code is based on Samuel Tardieu's
     95adasockets-0.1.3 package, but has been modified to work under RTEMS.
     96
     97The binding itself is in the adasockets sub-directory. Edit the
     98Makefile to reflect your choice of installation directory, then type
     99the command  "make install" to compile and install the binding. The
     100file networkconfig.h should also be edited according to the RTEMS
     101networking document.
     102
     103The directories listener and tcprelay contain networking examples that
     104use the binding. The listener application simply accepts connections
     105on a certain port and echoes back any received data. The tcprelay
     106program accepts connections on a port and then relays all subsequent
     107data to and from another remote host. The makefiles in both
     108directories should be edited to reflect the installation point of the
     109adasockets binding.
     110
     111
     112
     113Tony Ambardar, 8/8/99
  • c/src/lib/libbsp/i386/ts_386ex/tools/ts_1325_ada/Makefile.ts_386ex

    r91e9ab8 r1d4048b2  
    77# Tool paths
    88tooldir=/usr/local/rtems
    9 rtemsdir=${tooldir}/rtems/ts_386ex
     9rtemsdir=${tooldir}/ts_386ex
    1010
    1111# Tool names
    12 GCC=${tooldir}/bin/i386-rtems-gcc
    13 GNATMAKE=${tooldir}/bin/i386-rtems-gnatmake
    14 SIZE=${tooldir}/bin/i386-rtems-size
     12GCC=${tooldir}/bin/i386-rtemself-gcc
     13GNATMAKE=${tooldir}/bin/i386-rtemself-gnatmake
     14SIZE=${tooldir}/bin/i386-rtemself-size
    1515SIS=${tooldir}/bin/sis
    1616GDB=${tooldir}/bin/sis-gdb
     
    1818CARGS=-B${rtemsdir}/lib/ -specs bsp_specs -qrtems \
    1919-msoft-float -mno-fp-ret-in-387
    20 #CARGS=-B/usr/local/rtems/tools/build-i386-rtems/ts_386ex/lib/ -specs bsp_specs -qrtems
    2120
    2221all: init.o
Note: See TracChangeset for help on using the changeset viewer.