Changes between Version 9 and Version 10 of TBR/Review/Debugging/Start


Ignore:
Timestamp:
Feb 2, 2006, 11:37:17 PM (14 years ago)
Author:
JoelSherrill
Comment:

Added Starting with Hello World.

Legend:

Unmodified
Added
Removed
Modified
  • TBR/Review/Debugging/Start

    v9 v10  
    166166
    167167GDB should find the source.
     168= Starting With Hello World =
     169
     170
     171Congratulations! You are a new RTEMS user and you just got the hello world example to run on either a simulator or target hardware.  You are on top of the world.  So you modify hello world -- wouldn't it be cool to put a sleep between some prints like this:
     172
     173{{{
     174printf( "Hello world -- line 1\n");
     175sleep(1);
     176printf( "Hello world -- line 2\n");
     177}}}
     178
     179That ''sleep()'' could be any other call which blocks the caller while time passes.  But when you run this program, it only prints "Hello world -- line 1" and appears to lock up.  What is happening?
     180
     181The answer is simpler than you think.  RTEMS is always custom configured to meet the requirements of an application.  This means that the number and types of objects and device drivers available are tailored.  The hello world application does not require a clock device driver and thus it is not configured.  When you added the ''sleep()'', you added a call which needs the clock device driver configured in order to work.  All you have to do is added this line to the configure section of the application BEFORE including confdefs.h.
     182
     183{{{
     184#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
     185}}}
     186
     187As you add to your program, you may have to increase the number of objects configured as well.
    168188= Standard IO and File Issues =
    169189