<html>
<head>
</head>
<body>
Joel Sherrill wrote:<br>
<blockquote type="cite" cite="mid:3EA569BB.142424AC@OARcorp.com">
  <pre wrap=""><br>Angelo Fraietta wrote:<br></pre>
  <blockquote type="cite">
    <pre wrap="">I have built and modified the ticker example to show how including<br>iostream causes the program to crash.<br>If you comment out line 23 (the include statement), the program runs.<br>This was built using gcc3.2.2. and newlib 1.11.0 And the pre-release 2.<br><br>I am curently only able to successfully run the first pre-release using<br>gcc3.2 and newlib 1.10. As soon as I try to use anything later than<br>this, it fails.<br><br>I am running the pc386dx BSP.<br><br>The program fails with exception 6 immediatly after the device drivers<br>are initialised.<br></pre>
    </blockquote>
    <pre wrap=""><!----><br>This is an illegal instruction exception. Where does the address<br>reported<br>correspond in your application?  Can you do an objdump on the ticker<br>file<br>and see what is actually at that address?<br></pre>
    </blockquote>
The register values I get are<br>
eax = 1 ecx = 150d56 edx = 150d38<br>
esi= 150d60 edi=150e18 ebp = 165ae4 esp=165ab8<br>
    <br>
Objdump shows me addresses ranging from  <br>
100000 to 11de51 -- Which one address I look at?<br>
    <br>
I am not actually using anything in the application. I included the iostream
header but didi not use anything to make it fail. If I remove the include
directive, the app runs and is reduced by about 1050K. <br>
    <blockquote type="cite" cite="mid:3EA569BB.142424AC@OARcorp.com">
      <pre wrap=""><br>I see PR381 in the ChangeLog for 4.6.0pre2 and it appears to be<br>committed<br>to src/newlibc.c.  So that shouldn't be it.<br><br>What type of PC are you on?  What CPU is REALLY in it?  There are some<br>legitimate instruction variations between ix86 CPU models.  It is <br>possible that the updated tool combination somehow contains or<br>generates an instruction that is not valid for an i386DX.  It is also<br>possible that your CPU model is just enough not an i386dx where<br>something<br>has finally shown up.<br></pre>
      </blockquote>
I first tested on the DIMMPC, which is a 386sx. I then tested on 386dx with
no-coprocessor and it failed.<br>
I tested on Pentium and it passed.  The think that std cpp library getting
linked has co processor instructions in it. I can't find my co-processor
to plug into the dx computer right now so I can't confirm that. <br>
      <br>
I want to re-iterate that the prerelease 1 that works is using gcc 3.2 and
not 3.2.2. This also happened with 3.2.1, when I first tried to build the
pre-release 1, however, the task switching problem seemed to take precendence.<br>
      <blockquote type="cite" cite="mid:3EA569BB.142424AC@OARcorp.com">
        <pre wrap=""><br>--joel<br><br></pre>
        <blockquote type="cite">
          <pre wrap="">Joel Sherrill wrote:<br><br></pre>
          <blockquote type="cite">
            <pre wrap="">Hi,<br><br>RTEMS 4.6.0pre2 is now available at:<br><br><a class="moz-txt-link-freetext" href="ftp://ftp.oarcorp.com/pub/rtems/cd-working">ftp://ftp.oarcorp.com/pub/rtems/cd-working</a><br><br>It closes the following PRs:<br><br>PR 338/filesystem         PR 348/bsps                 PR 349/bsps<br>PR 351/networking       PR 352/rtems_misc       PR 353/bsps<br>PR 354/networking       PR 356/bsps                PR 357/rtems_misc<br>PR 360/bsps                PR 367/filesystem         PR 368/filesystem<br>PR 368/filesystems       PR 374/networking       PR 378/bsps<br>PR 379/bsps                PR 380/bsps                 PR 381/core<br>PR 383/bsps                PR 385/filesystem         PR 387/rtems_misc<br>PR 388/networking      PR 389/rtems<br><br>[NOTE: Hopefully next time I will know how to automate the GNATS<br>query so we will see the PR synopsis with that list. :)<br><br>Corresponding documentation is at:<br><br><a class="moz-txt-link-freetext" h
ref="http://www.oarcorp.com/rtemsdoc-4.6.0-pre/">http://www.oarcorp.com/rtemsdoc-4.6.0-pre/</a><br><br>I hope this is the final preview before the release.  But feedback is<br>needed.<br><br>Thanks<br><br>--joel<br><br><br><br></pre>
            </blockquote>
            <pre wrap="">--<br>Angelo Fraietta<br><br>PO Box 859<br>Hamilton NSW 2303<br><br>Home Page<br><br><a class="moz-txt-link-freetext" href="http://www.users.bigpond.com/angelo_f/">http://www.users.bigpond.com/angelo_f/</a><br><br>There are those who seek knowledge for the sake of knowledge - that is CURIOSITY<br>There are those who seek knowledge to be known by others - that is VANITY<br>There are those who seek knowledge in order to serve - that is LOVE<br>    Bernard of Clairvaux (1090 - 1153)<br><br>  ------------------------------------------------------------------------<br>#<br>#  Makefile<br>#<br><br>#<br>#  RTEMS_MAKEFILE_PATH is typically set in an environment variable<br>#<br><br>EXEC=ticker.exe<br>PGM=${ARCH}/$(EXEC)<br><br># optional managers required<br>MANAGERS=all<br><br># C source names<br>CSRCS = init.c<br>COBJS_ = $(CSRCS:.c=.o)<br>COBJS = $(COBJS_:%=${ARCH}/%)<br><br># C++ source names<br>CXXSRCS = tasks.cpp<br>CXXOBJS_ = $(CXXSRCS:.cpp=.o)<br>CXX
OBJS = $(CXXOBJS_:%=${ARCH}/%)<br><br># AS source names<br>ASSRCS =<br>ASOBJS_ = $(ASSRCS:.s=.o)<br>ASOBJS = $(ASOBJS_:%=${ARCH}/%)<br><br># Libraries<br>LIBS = -lrtemsall -lc<br><br>include $(RTEMS_MAKEFILE_PATH)/Makefile.inc<br><br>include $(RTEMS_CUSTOM)<br>include $(PROJECT_ROOT)/make/leaf.cfg<br><br>OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS)<br><br>all:    ${ARCH} $(PGM)<br><br>$(PGM): $(OBJS)<br>        $(make-cxx-exe)<br><br>j:<br>        @echo $(CFLAGS_DEBUG_V)<br>        @echo $(RTEMS_USE_GCC272)<br><br>  ------------------------------------------------------------------------<br>/*  Init<br> *<br> *  This routine is the initialization task for this test program.<br> *  It is called from init_exec and has the responsibility for creating<br> *  and starting the tasks that make up the test.  If the time of day<br> *  clock is required for the test, it should also be set to a known<br> *  value by this function.<br> *<br> *  Input parameters:  NONE<br> *<br> *  Output paramete
rs:  NONE<br> *<br> *  COPYRIGHT (c) 1989-1999.<br> *  On-Line Applications Research Corporation (OAR).<br> *<br> *  The license and distribution terms for this file may be<br> *  found in the file LICENSE in this distribution or at<br> *  <a class="moz-txt-link-freetext" href="http://www.OARcorp.com/rtems/license.html">http://www.OARcorp.com/rtems/license.html</a>.<br> *<br> *  init.c,v 1.11 2000/06/12 15:00:12 joel Exp<br> */<br><br>#define CONFIGURE_INIT<br>#include "system.h"<br>#include <stdio.h><br><br>rtems_task Test_task(<br>  rtems_task_argument argument<br>);<br><br>/*<br> *  Keep the names and IDs in global variables so another task can use them.<br> */<br><br>rtems_id   Task_id[ 4 ];         /* array of task ids */<br>rtems_name Task_name[ 4 ];       /* array of task names */<br><br>rtems_task Init(<br>  rtems_task_argument argument<br>)<br>{<br>  rtems_status_code status;<br>  rtems_time_of_day time;<br><br>  puts( "\n\n*** CLOCK TICK TEST ***" );<br><br>  
time.year   = 1988;<br>  time.month  = 12;<br>  time.day    = 31;<br>  time.hour   = 9;<br>  time.minute = 0;<br>  time.second = 0;<br>  time.ticks  = 0;<br><br>  status = rtems_clock_set( &time );<br><br>  Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );<br>  Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );<br>  Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );<br><br>  status = rtems_task_create(<br>    Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 8, RTEMS_DEFAULT_MODES,<br>    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]<br>  );<br><br>        /*<br>  status = rtems_task_create(<br>    Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,<br>    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ]<br>  );<br>  status = rtems_task_create(<br>        Task_name[ 3 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,<br>        RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 3 ]<br>  );<br>        */<br>        if (status == RTEMS_SUCCESSFUL)<br> 
       {<br>                printf ("Stack Size = %u\r\n", RTEMS_MINIMUM_STACK_SIZE);<br>                puts("Starting Task");<br>                status = rtems_task_start( Task_id[ 1 ], Test_task, 1 );<br>        }<br>        else<br>                {<br>                        puts("Unable to create task");<br>                }<br>        /*<br>  status = rtems_task_start( Task_id[ 2 ], Test_task, 2 );<br>  status = rtems_task_start( Task_id[ 3 ], Test_task, 3 );<br>        */<br>  status = rtems_task_delete( RTEMS_SELF );<br>}<br><br>  ------------------------------------------------------------------------<br>/*  system.h<br> *<br> *  This include file contains information that is included in every<br> *  function in the test set.<br> *<br> *  COPYRIGHT (c) 1989-1999.<br> *  On-Line Applications Research Corporation (OAR).<br> *<br> *  The license and distribution terms for this file may be<br> *  found in the file LICENSE in this distribution or at<br> *  <a class="moz-
txt-link-freetext" href="http://www.OARcorp.com/rtems/license.html">http://www.OARcorp.com/rtems/license.html</a>.<br> *<br> *  system.h,v 1.13 2000/06/12 15:00:12 joel Exp<br> */<br><br>#include <rtems.h><br><br>/* functions */<br><br>rtems_task Init(<br>  rtems_task_argument argument<br>);<br><br>/* global variables */<br><br>/*<br> *  Keep the names and IDs in global variables so another task can use them.<br> */<br><br>extern rtems_id   Task_id[ 4 ];         /* array of task ids */<br>extern rtems_name Task_name[ 4 ];       /* array of task names */<br><br>/* configuration information */<br><br>#include <bsp.h> /* for device driver prototypes */<br><br>#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER<br>#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER<br><br>#define CONFIGURE_MAXIMUM_TASKS             4<br><br>#define CONFIGURE_RTEMS_INIT_TASKS_TABLE<br><br>#define CONFIGURE_EXTRA_TASK_STACKS         (10 * RTEMS_MINIMUM_STACK_SIZE * CONFIGURE_MAXIMUM_TASKS)<
br><br>#include <confdefs.h><br><br>/*<br> *  Handy macros and static inline functions<br> */<br><br>/*<br> *  Macro to hide the ugliness of printing the time.<br> */<br><br>#define print_time(_s1, _tb, _s2) \<br>  do { \<br>    printf( "%s%02d:%02d:%02d   %02d/%02d/%04d%s", \<br>       _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \<br>       (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \<br>    fflush(stdout); \<br>  } while ( 0 )<br><br>/*<br> *  Macro to print an task name that is composed of ASCII characters.<br> *<br> */<br><br>#define put_name( _name, _crlf ) \<br>  do { \<br>    rtems_unsigned32 c0, c1, c2, c3; \<br>    \<br>    c0 = ((_name) >> 24) & 0xff; \<br>    c1 = ((_name) >> 16) & 0xff; \<br>    c2 = ((_name) >> 8) & 0xff; \<br>    c3 = (_name) & 0xff; \<br>    putchar( (char)c0 ); \<br>    if ( c1 ) putchar( (char)c1 ); \<br>    if ( c2 ) putchar( (char)c2 ); \<br>    if ( c3 ) putchar( (char)c3 ); 
\<br>    if ( (_crlf) ) \<br>      putchar( '\n' ); \<br>  } while (0)<br><br>/*<br> *  static inline routine to make obtaining ticks per second easier.<br> */<br><br>static inline rtems_unsigned32 get_ticks_per_second( void )<br>{<br>  rtems_interval ticks_per_second;<br>  (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second );  return ticks_per_second;<br>}<br><br>/*<br> *  This allows us to view the "Test_task" instantiations as a set<br> *  of numbered tasks by eliminating the number of application<br> *  tasks created.<br> *<br> *  In reality, this is too complex for the purposes of this<br> *  example.  It would have been easier to pass a task argument. :)<br> *  But it shows how rtems_id's can sometimes be used.<br> */<br><br>#define task_number( tid ) \<br>  ( rtems_get_index( tid ) - \<br>     rtems_configuration_get_rtems_api_configuration()->number_of_initialization_tasks )<br><br>/* end of include file */<br><br>  --------------------
----------------------------------------------------<br>/*  Test_task<br> *<br> *  This routine serves as a test task.  It verifies the basic task<br> *  switching capabilities of the executive.<br> *<br> *  Input parameters:  NONE<br> *<br> *  Output parameters:  NONE<br> *<br> *  COPYRIGHT (c) 1989-1999.<br> *  On-Line Applications Research Corporation (OAR).<br> *<br> *  The license and distribution terms for this file may be<br> *  found in the file LICENSE in this distribution or at<br> *  <a class="moz-txt-link-freetext" href="http://www.OARcorp.com/rtems/license.html">http://www.OARcorp.com/rtems/license.html</a>.<br> *<br> *  tasks.c,v 1.9 2002/04/17 14:01:40 joel Exp<br> */<br><br>#include "system.h"<br>#include <stdio.h><br>#include <stdlib.h><br>#include <iostream><br><br>extern "C" rtems_task Test_task(<br>  rtems_task_argument unused<br>)<br>{<br><br>  rtems_id          tid;<br>  rtems_time_of_day time;<br>  rtems_unsigned32  task_index;<br>  rt
ems_status_code status;<br><br>  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );<br>  task_index = task_number( tid );<br>  for ( ; ; ) {<br>                printf ("tick\r\n");<br>    status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );<br>    if ( time.second >= 35 ) {<br>      puts( "*** END OF CLOCK TICK TEST ***" );<br>      exit( 0 );<br>    }<br><br>    print_time( " - rtems_clock_get - ", &time, "\n" );<br>    status = rtems_task_wake_after( task_index * 5 * get_ticks_per_second() );<br>  }<br><br>}<br></pre>
            </blockquote>
            <pre wrap=""><!----><br></pre>
            </blockquote>
            <br>
            <pre class="moz-signature" cols="$mailwrapcol">-- 
Angelo Fraietta

PO Box 859
Hamilton NSW 2303

Home Page


<a class="moz-txt-link-freetext" href="http://www.users.bigpond.com/angelo_f/">http://www.users.bigpond.com/angelo_f/</a>

There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
    Bernard of Clairvaux (1090 - 1153)</pre>
            <br>
            </body>
            </html>