aboutsummaryrefslogtreecommitdiff
path: root/nuttx/configs/sim
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/configs/sim')
-rw-r--r--nuttx/configs/sim/README.txt400
-rw-r--r--nuttx/configs/sim/doc/test-results.txt2914
-rw-r--r--nuttx/configs/sim/include/README.txt1
-rw-r--r--nuttx/configs/sim/mount/Make.defs121
-rw-r--r--nuttx/configs/sim/mount/appconfig39
-rw-r--r--nuttx/configs/sim/mount/defconfig389
-rwxr-xr-xnuttx/configs/sim/mount/setenv.sh45
-rw-r--r--nuttx/configs/sim/nettest/Make.defs121
-rw-r--r--nuttx/configs/sim/nettest/appconfig43
-rw-r--r--nuttx/configs/sim/nettest/defconfig388
-rwxr-xr-xnuttx/configs/sim/nettest/setenv.sh45
-rw-r--r--nuttx/configs/sim/nsh/Make.defs121
-rw-r--r--nuttx/configs/sim/nsh/appconfig43
-rw-r--r--nuttx/configs/sim/nsh/defconfig476
-rwxr-xr-xnuttx/configs/sim/nsh/setenv.sh45
-rw-r--r--nuttx/configs/sim/nsh2/Make.defs122
-rw-r--r--nuttx/configs/sim/nsh2/appconfig49
-rw-r--r--nuttx/configs/sim/nsh2/defconfig801
-rwxr-xr-xnuttx/configs/sim/nsh2/setenv.sh45
-rw-r--r--nuttx/configs/sim/nx/Make.defs121
-rw-r--r--nuttx/configs/sim/nx/appconfig39
-rw-r--r--nuttx/configs/sim/nx/defconfig607
-rwxr-xr-xnuttx/configs/sim/nx/setenv.sh45
-rw-r--r--nuttx/configs/sim/nx11/Make.defs121
-rw-r--r--nuttx/configs/sim/nx11/appconfig39
-rw-r--r--nuttx/configs/sim/nx11/defconfig572
-rwxr-xr-xnuttx/configs/sim/nx11/setenv.sh45
-rw-r--r--nuttx/configs/sim/nxffs/Make.defs121
-rw-r--r--nuttx/configs/sim/nxffs/appconfig39
-rw-r--r--nuttx/configs/sim/nxffs/defconfig398
-rwxr-xr-xnuttx/configs/sim/nxffs/setenv.sh45
-rw-r--r--nuttx/configs/sim/ostest/Make.defs121
-rw-r--r--nuttx/configs/sim/ostest/appconfig39
-rw-r--r--nuttx/configs/sim/ostest/defconfig382
-rwxr-xr-xnuttx/configs/sim/ostest/setenv.sh45
-rw-r--r--nuttx/configs/sim/pashello/Make.defs122
-rw-r--r--nuttx/configs/sim/pashello/appconfig42
-rw-r--r--nuttx/configs/sim/pashello/defconfig377
-rwxr-xr-xnuttx/configs/sim/pashello/setenv.sh45
-rw-r--r--nuttx/configs/sim/src/Makefile83
-rw-r--r--nuttx/configs/sim/src/README.txt1
-rw-r--r--nuttx/configs/sim/src/up_touchscreen.c182
-rw-r--r--nuttx/configs/sim/touchscreen/Make.defs121
-rw-r--r--nuttx/configs/sim/touchscreen/appconfig39
-rw-r--r--nuttx/configs/sim/touchscreen/defconfig601
-rwxr-xr-xnuttx/configs/sim/touchscreen/setenv.sh45
46 files changed, 10645 insertions, 0 deletions
diff --git a/nuttx/configs/sim/README.txt b/nuttx/configs/sim/README.txt
new file mode 100644
index 000000000..b5c057e05
--- /dev/null
+++ b/nuttx/configs/sim/README.txt
@@ -0,0 +1,400 @@
+README
+^^^^^^
+
+Contents
+^^^^^^^^
+ o Overview
+ - Description
+ - Fake Interrupts
+ - Timing Fidelity
+ o Debugging
+ o Issues
+ - 64-bit Issues
+ - Stack Size Issues
+ - Buffered I/O Issues
+ - Networking Issues
+ - X11 Issues
+ o Configurations
+
+Overview
+^^^^^^^^
+
+Description
+-----------
+This README file describes the contents of the build configurations available
+for the NuttX "sim" target. The sim target is a NuttX port that runs as a
+user-space program under Linux or Cygwin. It is a very "low fidelity" embedded
+system simulation: This environment does not support any kind of asynchonous
+events -- there are nothing like interrupts in this context. Therefore, there
+can be no pre-empting events.
+
+Fake Interrupts
+---------------
+In order to get timed behavior, the system timer "interrupt handler" is called
+from the sim target's IDLE loop. The IDLE runs whenever there is no other task
+running. So, for example, if a task calls sleep(), then that task will suspend
+wanting for the time to elapse. If nothing else is available to run, then the
+IDLE loop runs and the timer increments, eventually re-awakening the sleeping task.
+
+Context switching is based on logic similar to setjmp() and longjmp().
+
+The sim target is used primarily as a development and test platform for new
+RTOS features. It is also of academic interest. But it has no real-world
+application that I know of.
+
+Timing Fidelity
+---------------
+NOTE: In order to facility fast testing, the sim target's IDLE loop, by default,
+calls the system "interrupt handler" as fast as possible. As a result, there
+really are no noticeable delays when a task sleeps. However, the task really does
+sleep -- but the time scale is wrong. If you want behavior that is closer to
+normal timing, then you can define CONFIG_SIM_WALLTIME=y in your configuration
+file. This configuration setting will cause the sim target's IDLE loop to delay
+on each call so that the system "timer interrupt" is called at a rate approximately
+correct for the system timer tick rate. With this definition in the configuration,
+sleep() behavior is more or less normal.
+
+Debugging
+^^^^^^^^^
+One of the best reasons to use the simulation is that is supports great, Linux-
+based debugging. Here are the steps that I following to use the Linux ddd
+graphical front-end to GDB:
+
+1. Modify the top-level configuration file. Enable debug symbols by defining
+ the following.
+
+ cd <NuttX-Directory>
+ CONFIG_DEBUG_SYMBOLS=y
+
+2. Re-build:
+
+ cd <NuttX-Directory>
+ make clean
+ make
+
+3. Then start the debugging:
+
+ ddd nuttx &
+ gdb> b user_start
+ gdb> r
+
+NOTE: This above steps work fine on both Linux and Cygwin. On Cygwin, you
+will need to start the Cywin-X server before running ddd.
+
+Issues
+^^^^^^
+
+64-Bit Issues
+-------------
+As mentioned above, context switching is based on logic like setjmp and longjmp.
+This context switching is only available for 32-bit targets. On 64-bit machines,
+this context switching will fail.
+
+There are other 64-bit issues as well. For example, addresses are retained in
+32-bit unsigned integer types in a few places. On a 64-bit machine, the 32-bit
+address storage may correcupt 64-bit addressing. NOTE: This is really a bug --
+addresses should not be retained in uint32_t types but rather in uintptr_t types
+to avoid issues just like this.
+
+The workaround on 64-bit machines for now is to build for a 32-bit target on the
+64-bit machine. This workaround involves modifying the Make.defs file in the
+appropriate places so that -m32 is included in the CFLAGS and -m32 and -melf_386
+are included in the LDFLAGS. See the patch 0001-Quick-hacks-to-build-sim-nsh-ostest-on-x86_64-as-32-.patch
+that can be found at http://tech.groups.yahoo.com/group/nuttx/files.
+
+Stack Size Issues
+-----------------
+When you run the NuttX simulation, it uses stacks allocated by NuttX from the
+NuttX heap. The memory management model is exactly the same in the simulation
+as it is real, target system. This is good because this produces a higher
+fidelity simulation.
+
+However, when the simulation calls into Linux/Cygwin libraries, it will still
+use these small simulation stacks. This happens, for example, when you call
+into the system to get and put characters to the console window or when you
+make x11 calls into the system. The programming model within those libraries
+will assume a Linux/Cygwin environment where the stack size grows dynamically
+and not the small, limited stacks of a deeply embedded system.
+
+As a consequence, those system libraries may allocate large data structures
+on the stack and overflow the small NuttX stacks. X11, in particular,
+requires large stacks. If you are using X11 in the simulation, make sure
+that you set aside a "lot" of stack for the X11 system calls (maybe 8 or 16Kb).
+The stack size for the thread that begins with user start is controlled
+by the configuration setting CONFIG_USERMAIN_STACKSIZE; you may need to
+increase this value to larger number to survive the X11 system calls.
+
+If you are running X11 applications as NSH add-on programs, then the stack
+size of the add-on program is controlled in another way. Here are the
+steps for increasing the stack size in that case:
+
+ cd ../apps/namedapps # Go to the namedapps directory
+ vi namedapps_list.h # Edit this file and increase the stack size of the add-on
+ rm .built *.o # This will force the namedapps logic to rebuild
+
+Buffered I/O Issues
+-------------------
+The simulated serial driver has some odd behavior. It will stall for a long time
+on reads when the C stdio buffers are being refilled. This only effects the behavior
+of things like fgetc(). Workaround: Set CONFIG_STDIO_BUFFER_SIZE=0, suppressing
+all C buffered I/O.
+
+Networking Issues
+-----------------
+I never did get networking to work on the sim target. It tries to use the tap device
+(/dev/net/tun) to emulate an Ethernet NIC, but I never got it correctly integrated
+with the NuttX networking (I probably should try using raw sockets instead).
+
+X11 Issues
+----------
+There is an X11-based framebuffer driver that you can use exercise the NuttX graphics
+subsystem on the simulator (see the sim/nx11 configuration below). This may require a
+lot of tinkering to get working, depending upon where your X11 installation stores
+libraries and header files and how it names libraries.
+
+For example, on UBuntu 9.09, I had to do the following to get a clean build:
+
+ cd /usr/lib/
+ sudo ln -s libXext.so.6.4.0 libXext.so
+
+(I also get a segmentation fault at the conclusion of the NX test -- that will need
+to get looked into as well).
+
+The X11 examples builds on Cygwin, but does not run. The last time I tried it,
+XOpenDisplay() aborted the program. UPDATE: This was caused by the small stack
+size and can be fixed by increasing the size of the NuttX stack that calls into
+X11. See the discussion "Stack Size Issues" above.
+
+Configurations
+^^^^^^^^^^^^^^
+
+mount
+
+ Description
+ -----------
+ Configures to use examples/mount. This configuration may be
+ selected as follows:
+
+ cd <nuttx-directory>/tools
+ ./configure.sh sim/mount
+
+nettest
+
+ Description
+ -----------
+ Configures to use examples/nettest. This configuration
+ enables networking using the network TAP device. It may
+ be selected via:
+
+ cd <nuttx-directory>/tools
+ ./configure.sh sim/nettest
+
+ NOTES:
+ - The NuttX network is not, however, functional on the Linux TAP
+ device yet.
+
+ - As of NuttX-5.18, when built on Windows, this test does not try
+ to use the TAP device (which is not available on Cygwin anyway),
+ but inside will try to use the Cygwin WPCAP library. Only the
+ most preliminary testing has been performed with the Cygwin WPCAP
+ library, however.
+
+ NOTE that the IP address is hard-coded in arch/sim/src/up_wpcap.c.
+ You will either need to edit your configuration files to use 10.0.0.1
+ on the "target" (CONFIG_EXAMPLE_NETTEST_*) or edit up_wpcap.c to
+ select the IP address that you want to use.
+
+nsh
+
+ Description
+ -----------
+ Configures to use the NuttShell at examples/nsh. This configuration
+ may be selected as follows:
+
+ cd <nuttx-directory>/tools
+ ./configure.sh sim/nsh
+
+nsh2
+
+ Description
+ -----------
+ This is another example that configures to use the NuttShell at examples/nsh.
+ Unlike nsh, this version uses NSH built-in functions. The nx, nxhello, and
+ nxlines examples are included as built-in functions.
+
+ X11 Configuration
+ -----------------
+ This configuration uses an X11-based framebuffer driver. Of course, this
+ configuration can only be used in environments that support X11! (And it
+ may not even be usable in all of those environments without some "tweaking"
+ See discussion below under the nx11 configuration).
+
+ Configuring
+ -----------
+ This configuration may be selected as follows:
+
+ cd <nuttx-directory>/tools
+ ./configure.sh sim/nsh2
+
+nx
+
+ Description
+ -----------
+ Configures to use examples/nx. This configuration may be
+ selected as follows:
+
+ cd <nuttx-directory>/tools
+ ./configure.sh sim/nx
+
+ Special Framebuffer Configuration
+ ---------------------------------
+ Special simulated framebuffer configuration options:
+
+ CONFIG_SIM_FBHEIGHT - Height of the framebuffer in pixels
+ CONFIG_SIM_FBWIDTH - Width of the framebuffer in pixels.
+ CONFIG_SIM_FBBPP - Pixel depth in bits
+
+ No Display!
+ -----------
+ This version has NO DISPLAY and is only useful for debugging NX
+ internals in environments where X11 is not supported. There is
+ and additonal configuration that may be added to include an X11-
+ based simulated framebuffer driver:
+
+ CONFIG_SIM_X11FB - Use X11 window for framebuffer
+
+ See the "nx11" configuration below for more information.
+
+ Multi- and Single-User Modes
+ ----------------------------
+ The default is the single-user NX implementation. To select
+ the multi-user NX implementation:
+
+ CONFG_NX_MULTIUSER=y
+ CONFIG_DISABLE_MQUEUE=n
+
+nx11
+
+ Description
+ -----------
+ Configures to use examples/nx. This configuration is similar
+ to the nx configuration except that it adds support for an X11-
+ based framebuffer driver. Of course, this configuration can only
+ be used in environments that support X11! (And it may not even
+ be usable in all of those environments without some "tweaking").
+
+ This configuration may be selected as follows:
+
+ cd <nuttx-directory>/tools
+ ./configure.sh sim/nx11
+
+ Special Framebuffer Configuration
+ ---------------------------------
+ This configuration uses the same special simulated framebuffer
+ configuration options as the nx configuration:
+
+ CONFIG_SIM_X11FB - Use X11 window for framebuffer
+ CONFIG_SIM_FBHEIGHT - Height of the framebuffer in pixels
+ CONFIG_SIM_FBWIDTH - Width of the framebuffer in pixels.
+ CONFIG_SIM_FBBPP - Pixel depth in bits
+
+ X11 Configuration
+ -----------------
+ But now, since CONFIG_SIM_X11FB is also selected the following
+ definitions are needed
+
+ CONFIG_SIM_FBBPP (must match the resolution of the display).
+ CONFIG_FB_CMAP=y
+
+ My system has 24-bit color, but packed into 32-bit words so
+ the correct seeting of CONFIG_SIM_FBBPP is 32.
+
+ For whatever value of CONFIG_SIM_FBBPP is selected, the
+ corresponidng CONFIG_NX_DISABLE_*BPP setting must not be
+ disabled.
+
+ Touchscreen Support
+ -------------------
+ A X11 mouse-based touchscreen simulation can also be enabled
+ by setting:
+
+ CONFIG_INPUT=y
+ CONFIG_SIM_TOUCHSCREEN=y
+
+ Then you must also have some application logic that will call
+ sim_tcinitialize(0) to register the touchscreen driver. See
+ also configuration "touchscreen"
+
+ NOTES:
+
+ 1. If you do not have the call to sim_tcinitializE(0), the build
+ will mysteriously fail claiming that is can't find up_tcenter()
+ and up_tcleave(). That is a consequence of the crazy way that
+ the simulation is built and can only be eliminated by calling
+ up_simtouchscreen(0) from your application.
+
+ 2. You must first up_fbinitialize() before calling up_simtouchscreen()
+ or you will get a crash.
+
+ 3. Call sim_tcuninintialize() when you are finished with the
+ simulated touchscreen.
+
+ 4. Enable CONFIG_DEBUG_INPUT=y for touchscreen debug output.
+
+ X11 Build Issues
+ ----------------
+ To get the system to compile under various X11 installations
+ you may have to modify a few things. For example, in order
+ to find libXext, I had to make the following change under
+ Ubuntu 9.09:
+
+ cd /usr/lib/
+ sudo ln -s libXext.so.6.4.0 libXext.so
+
+ Multi- and Single-User Modes
+ ----------------------------
+ The default is the single-user NX implementation. To select
+ the multi-user NX implementation:
+
+ CONFG_NX_MULTIUSER=y
+ CONFIG_DISABLE_MQUEUE=n
+
+ostest
+
+ Description
+ -----------
+ The "standard" NuttX examples/ostest configuration. This
+ configuration may be selected as follows:
+
+ cd <nuttx-directory>/tools
+ ./configure.sh sim/ostest
+
+pashello
+
+ Description
+ -----------
+ Configures to use examples/pashello. This configuration may
+ by selected as follows:
+
+ cd <nuttx-directory>/tools
+ ./configure.sh sim/pashello
+
+touchscreen
+
+ Description
+ -----------
+ This configuration uses the simple touchscreen test at
+ apps/examples/touchscreen. This test will create an empty X11 window
+ and will print the touchscreen output as it is received from the
+ simulated touchscreen driver. This configuration may
+ by selected as follows:
+
+ cd <nuttx-directory>/tools
+ ./configure.sh sim/touchscreen
+
+ Since this example uses the simulated frame buffer driver, the
+ most of the configuration settings discussed for the "nx11"
+ configuration also apply here. See that discussion above.
+
+ See apps/examples/README.txt for further information about build
+ requirements and configuration settings.
diff --git a/nuttx/configs/sim/doc/test-results.txt b/nuttx/configs/sim/doc/test-results.txt
new file mode 100644
index 000000000..ebde2fa60
--- /dev/null
+++ b/nuttx/configs/sim/doc/test-results.txt
@@ -0,0 +1,2914 @@
+This is the output from the sim target from April 28, 2007
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+os_start: Entry
+mm_addregion: Region 1: base=805d240 size=4194304
+malloc: Allocated 805e560
+malloc: Allocated 805e7f0
+malloc: Allocated 805ec00
+malloc: Allocated 805f010
+os_start: Starting init thread
+malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 805f6a0
+malloc: Allocated 805f930
+malloc: Allocated 805fd40
+malloc: Allocated 8060150
+malloc: Allocated 8060560
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+stdio_test: write fd=1
+stdio_test: write fd=2
+malloc: Allocated 8061570
+malloc: Allocated 8061660
+malloc: Allocated 80617f0
+malloc: Allocated 8061a80
+malloc: Allocated 8061e90
+malloc: Allocated 80622a0
+malloc: Allocated 80626b0
+malloc: Allocated 80646c0
+malloc: Allocated 80646d0
+malloc: Allocated 80646e0
+malloc: Allocated 80646f0
+up_unblock_task: Unblocking TCB=8061570
+stdio_test: Standard I/O Check: printf
+user_start: Started user_main at PID=2
+stdio_test: Standard I/O Check: fprintf to stderr
+_exit: TCB=805f420 exitting
+free: Freeing 8060560
+free: Freeing 805f510
+free: Freeing 805f930
+free: Freeing 805fd40
+free: Freeing 8060150
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 805f6a0
+free: Freeing 805f420
+_exit: New Active Task TCB=8061570
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+os_start: Beginning Idle Loop
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_mutex_init: mutex=0x845d6f0 attr=0x0
+pthread_mutex_init: Returning 0
+malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 805f530
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+pthread_mutex_lock: mutex=0x845d6f0
+pthread_mutex_lock: Returning 0
+up_reprioritize_rtr: TCB=805f420 PRI=100
+up_reprioritize_rtr: New Active Task TCB=8061570
+malloc: Allocated 8064700
+malloc: Allocated 8061540
+malloc: Allocated 80647f0
+up_unblock_task: Unblocking TCB=8064700
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_reprioritize_rtr: TCB=805f420 PRI=100
+up_reprioritize_rtr: New Active Task TCB=8064700
+up_unblock_task: Unblocking TCB=8061570
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+up_reprioritize_rtr: TCB=805f420 PRI=100
+up_reprioritize_rtr: New Active Task TCB=8061570
+pthread_join: thread=3
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=805f420
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6f0
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805f420
+pthread_mutex_lock: Returning 0
+pthread_mutex_unlock: mutex=0x845d6f0
+up_unblock_task: Unblocking TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=3 exit_value=0
+pthread_notifywaiters: pjoin=0x805f510
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: Returning 0
+up_reprioritize_rtr: TCB=8064700 PRI=100
+up_reprioritize_rtr: New Active Task TCB=8061570
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8064700
+up_reprioritize_rtr: TCB=8064700 PRI=100
+up_reprioritize_rtr: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=805f420 exitting
+free: Freeing 805f530
+free: Freeing 805f420
+_exit: New Active Task TCB=8064700
+up_reprioritize_rtr: TCB=8064700 PRI=100
+up_reprioritize_rtr: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x805f510
+free: Freeing 805f510
+pthread_join: Returning 0
+pthread_join: thread=4
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: mutex=0x845d6f0
+pthread_mutex_unlock: Returning 0
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=4 exit_value=0
+pthread_notifywaiters: pjoin=0x8061540
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=8061570
+up_unblock_task: Unblocking TCB=8064700
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8064700
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=8064700 exitting
+free: Freeing 80647f0
+free: Freeing 8064700
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x8061540
+free: Freeing 8061540
+pthread_join: Returning 0
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+
+user_main: Begin argument test
+user_main: Started with argc=5
+user_main: argv[0]="ostest"
+user_main: argv[1]="Arg1"
+user_main: argv[2]="Arg2"
+user_main: argv[3]="Arg3"
+user_main: argv[4]="Arg4"
+
+End of test memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 5370 5370
+fordblks 3fac90 3fac90
+
+user_main: /dev/null test
+dev_null: Read 0 bytes from /dev/null
+dev_null: Wrote 1024 bytes to /dev/null
+
+End of test memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 5370 5370
+fordblks 3fac90 3fac90
+
+user_main: mutex test
+Initializing mutex
+Starting thread 1
+Starting thread 2
+ Thread1 Thread2
+ Loops 32 32
+ Errors 0 0
+
+End of test memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 53pthread_mutex_init: mutex=0x845d6a0 attr=0x0
+pthread_mutex_init: Returning 0
+pthread_cond_init: cond=0x845d6a8 attr=0x0
+pthread_cond_init: Returning 0
+pthread_attr_init: attr=0x80645ec
+pthread_attr_init: Returning 0
+pthread_attr_setstacksize: attr=0x80645ec stacksize=16384
+pthread_attr_setstacksize: Returning 0
+malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 8064700
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+pthread_mutex_lock: mutex=0x845d6a0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6a8 mutex=0x845d6a0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_completejoin: process_id=5 exit_value=ffffffff
+pthread_notifywaiters: pjoin=0x805f510
+free: Freeing 8064700
+free: Freeing 805f420
+pthread_join: thread=5
+pthread_join: Thread has terminated
+pthread_join: exit_value=0xffffffff
+pthread_destroyjoin: pjoin=0x805f510
+free: Freeing 805f510
+pthread_join: Returning 0
+pthread_cond_destroy: cond=0x845d6a8
+pthread_cond_destroy: Returning 0
+pthread_cond_destroy: cond=0x845d6a8
+pthread_cond_destroy: Returning 0
+pthread_mutex_init: mutex=0x845d6a0 attr=0x0
+pthread_mutex_init: Returning 0
+pthread_cond_init: cond=0x845d6a8 attr=0x0
+pthread_cond_init: Returning 0
+pthread_attr_init: attr=0x80645cc
+pthread_attr_init: Returning 0
+pthread_attr_setstacksize: attr=0x80645cc stacksize=16384
+pthread_attr_setstacksize: Returning 0
+malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 8064700
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+pthread_mutex_lock: mutex=0x845d6a0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6a8 mutex=0x845d6a0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_detach: Thread=6
+pthread_detach: Returning 0
+pthread_completejoin: process_id=6 exit_value=ffffffff
+pthread_notifywaiters: pjoin=0x805f510
+pthread_destroyjoin: pjoin=0x805f510
+free: Freeing 805f510
+free: Freeing 8064700
+free: Freeing 805f420
+pthread_join: thread=6
+pthread_join: Could not find thread data
+pthread_join: Returning 3
+70 5370
+fordblks 3fac90 3fac90
+
+user_main: cancel test
+cancel_test: Test 1: Normal Cancelation
+cancel_test: Starting thread
+start_thread: Initializing mutex
+start_thread: Initializing cond
+start_thread: Starting thread
+thread_waiter: Taking mutex
+thread_waiter: Starting wait for condition
+start_thread: Yielding
+cancel_test: Canceling thread
+cancel_test: Joining
+cancel_test: waiter exited with result=ffffffff
+cancel_test: PASS thread terminated with PTHREAD_CANCELED
+cancel_test: Test 2: Cancelation of detached thread
+cancel_test: Re-starting thread
+restart_thread: Destroying cond
+restart_thread: Destroying mutex
+restart_thread: Re-starting thread
+start_thread: Initializing mutex
+start_thread: Initializing cond
+start_thread: Starting thread
+thread_waiter: Taking mutex
+thread_waiter: Starting wait for condition
+start_thread: Yielding
+cancel_test: Canceling thread
+cancel_test: Joining
+cancel_test: PASS pthread_join failed with status=ESRCH
+cancel_test: Test 3: Non-cancelable threads
+cancel_test: Re-startipthread_cond_destroy: cond=0x845d6a8
+pthread_cond_destroy: Returning 0
+pthread_cond_destroy: cond=0x845d6a8
+pthread_cond_destroy: Returning 0
+pthread_mutex_init: mutex=0x845d6a0 attr=0x0
+pthread_mutex_init: Returning 0
+pthread_cond_init: cond=0x845d6a8 attr=0x0
+pthread_cond_init: Returning 0
+pthread_attr_init: attr=0x80645cc
+pthread_attr_init: Returning 0
+pthread_attr_setstacksize: attr=0x80645cc stacksize=16384
+pthread_attr_setstacksize: Returning 0
+malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 8064700
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+pthread_mutex_lock: mutex=0x845d6a0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6a8 mutex=0x845d6a0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_mutex_lock: mutex=0x845d6a0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6a8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6a0
+pthread_mutex_unlock: Returning 0
+pthread_join: thread=7
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6a0
+pthread_mutex_unlock: Returning 0
+pthread_exit: exit_value=ffffffff
+pthread_completejoin: process_id=7 exit_value=ffffffff
+pthread_notifywaiters: pjoin=0x805f510
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_join: exit_value=0xffffffff
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=805f420 exitting
+free: Freeing 8064700
+free: Freeing 805f420
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x805f510
+free: Freeing 805f510
+pthread_join: Returning 0
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_attr_init: attr=0x80645f0
+pthread_attr_init: Returning 0
+pthread_attr_setschedparam: attr=0x80645f0 param=0x80645f8
+pthread_attr_setschedparam: Returning 0
+malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 805f530
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+ng thread (non-cancelable)
+restart_thread: Destroying cond
+restart_thread: Destroying mutex
+restart_thread: Re-starting thread
+start_thread: Initializing mutex
+start_thread: Initializing cond
+start_thread: Starting thread
+thread_waiter: Taking mutex
+thread_waiter: Starting wait for condition
+thread_waiter: Setting non-cancelable
+start_thread: Yielding
+cancel_test: Canceling thread
+cancel_test: Joining
+thread_waiter: Releasing mutex
+thread_waiter: Setting cancelable
+cancel_test: waiter exited with result=ffffffff
+cancel_test: PASS thread terminated with PTHREAD_CANCELED
+
+End of test memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 5370 5370
+fordblks 3fac90 3fac90
+
+user_main: semaphore test
+sem_test: Initializing semaphore to 0
+sem_test: Starting waiter thread 1
+sem_test: Set thread 1 priority to 191
+waiter_func: Thread 1 Started
+waiter_func: Thread 1 initial semaphore value = 0
+waiter_func: Thup_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_attr_init: attr=0x80645f0
+pthread_attr_init: Returning 0
+pthread_attr_setschedparam: attr=0x80645f0 param=0x80645f8
+pthread_attr_setschedparam: Returning 0
+malloc: Allocated 8064700
+malloc: Allocated 8061540
+malloc: Allocated 80647f0
+up_unblock_task: Unblocking TCB=8064700
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8064700
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=8061570
+pthread_attr_init: attr=0x80645f0
+pthread_attr_init: Returning 0
+pthread_attr_setschedparam: attr=0x80645f0 param=0x80645f8
+pthread_attr_setschedparam: Returning 0
+malloc: Allocated 8066800
+malloc: Allocated 80668f0
+malloc: Allocated 8066910
+up_unblock_task: Unblocking TCB=8066800
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8066800
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_join: thread=8
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8066800
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=8 exit_value=0
+pthread_notifywaiters: pjoin=0x805f510
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=805f420 exitting
+free: Freeing 805f530
+free: Freeing 805f420
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x805f510
+free: Freeing 805f510
+pthread_join: Returning 0
+pthread_join: thread=9
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8066800
+up_unblock_task: Unblocking TCB=8064700
+up_unblock_task: New Active Task TCB=8064700
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=9 exit_value=0
+pthread_notifywaiters: pjoin=0x8061540
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=8061570
+up_unblock_task: Unblocking TCB=8064700
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8064700
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=8064700 exitting
+free: Freeing 80647f0
+free: Freeing 8064700
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x8061540
+free: Freeing 8061540
+pthread_join: Returning 0
+pthread_join: thread=10
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8066800
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=10 exit_value=0
+pthread_notifywaiters: pjoin=0x80668f0
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8066800
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x80668f0
+free: Freeing 80668f0
+pthread_join: Returning 0
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8066800
+_exit: TCB=8066800 exitting
+free: Freeing 8066910
+free: Freeing 8066800
+_exit: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+read 1 aiting on semaphore
+sem_test: Starting waiter thread 2
+sem_test: Set thread 2 priority to 128
+waiter_func: Thread 2 Started
+waiter_func: Thread 2 initial semaphore value = -1
+waiter_func: Thread 2 aiting on semaphore
+sem_test: Starting poster thread 3
+sem_test: Set thread 3 priority to 64
+poster_func: Thread 3 started
+poster_func: Thread 3 semaphore value = -2
+poster_func: Thread 3 posting semaphore
+waiter_func: Thread 1 awakened
+waiter_func: Thread 1 new semaphore value = -1
+waiter_func: Thread 1 done
+poster_func: Thread 3 new semaphore value = -1
+poster_func: Thread 3 semaphore value = -1
+poster_func: Thread 3 posting semaphore
+waiter_func: Thread 2 awakened
+waiter_func: Thread 2 new semaphore value = 0
+waiter_func: Thread 2 done
+poster_func: Thread 3 new semaphore value = 0
+poster_func: Thread 3 done
+
+End of test memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 5370 5370
+fordblks 3facpthread_mutex_init: mutex=0x845d6d0 attr=0x0
+pthread_mutex_init: Returning 0
+pthread_cond_init: cond=0x845d6d8 attr=0x0
+pthread_cond_init: Returning 0
+pthread_attr_init: attr=0x80645f8
+pthread_attr_init: Returning 0
+pthread_attr_setschedparam: attr=0x80645f8 param=0x80645f4
+pthread_attr_setschedparam: Returning 0
+malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 805f530
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_attr_init: attr=0x80645f8
+pthread_attr_init: Returning 0
+pthread_attr_setschedparam: attr=0x80645f8 param=0x80645f4
+pthread_attr_setschedparam: Returning 0
+malloc: Allocated 8064700
+malloc: Allocated 8061540
+malloc: Allocated 80647f0
+up_unblock_task: Unblocking TCB=8064700
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8064700
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_join: thread=12
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_signal: cond=0x845d6d8
+pthread_cond_signal: sval=-1
+pthread_cond_signal: Signalling...
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_cond_wait: Reacquire mutex...
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_cond_signal: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8064700
+up_release_pending: New Active Task TCB=805f420
+pthread_cond_wait: Returning 0
+pthread_mutex_unlock: mutex=0x845d6d0
+pthread_mutex_unlock: Returning 0
+pthread_mutex_lock: mutex=0x845d6d0
+pthread_mutex_lock: Returning 0
+pthread_cond_wait: cond=0x845d6d8 mutex=0x845d6d0
+pthread_cond_wait: Give up mutex / take cond
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+pthread_mutex_unlock: Returning 0
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=12 exit_value=0
+pthread_notifywaiters: pjoin=0x8061540
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8064700
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x8061540
+free: Freeing 8061540
+pthread_join: Returning 0
+pthread_detach: Thread=11
+pthread_detach: Returning 0
+pthread_completejoin: process_id=11 exit_value=ffffffff
+pthread_notifywaiters: pjoin=0x805f510
+pthread_destroyjoin: pjoin=0x805f510
+free: Freeing 805f510
+free: Freeing 805f530
+free: Freeing 805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8064700
+_exit: TCB=8064700 exitting
+free: Freeing 80647f0
+free: Freeing 8064700
+_exit: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_mutex_init: mutex=0x845d708 attr=0x0
+pthread_mutex_init: Returning 0
+pthread_cond_init: cond=0x845d710 attr=0x0
+pthread_cond_init: Returning 0
+pthread_attr_init: attr=0x8064604
+pthread_attr_init: Returning 0
+pthread_attr_setschedparam: attr=0x8064604 param=0x8064600
+pthread_attr_setschedparam: Returning 0
+90 3fac90
+
+user_main: condition variable test
+cond_test: Initializing mutex
+cond_test: Initializing cond
+cond_test: Starting waiter
+cond_test: Set thread 1 priority to 128
+waiter_thread: Started
+cond_test: Starting signaler
+cond_test: Set thread 2 priority to 64
+thread_signaler: Started
+thread_signaler: Terminating
+cond_test: signaler terminated, now cancel the waiter
+cond_test: Waiter Signaler
+cond_test: Loops 32 32
+cond_test: Errors 0 0
+cond_test:
+0 times, waiter did not have to wait for data
+cond_test: 0 times, data was already available when the signaler run
+cond_test: 0 times, the waiter was in an unexpected state when the signaler ran
+
+End of test memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 5370 5370
+fordblks 3fac90 3fac90
+
+user_main: timed wait test
+thread_waiter: Initializing mutex
+timedwait_test: Initializing cond
+timedwait_test: Starting waiter
+timedwait_test: Set thread 2 malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 805f530
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+pthread_mutex_lock: mutex=0x845d708
+pthread_mutex_lock: Returning 0
+clock_gettime: clock_id=0
+clock_gettime: msecs = 70 g_tickbias=0
+clock_gettime: secs = 70 + 1172534400 nsecs = 70000000 + 0
+clock_gettime: Returning tp=(1172534400,70000000)
+pthread_cond_timedwait: cond=0x845d710 mutex=0x845d708 abstime=0x80614fc
+pthread_cond_timedwait: Give up mutex...
+clock_gettime: clock_id=0
+clock_gettime: msecs = 70 g_tickbias=0
+clock_gettime: secs = 70 + 1172534400 nsecs = 70000000 + 0
+clock_gettime: Returning tp=(1172534400,70000000)
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+priority to 177
+thread_waiter: Taking mutex
+thread_waiter: Starting 5 second wait for condition
+timedwait_test: Joining
+pthread_join: thread=13
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+sigqueue: TCB=0x0805f420 signo=3 value=0
+sig_received: sig_received: TCB=0x0805f420 signo=3 code=1 value=0 mask=00000000
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=805d140
+up_release_pending: New Active Task TCB=805f420
+up_release_pending: Delivering signals TCB=805f420
+pthread_cond_timedwait: Timedout!
+pthread_cond_timedwait: Re-locking...
+pthread_cond_timedwait: Returning 110
+pthread_mutex_unlock: mutex=0x845d708
+pthread_mutex_unlock: Returning 0
+pthread_exit: exit_value=12345678
+pthread_completejoin: process_id=13 exit_value=12345678
+pthread_notifywaiters: pjoin=0x805f510
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_join: exit_value=0x12345678
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=805f420 exitting
+free: Freeing 805f530
+free: Freeing 805f420
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x805f510
+free: Freeing 805f510
+pthread_join: Returning 0
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_attr_init: attr=0x80645f4
+pthread_attr_init: Returning 0
+pthread_attr_setstacksize: attr=0x80645f4 stacksize=16384
+pthread_attr_setstacksize: Returning 0
+pthread_attr_setschedparam: attr=0x80645f4 param=0x80645f0
+pthread_attr_setschedparam: Returning 0
+malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 8064700
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+malloc: Allocated 805f530
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_attr_init: attr=0x80645f4
+pthread_attr_init: Returning 0
+pthread_attr_setstacksize: attr=0x80645f4 stacksize=16384
+pthread_attr_setstacksize: Returning 0
+pthread_attr_setschedparam: attr=0x80645f4 param=0x80645f0
+pthread_attr_setschedparam: Returning 0
+malloc: Allocated 805f570
+malloc: Allocated 805f660
+malloc: Allocated 8068710
+up_unblock_task: Unblocking TCB=805f570
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f570
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_join: thread=15
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f570
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=805f570
+up_release_pending: New Active Task TCB=805f420
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=805f570
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=805f570
+up_release_pending: New Active Task TCB=805f420
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=805f570
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=805f570
+up_release_pending: New Active Task TCB=805f420
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=805f570
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=805f570
+up_release_pending: New Active Task TCB=805f420
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=805f570
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=805f570
+up_release_pending: New Active Task TCB=805f420
+thread_waiter: pthread_cond_timedwait timed out
+thread_waiter: Releasing mutex
+thread_waiter: Exit with status 0x12345678
+timedwait_test: waiter exited with result=12345678
+
+End of test memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 5370 5370
+fordblks 3fac90 3fac90
+
+user_main: message queue test
+mqueue_test: Starting receiver
+mqueue_test: Set receiver priority to 128
+receiver_thread: Starting
+mqueue_test: Starting sender
+mqueue_test: Set sender thread priority to 64
+mqueue_test: Waiting for sender to complete
+sender_thread: Starting
+receiver_thread: mq_receive succeeded on msg 0
+sender_thread: mq_send succeeded on msg 0
+receiver_thread: mq_receive succeeded on msg 1
+sender_thread: mq_send succeeded on msg 1
+receiver_thread: mq_receive succeeded on msg 2
+sender_thread: mq_send succeeded on msg 2
+receiver_thread: mq_receive succeeded on msg 3
+sender_thread: mq_send succeeded on msg 3
+receiverup_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=805f570
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=805f570
+up_release_pending: New Active Task TCB=805f420
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=805f570
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=805f570
+up_release_pending: New Active Task TCB=805f420
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=805f570
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=805f570
+up_release_pending: New Active Task TCB=805f420
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=805f570
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=805f570
+up_release_pending: New Active Task TCB=805f420
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=805f570
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=805f570
+up_release_pending: New Active Task TCB=805f420
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=805f570
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=15 exit_value=0
+pthread_notifywaiters: pjoin=0x805f660
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_join: exit_value=0x0
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f570
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x805f660
+free: Freeing 805f660
+pthread_join: Returning 0
+kill: TCB=0x0805f420 signo=9
+sig_received: sig_received: TCB=0x0805f420 signo=9 code=0 value=0 mask=00000000
+up_unblock_task: Unblocking TCB=805f420
+up_release_pending: From TCB=8061570
+up_release_pending: New Active Task TCB=805f420
+up_release_pending: Delivering signals TCB=805f420
+free: Freeing 805f530
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=14 exit_value=0
+pthread_notifywaiters: pjoin=0x805f510
+_exit: TCB=805f420 exitting
+free: Freeing 8064700
+free: Freeing 805f420
+_exit: New Active Task TCB=8061570
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f570
+_exit: TCB=805f570 exitting
+free: Freeing 8068710
+free: Freeing 805f570
+_exit: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_join: thread=14
+pthread_join: Thread has terminated
+pthread_join: exit_value=0x0
+pthread_destroyjoin: pjoin=0x805f510
+free: Freeing 805f510
+pthread_join: Returning 0
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+_thread: mq_receive succeeded on msg 4
+sender_thread: mq_send succeeded on msg 4
+receiver_thread: mq_receive succeeded on msg 5
+sender_thread: mq_send succeeded on msg 5
+receiver_thread: mq_receive succeeded on msg 6
+sender_thread: mq_send succeeded on msg 6
+receiver_thread: mq_receive succeeded on msg 7
+sender_thread: mq_send succeeded on msg 7
+receiver_thread: mq_receive succeeded on msg 8
+sender_thread: mq_send succeeded on msg 8
+receiver_thread: mq_receive succeeded on msg 9
+sender_thread: mq_send succeeded on msg 9
+sender_thread: returning nerrors=0
+mqueue_test: Killing receiver
+receiver_thread: mq_receive interrupted!
+receiver_thread: returning nerrors=0
+mqueue_test: Canceling receiver
+mqueue_test: receiver has already terminated
+
+End of test memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 5370 5370
+fordblks 3fac90 3fac90
+
+user_main: timed message queue test
+timedmqueue_test: Starting pthread_attr_init: attr=0x8064600
+pthread_attr_init: Returning 0
+pthread_attr_setstacksize: attr=0x8064600 stacksize=16384
+pthread_attr_setstacksize: Returning 0
+malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 8064700
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+malloc: Allocated 805f530
+clock_gettime: clock_id=0
+clock_gettime: msecs = 5110 g_tickbias=0
+clock_gettime: secs = 5110 + 1172534400 nsecs = 110000000 + 0
+clock_gettime: Returning tp=(1172534405,110000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 5110 g_tickbias=0
+clock_gettime: secs = 5110 + 1172534400 nsecs = 110000000 + 0
+clock_gettime: Returning tp=(1172534405,110000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 5110 g_tickbias=0
+clock_gettime: secs = 5110 + 1172534400 nsecs = 110000000 + 0
+clock_gettime: Returning tp=(1172534405,110000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 5110 g_tickbias=0
+clock_gettime: secs = 5110 + 1172534400 nsecs = 110000000 + 0
+clock_gettime: Returning tp=(1172534405,110000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 5110 g_tickbias=0
+clock_gettime: secs = 5110 + 1172534400 nsecs = 110000000 + 0
+clock_gettime: Returning tp=(1172534405,110000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 5110 g_tickbias=0
+clock_gettime: secs = 5110 + 1172534400 nsecs = 110000000 + 0
+clock_gettime: Returning tp=(1172534405,110000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 5110 g_tickbias=0
+clock_gettime: secs = 5110 + 1172534400 nsecs = 110000000 + 0
+clock_gettime: Returning tp=(1172534405,110000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 5110 g_tickbias=0
+clock_gettime: secs = 5110 + 1172534400 nsecs = 110000000 + 0
+clock_gettime: Returning tp=(1172534405,110000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 5110 g_tickbias=0
+clock_gettime: secs = 5110 + 1172534400 nsecs = 110000000 + 0
+clock_gettime: Returning tp=(1172534405,110000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 5110 g_tickbias=0
+clock_gettime: secs = 5110 + 1172534400 nsecs = 110000000 + 0
+clock_gettime: Returning tp=(1172534405,110000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 5110 g_tickbias=0
+clock_gettime: secs = 5110 + 1172534400 nsecs = 110000000 + 0
+clock_gettime: Returning tp=(1172534405,110000000)
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_join: thread=16
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+sender
+sender_thread: Starting
+sender_thread: mq_timedsend succeeded on msg 0
+sender_thread: mq_timedsend succeeded on msg 1
+sender_thread: mq_timedsend succeeded on msg 2
+sender_thread: mq_timedsend succeeded on msg 3
+sender_thread: mq_timedsend succeeded on msg 4
+sender_thread: mq_timedsend succeeded on msg 5
+sender_thread: mq_timedsend succeeded on msg 6
+sender_thread: mq_timedsend succeeded on msg 7
+sender_thread: mq_timedsend succeeded on msg 8
+timedmqueue_test: Waiting for sender to complete
+sender_thread: mq_timedsend 9 timed out as expected
+sender_thread: returning nerrors=0
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=16 exit_value=0
+pthread_notifywaiters: pjoin=0x805f510
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_join: exit_value=0x0
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=805f420 exitting
+free: Freeing 8064700
+free: Freeing 805f420
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x805f510
+free: Freeing 805f510
+pthread_join: Returning 0
+pthread_attr_init: attr=0x8064600
+pthread_attr_init: Returning 0
+pthread_attr_setstacksize: attr=0x8064600 stacksize=16384
+pthread_attr_setstacksize: Returning 0
+malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 8064700
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+clock_gettime: clock_id=0
+clock_gettime: msecs = 10120 g_tickbias=0
+clock_gettime: secs = 10120 + 1172534400 nsecs = 120000000 + 0
+clock_gettime: Returning tp=(1172534410,120000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 10120 g_tickbias=0
+clock_gettime: secs = 10120 + 1172534400 nsecs = 120000000 + 0
+clock_gettime: Returning tp=(1172534410,120000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 10120 g_tickbias=0
+clock_gettime: secs = 10120 + 1172534400 nsecs = 120000000 + 0
+clock_gettime: Returning tp=(1172534410,120000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 10120 g_tickbias=0
+clock_gettime: secs = 10120 + 1172534400 nsecs = 120000000 + 0
+clock_gettime: Returning tp=(1172534410,120000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 10120 g_tickbias=0
+clock_gettime: secs = 10120 + 1172534400 nsecs = 120000000 + 0
+clock_gettime: Returning tp=(1172534410,120000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 10120 g_tickbias=0
+clock_gettime: secs = 10120 + 1172534400 nsecs = 120000000 + 0
+clock_gettime: Returning tp=(1172534410,120000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 10120 g_tickbias=0
+clock_gettime: secs = 10120 + 1172534400 nsecs = 120000000 + 0
+clock_gettime: Returning tp=(1172534410,120000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 10120 g_tickbias=0
+clock_gettime: secs = 10120 + 1172534400 nsecs = 120000000 + 0
+clock_gettime: Returning tp=(1172534410,120000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 10120 g_tickbias=0
+clock_gettime: secs = 10120 + 1172534400 nsecs = 120000000 + 0
+clock_gettime: Returning tp=(1172534410,120000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 10120 g_tickbias=0
+clock_gettime: secs = 10120 + 1172534400 nsecs = 120000000 + 0
+clock_gettime: Returning tp=(1172534410,120000000)
+clock_gettime: clock_id=0
+clock_gettime: msecs = 10120 g_tickbias=0
+clock_gettime: secs = 10120 + 1172534400 nsecs = 120000000 + 0
+clock_gettime: Returning tp=(1172534410,120000000)
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_join: thread=17
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+free: Freeing 805f530
+timedmqueue_test: Starting receiver
+receiver_thread: Starting
+receiver_thread: mq_timedreceive succeeded on msg 0
+receiver_thread: mq_timedreceive succeeded on msg 1
+receiver_thread: mq_timedreceive succeeded on msg 2
+receiver_thread: mq_timedreceive succeeded on msg 3
+receiver_thread: mq_timedreceive succeeded on msg 4
+receiver_thread: mq_timedreceive succeeded on msg 5
+receiver_thread: mq_timedreceive succeeded on msg 6
+receiver_thread: mq_timedreceive succeeded on msg 7
+receiver_thread: mq_timedreceive succeeded on msg 8
+timedmqueue_test: Waiting for sender to complete
+receiver_thread: Receive 9 timed out as expected
+receiver_thread: returning nerrors=0
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=17 exit_value=0
+pthread_notifywaiters: pjoin=0x805f510
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_join: exit_value=0x0
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=805f420 exitting
+free: Freeing 8064700
+free: Freeing 805f420
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x805f510
+free: Freeing 805f510
+pthread_join: Returning 0
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 805f6a0
+malloc: Allocated 805f930
+malloc: Allocated 805fd40
+malloc: Allocated 8060150
+malloc: Allocated 8064700
+up_unblock_task: Unblocking TCB=805f420
+timedmqueue_test: Test complete
+
+End of test memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 5370 5370
+fordblks 3fac90 3fac90
+
+user_main: signal handler test
+sighand_test: Initializing semaphore to 0
+sighand_test: Starting waiter task
+sighand_test: Started waiter_main pid=18
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+waiter_main: Waiter started
+waiter_main: Unmasking signal 17
+waiter_main: Registering signal handler
+waiter_main: oact.sigaction=0 oact.sa_flags=0 oact.sa_mask=0
+waiter_main: Waiting on semaphore
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+sigqueue: TCB=0x0805f420 signo=17 value=42
+sig_received: sig_received: TCB=0x0805f420 signo=17 code=1 value=42 mask=00000000
+up_unblock_task: Unblocking TCB=805f420
+sighand_test: Signaling pid=18 with signo=17 sigvalue=42
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_block_task: Delivering signals TCB=805f420
+sig_deliver: sig_deliver: Sending signal sigq=0x805d660
+wakeup_action: Received signal 17
+wakeup_action: sival_int=42
+wakeup_action: si_code=1
+wakeup_action: ucontext=0
+waiter_main: sem_wait() successfully interrupted by signal
+waiter_main: done
+_exit: TCB=805f420 exitting
+free: Freeing 8064700
+free: Freeing 805f510
+free: Freeing 805f930
+free: Freeing 805fd40
+free: Freeing 8060150
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 805f6a0
+free: Freeing 805f420
+_exit: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+sighand_test: done
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+
+End of test memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 5370 5370
+fordblks 3fac90 3fac90
+
+user_main: POSIX timer test
+timer_test: Initializing semaphore to 0
+timer_test: Unmasking signal 17
+timer_test: Registering signal handler
+timer_test: oact.sigaction=0 oact.sa_flags=0 oact.sa_mask=0
+timer_test: Creating timer
+timer_test: Starting timer
+timer_test: Waiting on semaphore
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+sig_received: sig_received: TCB=0x08061570 signo=17 code=2 value=42 mask=00000000
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+up_unblock_task: Delivering signals TCB=8061570
+sig_deliver: sig_deliver: Sending signal sigq=0x805d678
+timer_expiration: Received signal 17
+timer_expiration: sival_int=42
+timer_expiration: si_code=2 (SI_TIMER)
+timer_expiration: ucontext=0
+timer_test: sem_wait() successfully interrupted by signal
+timer_test: g_nsigreceived=1
+timer_test: Waiting on semaphore
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+sig_received: sig_received: TCB=0x08061570 signo=17 code=2 value=42 mask=00000000
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+up_unblock_task: Delivering signals TCB=8061570
+sig_deliver: sig_deliver: Sending signal sigq=0x805d690
+timer_expiration: Received signal 17
+timer_expiration: sival_int=42
+timer_expiration: si_code=2 (SI_TIMER)
+timer_expiration: ucontext=0
+timer_test: sem_wait() successfully interrupted by signal
+timer_test: g_nsigreceived=2
+timer_test: Waiting on semaphore
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+sig_received: sig_received: TCB=0x08061570 signo=17 code=2 value=42 mask=00000000
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+up_unblock_task: Delivering signals TCB=8061570
+sig_deliver: sig_deliver: Sending signal sigq=0x805d6a8
+timer_expiration: Received signal 17
+timer_expiration: sival_int=42
+timer_expiration: si_code=2 (SI_TIMER)
+timer_expiration: ucontext=0
+timer_test: sem_wait() successfully interrupted by signal
+timer_test: g_nsigreceived=3
+timer_test: Waiting on semaphore
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+sig_received: sig_received: TCB=0x08061570 signo=17 code=2 value=42 mask=00000000
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+up_unblock_task: Delivering signals TCB=8061570
+sig_deliver: sig_deliver: Sending signal sigq=0x805d6c0
+timer_expiration: Received signal 17
+timer_expiration: sival_int=42
+timer_expiration: si_code=2 (SI_TIMER)
+timer_expiration: ucontext=0
+timer_test: sem_wait() successfully interrupted by signal
+timer_test: g_nsigreceived=4
+timer_test: Waiting on semaphore
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+sig_received: sig_received: TCB=0x08061570 signo=17 code=2 value=42 mask=00000000
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+up_unblock_task: Delivering signals TCB=8061570
+sig_deliver: sig_deliver: Sending signal sigq=0x805d6d8
+timer_expiration: Received signal 17
+timer_expiration: sival_int=42
+timer_expiration: si_code=2 (SI_TIMER)
+timer_expiration: ucontext=0
+timer_test: sem_wait() successfully interrupted by signal
+timer_test: g_nsigreceived=5
+timer_test: Deleting timer
+timer_test: done
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+pthread_attr_init: attr=0x80645e4
+pthread_attr_init: Returning 0
+malloc: Allocated 805f420
+malloc: Allocated 805f510
+malloc: Allocated 805f530
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+malloc: Allocated 8064700
+malloc: Allocated 8061540
+malloc: Allocated 80647f0
+up_unblock_task: Unblocking TCB=8064700
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8064700
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=8061570
+malloc: Allocated 8066800
+malloc: Allocated 80668f0
+malloc: Allocated 8066910
+up_unblock_task: Unblocking TCB=8066800
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8066800
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=8066800
+up_block_task: New Active Task TCB=8061570
+malloc: Allocated 8068920
+malloc: Allocated 8068a10
+malloc: Allocated 8068a30
+up_unblock_task: Unblocking TCB=8068920
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8068920
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=8068920
+up_block_task: New Active Task TCB=8061570
+malloc: Allocated 806aa40
+malloc: Allocated 806ab30
+malloc: Allocated 806ab50
+up_unblock_task: Unblocking TCB=806aa40
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=806aa40
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=806aa40
+up_block_task: New Active Task TCB=8061570
+malloc: Allocated 806cb60
+malloc: Allocated 806cc50
+malloc: Allocated 806cc70
+up_unblock_task: Unblocking TCB=806cb60
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=806cb60
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=806cb60
+up_block_task: New Active Task TCB=8061570
+malloc: Allocated 806ec80
+malloc: Allocated 806ed70
+malloc: Allocated 806ed90
+up_unblock_task: Unblocking TCB=806ec80
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=806ec80
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=806ec80
+up_block_task: New Active Task TCB=8061570
+malloc: Allocated 8070da0
+malloc: Allocated 8070e90
+malloc: Allocated 8070eb0
+up_unblock_task: Unblocking TCB=8070da0
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8070da0
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=8070da0
+up_block_task: New Active Task TCB=8061570
+pthread_join: thread=19
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8064700
+up_unblock_task: New Active Task TCB=8064700
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8066800
+up_unblock_task: New Active Task TCB=8066800
+up_block_task: Blocking TCB=8066800
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8068920
+up_unblock_task: New Active Task TCB=8068920
+up_block_task: Blocking TCB=8068920
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=806aa40
+up_unblock_task: New Active Task TCB=806aa40
+
+End of test memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 5370 5370
+fordblks 3fac90 3fac90
+
+user_main: barrier test
+barrier_test: Initializing barrier
+barrier_func: Thread 0 started
+barrier_test: Thread 0 created
+barrier_func: Thread 1 started
+barrier_test: Thread 1 created
+barrier_func: Thread 2 started
+barrier_test: Thread 2 created
+barrier_func: Thread 3 started
+barrier_test: Thread 3 created
+barrier_func: Thread 4 started
+barrier_test: Thread 4 created
+barrier_func: Thread 5 started
+barrier_test: Thread 5 created
+barrier_func: Thread 6 started
+barrier_test: Thread 6 created
+barrier_func: Thread 7 started
+barrier_test: Thread 7 created
+barrier_func: Thread 0 calling pthread_barrier_wait()
+barrier_func: Thread 1 calling pthread_barrier_wait()
+barrier_func: Thread 2 calling pthread_barrier_wait()
+barrier_func: Thread 3 calling pthread_barrier_wait()
+barrier_func: Thread 4 calling pthreadup_block_task: Blocking TCB=806aa40
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=806cb60
+up_unblock_task: New Active Task TCB=806cb60
+up_block_task: Blocking TCB=806cb60
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=806ec80
+up_unblock_task: New Active Task TCB=806ec80
+up_block_task: Blocking TCB=806ec80
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8070da0
+up_unblock_task: New Active Task TCB=8070da0
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: Unblocking TCB=8064700
+up_unblock_task: Unblocking TCB=8066800
+up_unblock_task: Unblocking TCB=8068920
+up_unblock_task: Unblocking TCB=806aa40
+up_unblock_task: Unblocking TCB=806cb60
+up_unblock_task: Unblocking TCB=806ec80
+up_block_task: Blocking TCB=8070da0
+up_block_task: New Active Task TCB=805f420
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8064700
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=8066800
+up_block_task: Blocking TCB=8066800
+up_block_task: New Active Task TCB=8068920
+up_block_task: Blocking TCB=8068920
+up_block_task: New Active Task TCB=806aa40
+up_block_task: Blocking TCB=806aa40
+up_block_task: New Active Task TCB=806cb60
+up_block_task: Blocking TCB=806cb60
+up_block_task: New Active Task TCB=806ec80
+up_block_task: Blocking TCB=806ec80
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8070da0
+up_unblock_task: New Active Task TCB=8070da0
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=26 exit_value=0
+pthread_notifywaiters: pjoin=0x8070e90
+_exit: TCB=8070da0 exitting
+free: Freeing 8070eb0
+free: Freeing 8070da0
+_exit: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=805f420
+up_unblock_task: New Active Task TCB=805f420
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=19 exit_value=0
+pthread_notifywaiters: pjoin=0x805f510
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=805f420
+up_block_task: New Active Task TCB=8061570
+pthread_join: exit_value=0x0
+up_unblock_task: Unblocking TCB=805f420
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805f420
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=805f420 exitting
+free: Freeing 805f530
+free: Freeing 805f420
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x805f510
+free: Freeing 805f510
+pthread_join: Returning 0
+pthread_join: thread=20
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8064700
+up_unblock_task: New Active Task TCB=8064700
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=20 exit_value=0
+pthread_notifywaiters: pjoin=0x8061540
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=8064700
+up_block_task: New Active Task TCB=8061570
+pthread_join: exit_value=0x0
+up_unblock_task: Unblocking TCB=8064700
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8064700
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=8064700 exitting
+free: Freeing 80647f0
+free: Freeing 8064700
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x8061540
+free: Freeing 8061540
+pthread_join: Returning 0
+pthread_join: thread=21
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8066800
+up_unblock_task: New Active Task TCB=8066800
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=21 exit_value=0
+pthread_notifywaiters: pjoin=0x80668f0
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=8066800
+up_block_task: New Active Task TCB=8061570
+pthread_join: exit_value=0x0
+up_unblock_task: Unblocking TCB=8066800
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8066800
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=8066800 exitting
+free: Freeing 8066910
+free: Freeing 8066800
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x80668f0
+free: Freeing 80668f0
+pthread_join: Returning 0
+pthread_join: thread=22
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8068920
+up_unblock_task: New Active Task TCB=8068920
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=22 exit_value=0
+pthread_notifywaiters: pjoin=0x8068a10
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=8068920
+up_block_task: New Active Task TCB=8061570
+pthread_join: exit_value=0x0
+up_unblock_task: Unblocking TCB=8068920
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=8068920
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=8068920 exitting
+free: Freeing 8068a30
+free: Freeing 8068920
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x8068a10
+free: Freeing 8068a10
+pthread_join: Returning 0
+_barrier_wait()
+barrier_func: Thread 5 calling pthread_barrier_wait()
+barrier_func: Thread 6 calling pthread_barrier_wait()
+barrier_func: Thread 7 calling pthread_barrier_wait()
+barrier_func: Thread 7, back with status=PTHREAD_BARRIER_SERIAL_THREAD (I AM SPECIAL)
+barrier_func: Thread 0, back with status=0 (I am not special)
+barrier_func: Thread 1, back with status=0 (I am not special)
+barrier_func: Thread 2, back with status=0 (I am not special)
+barrier_func: Thread 3, back with status=0 (I am not special)
+barrier_func: Thread 4, back with status=0 (I am not special)
+barrier_func: Thread 5, back with status=0 (I am not special)
+barrier_func: Thread 6, back with status=0 (I am not special)
+barrier_func: Thread 7 done
+barrier_func: Thread 0 done
+barrier_test: Thread 0 completed with result=0
+barrier_func: Thread 1 done
+barrier_test: Thread 1 completed with result=0
+barrier_func: Thread 2 done
+barrier_test: Thread 2 completed with result=0
+barrier_func: Thread 3 done
+barrier_test: Thread 3 completed with result=pthread_join: thread=23
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=806aa40
+up_unblock_task: New Active Task TCB=806aa40
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=23 exit_value=0
+pthread_notifywaiters: pjoin=0x806ab30
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=806aa40
+up_block_task: New Active Task TCB=8061570
+pthread_join: exit_value=0x0
+up_unblock_task: Unblocking TCB=806aa40
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=806aa40
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=806aa40 exitting
+free: Freeing 806ab50
+free: Freeing 806aa40
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x806ab30
+free: Freeing 806ab30
+pthread_join: Returning 0
+pthread_join: thread=24
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=806cb60
+up_unblock_task: New Active Task TCB=806cb60
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=24 exit_value=0
+pthread_notifywaiters: pjoin=0x806cc50
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=806cb60
+up_block_task: New Active Task TCB=8061570
+pthread_join: exit_value=0x0
+up_unblock_task: Unblocking TCB=806cb60
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=806cb60
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=806cb60 exitting
+free: Freeing 806cc70
+free: Freeing 806cb60
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x806cc50
+free: Freeing 806cc50
+pthread_join: Returning 0
+pthread_join: thread=25
+pthread_join: Thread is still running
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=806ec80
+up_unblock_task: New Active Task TCB=806ec80
+pthread_exit: exit_value=0
+pthread_completejoin: process_id=25 exit_value=0
+pthread_notifywaiters: pjoin=0x806ed70
+up_unblock_task: Unblocking TCB=8061570
+up_block_task: Blocking TCB=806ec80
+up_block_task: New Active Task TCB=8061570
+pthread_join: exit_value=0x0
+up_unblock_task: Unblocking TCB=806ec80
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=806ec80
+up_unblock_task: Unblocking TCB=8061570
+_exit: TCB=806ec80 exitting
+free: Freeing 806ed90
+free: Freeing 806ec80
+_exit: New Active Task TCB=8061570
+pthread_destroyjoin: pjoin=0x806ed70
+free: Freeing 806ed70
+pthread_join: Returning 0
+pthread_join: thread=26
+pthread_join: Thread has terminated
+pthread_join: exit_value=0x0
+pthread_destroyjoin: pjoin=0x8070e90
+free: Freeing 8070e90
+pthread_join: Returning 0
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+up_block_task: Blocking TCB=8061570
+up_block_task: New Active Task TCB=805d140
+up_unblock_task: Unblocking TCB=8061570
+up_unblock_task: New Active Task TCB=8061570
+0
+barrier_func: Thread 4 done
+barrier_test: Thread 4 completed with result=0
+barrier_func: Thread 5 done
+barrier_test: Thread 5 completed with result=0
+barrier_func: Thread 6 done
+barrier_test: Thread 6 completed with result=0
+barrier_test: Thread 7 completed with result=0
+
+End of test memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 5370 5370
+fordblks 3fac90 3fac90
+
+Final memory usage:
+VARIABLE BEFORE AFTER
+======== ======== ========
+arena 400000 400000
+ordblks 2 2
+mxordblk 3f8b40 3f8b40
+uordblks 5370 5370
+fordblks 3fac90 3fac90
+user_main: Exitting
+_exit: TCB=8061570 exitting
+free: Freeing 80626b0
+free: Freeing 80646c0
+free: Freeing 80646d0
+free: Freeing 80646e0
+free: Freeing 80646f0
+free: Freeing 8061660
+free: Freeing 8061a80
+free: Freeing 8061e90
+free: Freeing 80622a0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 0
+free: Freeing 80617f0
+free: Freeing 8061570
+_exit: New Active Task TCB=805d140
diff --git a/nuttx/configs/sim/include/README.txt b/nuttx/configs/sim/include/README.txt
new file mode 100644
index 000000000..f80744904
--- /dev/null
+++ b/nuttx/configs/sim/include/README.txt
@@ -0,0 +1 @@
+This directory contains header files unique to the Linux user-mode platform.
diff --git a/nuttx/configs/sim/mount/Make.defs b/nuttx/configs/sim/mount/Make.defs
new file mode 100644
index 000000000..498291077
--- /dev/null
+++ b/nuttx/configs/sim/mount/Make.defs
@@ -0,0 +1,121 @@
+############################################################################
+# configs/sim/mount/Make.defs
+#
+# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+
+HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ ARCHOPTIMIZATION = -g
+else
+ ARCHOPTIMIZATION = -O2
+endif
+
+ARCHCPUFLAGS = -fno-builtin
+ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
+ARCHPICFLAGS = -fpic
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
+ARCHDEFINES =
+ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ARCHSCRIPT =
+
+CROSSDEV =
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+OBJEXT = .o
+LIBEXT = .a
+
+ifeq ($(HOSTOS),Cygwin)
+ EXEEXT = .exe
+else
+ EXEEXT =
+endif
+
+ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
+ LDFLAGS += -g
+endif
+
+define PREPROCESS
+ @echo "CPP: $1->$2"
+ @$(CPP) $(CPPFLAGS) $1 -o $2
+endef
+
+define COMPILE
+ @echo "CC: $1"
+ @$(CC) -c $(CFLAGS) $1 -o $2
+endef
+
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
+define ASSEMBLE
+ @echo "AS: $1"
+ @$(CC) -c $(AFLAGS) $1 -o $2
+endef
+
+define ARCHIVE
+ echo "AR: $2"; \
+ $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
+endef
+
+define CLEAN
+ @rm -f *.o *.a
+endef
+
+MKDEP = $(TOPDIR)/tools/mkdeps.sh
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+HOSTLDFLAGS =
diff --git a/nuttx/configs/sim/mount/appconfig b/nuttx/configs/sim/mount/appconfig
new file mode 100644
index 000000000..47fb2cabc
--- /dev/null
+++ b/nuttx/configs/sim/mount/appconfig
@@ -0,0 +1,39 @@
+############################################################################
+# configs/sim/mount/appconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+# Path to example in apps/examples containing the user_start entry point
+
+CONFIGURED_APPS += examples/mount
+
diff --git a/nuttx/configs/sim/mount/defconfig b/nuttx/configs/sim/mount/defconfig
new file mode 100644
index 000000000..ee37111d4
--- /dev/null
+++ b/nuttx/configs/sim/mount/defconfig
@@ -0,0 +1,389 @@
+############################################################################
+# sim/mount/defconfig
+#
+# Copyright (C) 2008-2010 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+#
+# Architecture selection
+#
+# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
+# processor architecture.
+# CONFIG_ARCH_name - for use in C code. This identifies the particular
+# processor architecture (CONFIG_ARCH_SIM).
+# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
+# the board that supports the particular chip or SoC.
+# CONFIG_ARCH_BOARD_name - for use in C code
+# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
+#
+CONFIG_ARCH=sim
+CONFIG_ARCH_SIM=y
+CONFIG_ARCH_BOARD=sim
+CONFIG_ARCH_BOARD_SIM=y
+
+#
+# General OS setup
+#
+# CONFIG_APPS_DIR - Identifies the relative path to the directory
+# that builds the application to link with NuttX. Default: ../apps
+# CONFIG_DEBUG - enables built-in debug options
+# CONFIG_DEBUG_VERBOSE - enables verbose debug output
+# CONFIG_DEBUG_SYMBOLS - build without optimization and with
+# debug symbols (needed for use with a debugger).
+# CONFIG_MM_REGIONS - If the architecture includes multiple
+# regions of memory to allocate from, this specifies the
+# number of memory regions that the memory manager must
+# handle and enables the API mm_addregion(start, end);
+# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
+# time console output
+# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz
+# or MSEC_PER_TICK=10. This setting may be defined to
+# inform NuttX that the processor hardware is providing
+# system timer interrupts at some interrupt interval other
+# than 10 msec.
+# CONFIG_RR_INTERVAL - The round robin timeslice will be set
+# this number of milliseconds; Round robin scheduling can
+# be disabled by setting this value to zero.
+# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
+# scheduler to monitor system performance
+# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
+# task name to save in the TCB. Useful if scheduler
+# instrumentation is selected. Set to zero to disable.
+# CONFIG_JULIAN_TIME - Enables Julian time conversions
+# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
+# Used to initialize the internal time logic.
+# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
+# provides /dev/console. Enables stdout, stderr, stdin.
+# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
+# driver (minimul support)
+# CONFIG_MUTEX_TYPES: Set to enable support for recursive and
+# errorcheck mutexes. Enables pthread_mutexattr_settype().
+# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority
+# inheritance on mutexes and semaphores.
+# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
+# inheritance is enabled. It defines the maximum number of
+# different threads (minus one) that can take counts on a
+# semaphore with priority inheritance support. This may be
+# set to zero if priority inheritance is disabled OR if you
+# are only using semaphores as mutexes (only one holder) OR
+# if no more than two threads participate using a counting
+# semaphore.
+# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled,
+# then this setting is the maximum number of higher priority
+# threads (minus 1) than can be waiting for another thread
+# to release a count on a semaphore. This value may be set
+# to zero if no more than one thread is expected to wait for
+# a semaphore.
+# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors
+# by task_create() when a new task is started. If set, all
+# files/drivers will appear to be closed in the new task.
+# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first
+# three file descriptors (stdin, stdout, stderr) by task_create()
+# when a new task is started. If set, all files/drivers will
+# appear to be closed in the new task except for stdin, stdout,
+# and stderr.
+# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket
+# desciptors by task_create() when a new task is started. If
+# set, all sockets will appear to be closed in the new task.
+#
+#CONFIG_APPS_DIR=
+CONFIG_DEBUG=y
+CONFIG_DEBUG_VERBOSE=y
+CONFIG_DEBUG_SYMBOLS=n
+CONFIG_MM_REGIONS=1
+CONFIG_ARCH_LOWPUTC=y
+CONFIG_RR_INTERVAL=0
+CONFIG_SCHED_INSTRUMENTATION=n
+CONFIG_TASK_NAME_SIZE=32
+CONFIG_START_YEAR=2008
+CONFIG_START_MONTH=6
+CONFIG_START_DAY=1
+CONFIG_JULIAN_TIME=n
+CONFIG_DEV_CONSOLE=y
+CONFIG_DEV_LOWCONSOLE=n
+CONFIG_MUTEX_TYPES=n
+CONFIG_PRIORITY_INHERITANCE=n
+CONFIG_SEM_PREALLOCHOLDERS=0
+CONFIG_SEM_NNESTPRIO=0
+CONFIG_FDCLONE_DISABLE=n
+CONFIG_FDCLONE_STDIO=n
+CONFIG_SDCLONE_DISABLE=y
+
+#
+# The following can be used to disable categories of
+# APIs supported by the OS. If the compiler supports
+# weak functions, then it should not be necessary to
+# disable functions unless you want to restrict usage
+# of those APIs.
+#
+# There are certain dependency relationships in these
+# features.
+#
+# o mq_notify logic depends on signals to awaken tasks
+# waiting for queues to become full or empty.
+# o pthread_condtimedwait() depends on signals to wake
+# up waiting tasks.
+#
+CONFIG_DISABLE_CLOCK=n
+CONFIG_DISABLE_POSIX_TIMERS=n
+CONFIG_DISABLE_PTHREAD=n
+CONFIG_DISABLE_SIGNALS=n
+CONFIG_DISABLE_MQUEUE=n
+CONFIG_DISABLE_MOUNTPOINT=n
+CONFIG_DISABLE_ENVIRON=n
+CONFIG_DISABLE_POLL=y
+
+#
+# Misc libc settings
+#
+# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
+# little smaller if we do not support fieldwidthes
+#
+CONFIG_NOPRINTF_FIELDWIDTH=n
+
+#
+# Allow for architecture optimized implementations
+#
+# The architecture can provide optimized versions of the
+# following to improve sysem performance
+#
+CONFIG_ARCH_MEMCPY=n
+CONFIG_ARCH_MEMCMP=n
+CONFIG_ARCH_MEMMOVE=n
+CONFIG_ARCH_MEMSET=n
+CONFIG_ARCH_STRCMP=n
+CONFIG_ARCH_STRCPY=n
+CONFIG_ARCH_STRNCPY=n
+CONFIG_ARCH_STRLEN=n
+CONFIG_ARCH_STRNLEN=n
+CONFIG_ARCH_BZERO=n
+
+#
+# General build options
+#
+# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
+# BSPs from www.ridgerun.com using the tools/mkimage.sh script
+# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format
+# used with many different loaders using the GNU objcopy program
+# Should not be selected if you are not using the GNU toolchain.
+# CONFIG_RAW_BINARY - make a raw binary format file used with many
+# different loaders using the GNU objcopy program. This option
+# should not be selected if you are not using the GNU toolchain.
+# CONFIG_HAVE_LIBM - toolchain supports libm.a
+#
+CONFIG_RRLOAD_BINARY=n
+CONFIG_INTELHEX_BINARY=n
+CONFIG_RAW_BINARY=n
+CONFIG_HAVE_LIBM=y
+
+#
+# Sizes of configurable things (0 disables)
+#
+# CONFIG_MAX_TASKS - The maximum number of simultaneously
+# active tasks. This value must be a power of two.
+# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
+# of parameters that a task may receive (i.e., maxmum value
+# of 'argc')
+# CONFIG_NPTHREAD_KEYS - The number of items of thread-
+# specific data that can be retained
+# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
+# descriptors (one for each open)
+# CONFIG_NFILE_STREAMS - The maximum number of streams that
+# can be fopen'ed
+# CONFIG_NAME_MAX - The maximum size of a file name.
+# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
+# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_NUNGET_CHARS - Number of characters that can be
+# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
+# structures. The system manages a pool of preallocated
+# message structures to minimize dynamic allocations
+# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
+# a fixed payload size given by this settin (does not include
+# other message structure overhead.
+# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
+# can be passed to a watchdog handler
+# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
+# structures. The system manages a pool of preallocated
+# watchdog structures to minimize dynamic allocations
+# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
+# timer structures. The system manages a pool of preallocated
+# timer structures to minimize dynamic allocations. Set to
+# zero for all dynamic allocations.
+#
+CONFIG_MAX_TASKS=64
+CONFIG_MAX_TASK_ARGS=4
+CONFIG_NPTHREAD_KEYS=4
+CONFIG_NFILE_DESCRIPTORS=32
+CONFIG_NFILE_STREAMS=16
+CONFIG_NAME_MAX=32
+CONFIG_STDIO_BUFFER_SIZE=1024
+CONFIG_NUNGET_CHARS=2
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_MQ_MAXMSGSIZE=32
+CONFIG_MAX_WDOGPARMS=4
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_PREALLOC_TIMERS=8
+
+#
+# FAT filesystem configuration
+# CONFIG_FS_FAT - Enable FAT filesystem support
+# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
+CONFIG_FS_FAT=y
+CONFIG_FS_ROMFS=n
+
+#
+# TCP/IP and UDP support via uIP
+# CONFIG_NET - Enable or disable all network features
+# CONFIG_NET_IPv6 - Build in support for IPv6
+# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
+# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
+# CONFIG_NET_BUFSIZE - uIP buffer size
+# CONFIG_NET_TCP - TCP support on or off
+# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
+# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
+# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
+# CONFIG_NET_TCPBACKLOG - Incoming connections pend in a backlog until
+# accept() is called. The size of the backlog is selected when listen() is called.
+# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
+# CONFIG_NET_UDP - UDP support on or off
+# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
+# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
+# CONFIG_NET_ICMP - ICMP ping response support on or off
+# CONFIG_NET_ICMP_PING - ICMP ping request support on or off
+# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
+# CONFIG_NET_STATISTICS - uIP statistics on or off
+# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
+# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
+# CONFIG_NET_BROADCAST - Broadcast support
+# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
+#
+CONFIG_NET=n
+CONFIG_NET_IPv6=n
+CONFIG_NSOCKET_DESCRIPTORS=0
+CONFIG_NET_SOCKOPTS=y
+CONFIG_NET_BUFSIZE=420
+CONFIG_NET_TCP=n
+CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_UDP=n
+CONFIG_NET_UDP_CHECKSUMS=y
+#CONFIG_NET_UDP_CONNS=10
+CONFIG_NET_ICMP=n
+CONFIG_NET_ICMP_PING=n
+#CONFIG_NET_PINGADDRCONF=0
+CONFIG_NET_STATISTICS=y
+#CONFIG_NET_RECEIVE_WINDOW=
+#CONFIG_NET_ARPTAB_SIZE=8
+CONFIG_NET_BROADCAST=n
+#CONFIG_NET_FWCACHE_SIZE=2
+
+#
+# UIP Network Utilities
+# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
+# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
+CONFIG_NET_DHCP_LIGHT=n
+CONFIG_NET_RESOLV_ENTRIES=4
+
+#
+# Settings for examples/uip
+CONFIG_EXAMPLE_UIP_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_UIP_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_UIP_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_UIP_DHCPC=n
+
+#
+# Settings for examples/nettest
+CONFIG_EXAMPLE_NETTEST_SERVER=n
+CONFIG_EXAMPLE_NETTEST_PERFORMANCE=n
+CONFIG_EXAMPLE_NETTEST_NOMAC=n
+CONFIG_EXAMPLE_NETTEST_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
+
+#
+# Settings for examples/ostest
+CONFIG_EXAMPLES_OSTEST_LOOPS=100
+CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
+
+#
+# Settings for apps/nshlib
+CONFIG_NSH_CONSOLE=y
+CONFIG_NSH_TELNET=n
+CONFIG_NSH_IOBUFFER_SIZE=512
+CONFIG_NSH_CMD_SIZE=40
+CONFIG_NSH_STACKSIZE=4096
+CONFIG_NSH_DHCPC=n
+CONFIG_NSH_NOMAC=n
+CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
+CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
+CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
+
+#
+# Settings for examples/mount
+CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
+#CONFIG_EXAMPLES_MOUNT_NSECTORS=2048
+#CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512
+#CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1
+
+#
+# Stack and heap information
+#
+# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
+# operation from FLASH but must copy initialized .data sections to RAM.
+# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
+# but copy themselves entirely into RAM for better performance.
+# CONFIG_CUSTOM_STACK - The up_ implementation will handle
+# all stack operations outside of the nuttx model.
+# CONFIG_STACK_POINTER - The initial stack pointer
+# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack.
+# This is the thread that (1) performs the inital boot of the system up
+# to the point where user_start() is spawned, and (2) there after is the
+# IDLE thread that executes only when there is no other thread ready to
+# run.
+# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate
+# for the main user thread that begins at the user_start() entry point.
+# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
+# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
+# CONFIG_HEAP_BASE - The beginning of the heap
+# CONFIG_HEAP_SIZE - The size of the heap
+#
+CONFIG_BOOT_RUNFROMFLASH=n
+CONFIG_BOOT_COPYTORAM=n
+CONFIG_CUSTOM_STACK=n
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_USERMAIN_STACKSIZE=4096
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=8192
+CONFIG_HEAP_BASE=
+CONFIG_HEAP_SIZE=
diff --git a/nuttx/configs/sim/mount/setenv.sh b/nuttx/configs/sim/mount/setenv.sh
new file mode 100755
index 000000000..cb28f8df7
--- /dev/null
+++ b/nuttx/configs/sim/mount/setenv.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# sim/setenv.sh
+#
+# Copyright (C) 2008 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+if [ "$(basename $0)" = "setenv.sh" ] ; then
+ echo "You must source this script, not run it!" 1>&2
+ exit 1
+fi
+
+if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
+
+#export NUTTX_BIN=
+#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
+
+echo "PATH : ${PATH}"
diff --git a/nuttx/configs/sim/nettest/Make.defs b/nuttx/configs/sim/nettest/Make.defs
new file mode 100644
index 000000000..cf0134b9b
--- /dev/null
+++ b/nuttx/configs/sim/nettest/Make.defs
@@ -0,0 +1,121 @@
+############################################################################
+# configs/sim/Make.defs
+#
+# Copyright (C) 2007-2008, 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+
+HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ ARCHOPTIMIZATION = -g
+else
+ ARCHOPTIMIZATION = -O2
+endif
+
+ARCHCPUFLAGS = -fno-builtin
+ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
+ARCHPICFLAGS = -fpic
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
+ARCHDEFINES =
+ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ARCHSCRIPT =
+
+CROSSDEV =
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+OBJEXT = .o
+LIBEXT = .a
+
+ifeq ($(HOSTOS),Cygwin)
+ EXEEXT = .exe
+else
+ EXEEXT =
+endif
+
+ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
+ LDFLAGS += -g
+endif
+
+define PREPROCESS
+ @echo "CPP: $1->$2"
+ @$(CPP) $(CPPFLAGS) $1 -o $2
+endef
+
+define COMPILE
+ @echo "CC: $1"
+ @$(CC) -c $(CFLAGS) $1 -o $2
+endef
+
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
+define ASSEMBLE
+ @echo "AS: $1"
+ @$(CC) -c $(AFLAGS) $1 -o $2
+endef
+
+define ARCHIVE
+ echo "AR: $2"; \
+ $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
+endef
+
+define CLEAN
+ @rm -f *.o *.a
+endef
+
+MKDEP = $(TOPDIR)/tools/mkdeps.sh
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+HOSTLDFLAGS =
diff --git a/nuttx/configs/sim/nettest/appconfig b/nuttx/configs/sim/nettest/appconfig
new file mode 100644
index 000000000..a123273d7
--- /dev/null
+++ b/nuttx/configs/sim/nettest/appconfig
@@ -0,0 +1,43 @@
+############################################################################
+# configs/sim/nettest/appconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+# Path to example in apps/examples containing the user_start entry point
+
+CONFIGURED_APPS += examples/nettest
+
+
+# Networking support
+
+CONFIGURED_APPS += netutils/uiplib
diff --git a/nuttx/configs/sim/nettest/defconfig b/nuttx/configs/sim/nettest/defconfig
new file mode 100644
index 000000000..bb00f3f59
--- /dev/null
+++ b/nuttx/configs/sim/nettest/defconfig
@@ -0,0 +1,388 @@
+############################################################################
+# configs/sim/nettest/defconfig
+#
+# Copyright (C) 2007-2010 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+#
+# Architecture selection
+#
+# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
+# processor architecture.
+# CONFIG_ARCH_name - for use in C code. This identifies the particular
+# processor architecture (CONFIG_ARCH_SIM).
+# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
+# the board that supports the particular chip or SoC.
+# CONFIG_ARCH_BOARD_name - for use in C code
+# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
+#
+CONFIG_ARCH=sim
+CONFIG_ARCH_SIM=y
+CONFIG_ARCH_BOARD=sim
+CONFIG_ARCH_BOARD_SIM=y
+
+#
+# General OS setup
+#
+# CONFIG_APPS_DIR - Identifies the relative path to the directory
+# that builds the application to link with NuttX. Default: ../apps
+# CONFIG_DEBUG - enables built-in debug options
+# CONFIG_DEBUG_VERBOSE - enables verbose debug output
+# CONFIG_DEBUG_SYMBOLS - build without optimization and with
+# debug symbols (needed for use with a debugger).
+# CONFIG_MM_REGIONS - If the architecture includes multiple
+# regions of memory to allocate from, this specifies the
+# number of memory regions that the memory manager must
+# handle and enables the API mm_addregion(start, end);
+# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
+# time console output
+# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz
+# or MSEC_PER_TICK=10. This setting may be defined to
+# inform NuttX that the processor hardware is providing
+# system timer interrupts at some interrupt interval other
+# than 10 msec.
+# CONFIG_RR_INTERVAL - The round robin timeslice will be set
+# this number of milliseconds; Round robin scheduling can
+# be disabled by setting this value to zero.
+# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
+# scheduler to monitor system performance
+# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
+# task name to save in the TCB. Useful if scheduler
+# instrumentation is selected. Set to zero to disable.
+# CONFIG_JULIAN_TIME - Enables Julian time conversions
+# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
+# Used to initialize the internal time logic.
+# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
+# provides /dev/console. Enables stdout, stderr, stdin.
+# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
+# driver (minimul support)
+# CONFIG_MUTEX_TYPES: Set to enable support for recursive and
+# errorcheck mutexes. Enables pthread_mutexattr_settype().
+# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority
+# inheritance on mutexes and semaphores.
+# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
+# inheritance is enabled. It defines the maximum number of
+# different threads (minus one) that can take counts on a
+# semaphore with priority inheritance support. This may be
+# set to zero if priority inheritance is disabled OR if you
+# are only using semaphores as mutexes (only one holder) OR
+# if no more than two threads participate using a counting
+# semaphore.
+# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled,
+# then this setting is the maximum number of higher priority
+# threads (minus 1) than can be waiting for another thread
+# to release a count on a semaphore. This value may be set
+# to zero if no more than one thread is expected to wait for
+# a semaphore.
+# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors
+# by task_create() when a new task is started. If set, all
+# files/drivers will appear to be closed in the new task.
+# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first
+# three file descriptors (stdin, stdout, stderr) by task_create()
+# when a new task is started. If set, all files/drivers will
+# appear to be closed in the new task except for stdin, stdout,
+# and stderr.
+# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket
+# desciptors by task_create() when a new task is started. If
+# set, all sockets will appear to be closed in the new task.
+#
+#CONFIG_APPS_DIR=
+CONFIG_DEBUG=n
+CONFIG_DEBUG_VERBOSE=n
+CONFIG_DEBUG_SYMBOLS=n
+CONFIG_MM_REGIONS=1
+CONFIG_ARCH_LOWPUTC=y
+CONFIG_RR_INTERVAL=0
+CONFIG_SCHED_INSTRUMENTATION=n
+CONFIG_TASK_NAME_SIZE=32
+CONFIG_START_YEAR=2008
+CONFIG_START_MONTH=8
+CONFIG_START_DAY=16
+CONFIG_JULIAN_TIME=n
+CONFIG_DEV_CONSOLE=y
+CONFIG_DEV_LOWCONSOLE=n
+CONFIG_MUTEX_TYPES=n
+CONFIG_PRIORITY_INHERITANCE=n
+CONFIG_SEM_PREALLOCHOLDERS=0
+CONFIG_SEM_NNESTPRIO=0
+CONFIG_FDCLONE_DISABLE=n
+CONFIG_FDCLONE_STDIO=n
+CONFIG_SDCLONE_DISABLE=y
+
+#
+# The following can be used to disable categories of
+# APIs supported by the OS. If the compiler supports
+# weak functions, then it should not be necessary to
+# disable functions unless you want to restrict usage
+# of those APIs.
+#
+# There are certain dependency relationships in these
+# features.
+#
+# o mq_notify logic depends on signals to awaken tasks
+# waiting for queues to become full or empty.
+# o pthread_condtimedwait() depends on signals to wake
+# up waiting tasks.
+#
+CONFIG_DISABLE_CLOCK=n
+CONFIG_DISABLE_POSIX_TIMERS=n
+CONFIG_DISABLE_PTHREAD=n
+CONFIG_DISABLE_SIGNALS=n
+CONFIG_DISABLE_MQUEUE=n
+CONFIG_DISABLE_MOUNTPOINT=n
+CONFIG_DISABLE_ENVIRON=n
+CONFIG_DISABLE_POLL=y
+
+#
+# Misc libc settings
+#
+# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
+# little smaller if we do not support fieldwidthes
+#
+CONFIG_NOPRINTF_FIELDWIDTH=n
+
+#
+# Allow for architecture optimized implementations
+#
+# The architecture can provide optimized versions of the
+# following to improve sysem performance
+#
+CONFIG_ARCH_MEMCPY=n
+CONFIG_ARCH_MEMCMP=n
+CONFIG_ARCH_MEMMOVE=n
+CONFIG_ARCH_MEMSET=n
+CONFIG_ARCH_STRCMP=n
+CONFIG_ARCH_STRCPY=n
+CONFIG_ARCH_STRNCPY=n
+CONFIG_ARCH_STRLEN=n
+CONFIG_ARCH_STRNLEN=n
+CONFIG_ARCH_BZERO=n
+
+#
+# General build options
+#
+# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
+# BSPs from www.ridgerun.com using the tools/mkimage.sh script
+# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format
+# used with many different loaders using the GNU objcopy program
+# Should not be selected if you are not using the GNU toolchain.
+# CONFIG_RAW_BINARY - make a raw binary format file used with many
+# different loaders using the GNU objcopy program. This option
+# should not be selected if you are not using the GNU toolchain.
+# CONFIG_HAVE_LIBM - toolchain supports libm.a
+#
+CONFIG_RRLOAD_BINARY=n
+CONFIG_INTELHEX_BINARY=n
+CONFIG_RAW_BINARY=n
+CONFIG_HAVE_LIBM=y
+
+#
+# Sizes of configurable things (0 disables)
+#
+# CONFIG_MAX_TASKS - The maximum number of simultaneously
+# active tasks. This value must be a power of two.
+# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
+# of parameters that a task may receive (i.e., maxmum value
+# of 'argc')
+# CONFIG_NPTHREAD_KEYS - The number of items of thread-
+# specific data that can be retained
+# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
+# descriptors (one for each open)
+# CONFIG_NFILE_STREAMS - The maximum number of streams that
+# can be fopen'ed
+# CONFIG_NAME_MAX - The maximum size of a file name.
+# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
+# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_NUNGET_CHARS - Number of characters that can be
+# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
+# structures. The system manages a pool of preallocated
+# message structures to minimize dynamic allocations
+# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
+# a fixed payload size given by this settin (does not include
+# other message structure overhead.
+# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
+# can be passed to a watchdog handler
+# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
+# structures. The system manages a pool of preallocated
+# watchdog structures to minimize dynamic allocations
+# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
+# timer structures. The system manages a pool of preallocated
+# timer structures to minimize dynamic allocations. Set to
+# zero for all dynamic allocations.
+#
+CONFIG_MAX_TASKS=64
+CONFIG_MAX_TASK_ARGS=4
+CONFIG_NPTHREAD_KEYS=4
+CONFIG_NFILE_DESCRIPTORS=32
+CONFIG_NFILE_STREAMS=16
+CONFIG_NAME_MAX=32
+CONFIG_STDIO_BUFFER_SIZE=1024
+CONFIG_NUNGET_CHARS=2
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_MQ_MAXMSGSIZE=32
+CONFIG_MAX_WDOGPARMS=4
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_PREALLOC_TIMERS=8
+
+#
+# FAT filesystem configuration
+# CONFIG_FS_FAT - Enable FAT filesystem support
+# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
+CONFIG_FS_FAT=y
+CONFIG_FS_ROMFS=n
+
+#
+# TCP/IP and UDP support via uIP
+# CONFIG_NET - Enable or disable all network features
+# CONFIG_NET_IPv6 - Build in support for IPv6
+# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
+# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
+# CONFIG_NET_BUFSIZE - uIP buffer size
+# CONFIG_NET_TCP - TCP support on or off
+# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
+# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
+# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
+# CONFIG_NET_TCPBACKLOG - Incoming connections pend in a backlog until
+# accept() is called. The size of the backlog is selected when listen() is called.
+# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
+# CONFIG_NET_UDP - UDP support on or off
+# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
+# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
+# CONFIG_NET_ICMP - ICMP ping response support on or off
+# CONFIG_NET_ICMP_PING - ICMP ping request support on or off
+# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
+# CONFIG_NET_STATISTICS - uIP statistics on or off
+# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
+# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
+# CONFIG_NET_BROADCAST - Broadcast support
+# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
+#
+CONFIG_NET=y
+CONFIG_NET_IPv6=n
+CONFIG_NSOCKET_DESCRIPTORS=8
+CONFIG_NET_SOCKOPTS=y
+CONFIG_NET_BUFSIZE=420
+CONFIG_NET_TCP=y
+CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_UDP=y
+CONFIG_NET_UDP_CHECKSUMS=y
+#CONFIG_NET_UDP_CONNS=10
+CONFIG_NET_ICMP=y
+CONFIG_NET_ICMP_PING=n
+#CONFIG_NET_PINGADDRCONF=0
+CONFIG_NET_STATISTICS=y
+#CONFIG_NET_RECEIVE_WINDOW=
+#CONFIG_NET_ARPTAB_SIZE=8
+CONFIG_NET_BROADCAST=n
+#CONFIG_NET_FWCACHE_SIZE=2
+
+#
+# UIP Network Utilities
+# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
+# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
+CONFIG_NET_DHCP_LIGHT=n
+CONFIG_NET_RESOLV_ENTRIES=4
+
+#
+# Settings for examples/uip
+CONFIG_EXAMPLE_UIP_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_UIP_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_UIP_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_UIP_DHCPC=n
+
+#
+# Settings for examples/nettest
+CONFIG_EXAMPLE_NETTEST_SERVER=n
+CONFIG_EXAMPLE_NETTEST_PERFORMANCE=n
+CONFIG_EXAMPLE_NETTEST_NOMAC=n
+CONFIG_EXAMPLE_NETTEST_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
+
+#
+# Settings for examples/ostest
+CONFIG_EXAMPLES_OSTEST_LOOPS=100
+CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
+
+#
+# Settings for apps/nshlib
+CONFIG_NSH_CONSOLE=y
+CONFIG_NSH_TELNET=n
+CONFIG_NSH_IOBUFFER_SIZE=512
+CONFIG_NSH_CMD_SIZE=40
+CONFIG_NSH_STACKSIZE=4096
+CONFIG_NSH_DHCPC=n
+CONFIG_NSH_NOMAC=n
+CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
+CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
+CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
+
+#
+# Settings for examples/mount
+CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
+#CONFIG_EXAMPLES_MOUNT_NSECTORS=2048
+#CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512
+#CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1
+
+# Stack and heap information
+#
+# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
+# operation from FLASH but must copy initialized .data sections to RAM.
+# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
+# but copy themselves entirely into RAM for better performance.
+# CONFIG_CUSTOM_STACK - The up_ implementation will handle
+# all stack operations outside of the nuttx model.
+# CONFIG_STACK_POINTER - The initial stack pointer
+# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack.
+# This is the thread that (1) performs the inital boot of the system up
+# to the point where user_start() is spawned, and (2) there after is the
+# IDLE thread that executes only when there is no other thread ready to
+# run.
+# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate
+# for the main user thread that begins at the user_start() entry point.
+# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
+# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
+# CONFIG_HEAP_BASE - The beginning of the heap
+# CONFIG_HEAP_SIZE - The size of the heap
+#
+CONFIG_BOOT_RUNFROMFLASH=n
+CONFIG_BOOT_COPYTORAM=n
+CONFIG_CUSTOM_STACK=n
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_USERMAIN_STACKSIZE=4096
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=8192
+CONFIG_HEAP_BASE=
+CONFIG_HEAP_SIZE=
diff --git a/nuttx/configs/sim/nettest/setenv.sh b/nuttx/configs/sim/nettest/setenv.sh
new file mode 100755
index 000000000..9b3df2015
--- /dev/null
+++ b/nuttx/configs/sim/nettest/setenv.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# sim/setenv.sh
+#
+# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+if [ "$(basename $0)" = "setenv.sh" ] ; then
+ echo "You must source this script, not run it!" 1>&2
+ exit 1
+fi
+
+if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
+
+#export NUTTX_BIN=
+#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
+
+echo "PATH : ${PATH}"
diff --git a/nuttx/configs/sim/nsh/Make.defs b/nuttx/configs/sim/nsh/Make.defs
new file mode 100644
index 000000000..1330ade1e
--- /dev/null
+++ b/nuttx/configs/sim/nsh/Make.defs
@@ -0,0 +1,121 @@
+############################################################################
+# configs/sim/nsh/Make.defs
+#
+# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+
+HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ ARCHOPTIMIZATION = -g
+else
+ ARCHOPTIMIZATION = -O2
+endif
+
+ARCHCPUFLAGS = -fno-builtin
+ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
+ARCHPICFLAGS = -fpic
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
+ARCHDEFINES =
+ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ARCHSCRIPT =
+
+CROSSDEV =
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+OBJEXT = .o
+LIBEXT = .a
+
+ifeq ($(HOSTOS),Cygwin)
+ EXEEXT = .exe
+else
+ EXEEXT =
+endif
+
+ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
+ LDFLAGS += -g
+endif
+
+define PREPROCESS
+ @echo "CPP: $1->$2"
+ @$(CPP) $(CPPFLAGS) $1 -o $2
+endef
+
+define COMPILE
+ @echo "CC: $1"
+ @$(CC) -c $(CFLAGS) $1 -o $2
+endef
+
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
+define ASSEMBLE
+ @echo "AS: $1"
+ @$(CC) -c $(AFLAGS) $1 -o $2
+endef
+
+define ARCHIVE
+ echo "AR: $2"; \
+ $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
+endef
+
+define CLEAN
+ @rm -f *.o *.a
+endef
+
+MKDEP = $(TOPDIR)/tools/mkdeps.sh
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+HOSTLDFLAGS =
diff --git a/nuttx/configs/sim/nsh/appconfig b/nuttx/configs/sim/nsh/appconfig
new file mode 100644
index 000000000..0cf77dd6d
--- /dev/null
+++ b/nuttx/configs/sim/nsh/appconfig
@@ -0,0 +1,43 @@
+############################################################################
+# configs/sim/nsh/appconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+# Path to example in apps/examples containing the user_start entry point
+
+CONFIGURED_APPS += examples/nsh
+
+# The NSH Library
+
+CONFIGURED_APPS += nshlib
+
diff --git a/nuttx/configs/sim/nsh/defconfig b/nuttx/configs/sim/nsh/defconfig
new file mode 100644
index 000000000..010e08c26
--- /dev/null
+++ b/nuttx/configs/sim/nsh/defconfig
@@ -0,0 +1,476 @@
+############################################################################
+# sim/nsh/defconfig
+#
+# Copyright (C) 2008-2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+#
+# Architecture selection
+#
+# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
+# processor architecture.
+# CONFIG_ARCH_name - for use in C code. This identifies the particular
+# processor architecture (CONFIG_ARCH_SIM).
+# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
+# the board that supports the particular chip or SoC.
+# CONFIG_ARCH_BOARD_name - for use in C code
+# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
+#
+CONFIG_ARCH=sim
+CONFIG_ARCH_SIM=y
+CONFIG_ARCH_BOARD=sim
+CONFIG_ARCH_BOARD_SIM=y
+
+#
+# General OS setup
+#
+# CONFIG_APPS_DIR - Identifies the relative path to the directory
+# that builds the application to link with NuttX. Default: ../apps
+# CONFIG_DEBUG - enables built-in debug options
+# CONFIG_DEBUG_VERBOSE - enables verbose debug output
+# CONFIG_DEBUG_SYMBOLS - build without optimization and with
+# debug symbols (needed for use with a debugger).
+# CONFIG_HAVE_CXX - Enable support for C++
+# CONFIG_MM_REGIONS - If the architecture includes multiple
+# regions of memory to allocate from, this specifies the
+# number of memory regions that the memory manager must
+# handle and enables the API mm_addregion(start, end);
+# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
+# time console output
+# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz
+# or MSEC_PER_TICK=10. This setting may be defined to
+# inform NuttX that the processor hardware is providing
+# system timer interrupts at some interrupt interval other
+# than 10 msec.
+# CONFIG_RR_INTERVAL - The round robin timeslice will be set
+# this number of milliseconds; Round robin scheduling can
+# be disabled by setting this value to zero.
+# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
+# scheduler to monitor system performance
+# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
+# task name to save in the TCB. Useful if scheduler
+# instrumentation is selected. Set to zero to disable.
+# CONFIG_JULIAN_TIME - Enables Julian time conversions
+# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
+# Used to initialize the internal time logic.
+# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
+# provides /dev/console. Enables stdout, stderr, stdin.
+# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
+# driver (minimul support)
+# CONFIG_MUTEX_TYPES: Set to enable support for recursive and
+# errorcheck mutexes. Enables pthread_mutexattr_settype().
+# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority
+# inheritance on mutexes and semaphores.
+# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
+# inheritance is enabled. It defines the maximum number of
+# different threads (minus one) that can take counts on a
+# semaphore with priority inheritance support. This may be
+# set to zero if priority inheritance is disabled OR if you
+# are only using semaphores as mutexes (only one holder) OR
+# if no more than two threads participate using a counting
+# semaphore.
+# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled,
+# then this setting is the maximum number of higher priority
+# threads (minus 1) than can be waiting for another thread
+# to release a count on a semaphore. This value may be set
+# to zero if no more than one thread is expected to wait for
+# a semaphore.
+# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors
+# by task_create() when a new task is started. If set, all
+# files/drivers will appear to be closed in the new task.
+# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first
+# three file descriptors (stdin, stdout, stderr) by task_create()
+# when a new task is started. If set, all files/drivers will
+# appear to be closed in the new task except for stdin, stdout,
+# and stderr.
+# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket
+# desciptors by task_create() when a new task is started. If
+# set, all sockets will appear to be closed in the new task.
+#
+#CONFIG_APPS_DIR=
+CONFIG_DEBUG=y
+CONFIG_DEBUG_VERBOSE=y
+CONFIG_DEBUG_SYMBOLS=n
+CONFIG_HAVE_CXX=n
+CONFIG_MM_REGIONS=1
+CONFIG_ARCH_LOWPUTC=y
+CONFIG_RR_INTERVAL=0
+CONFIG_SCHED_INSTRUMENTATION=n
+CONFIG_TASK_NAME_SIZE=32
+CONFIG_START_YEAR=2008
+CONFIG_START_MONTH=6
+CONFIG_START_DAY=1
+CONFIG_JULIAN_TIME=n
+CONFIG_DEV_CONSOLE=y
+CONFIG_DEV_LOWCONSOLE=n
+CONFIG_MUTEX_TYPES=n
+CONFIG_PRIORITY_INHERITANCE=n
+CONFIG_SEM_PREALLOCHOLDERS=0
+CONFIG_SEM_NNESTPRIO=0
+CONFIG_FDCLONE_DISABLE=n
+CONFIG_FDCLONE_STDIO=n
+CONFIG_SDCLONE_DISABLE=y
+
+#
+# The following can be used to disable categories of
+# APIs supported by the OS. If the compiler supports
+# weak functions, then it should not be necessary to
+# disable functions unless you want to restrict usage
+# of those APIs.
+#
+# There are certain dependency relationships in these
+# features.
+#
+# o mq_notify logic depends on signals to awaken tasks
+# waiting for queues to become full or empty.
+# o pthread_condtimedwait() depends on signals to wake
+# up waiting tasks.
+#
+CONFIG_DISABLE_CLOCK=n
+CONFIG_DISABLE_POSIX_TIMERS=n
+CONFIG_DISABLE_PTHREAD=n
+CONFIG_DISABLE_SIGNALS=n
+CONFIG_DISABLE_MQUEUE=n
+CONFIG_DISABLE_MOUNTPOINT=n
+CONFIG_DISABLE_ENVIRON=n
+CONFIG_DISABLE_POLL=y
+
+#
+# Misc libc settings
+#
+# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
+# little smaller if we do not support fieldwidthes
+#
+CONFIG_NOPRINTF_FIELDWIDTH=n
+
+#
+# Allow for architecture optimized implementations
+#
+# The architecture can provide optimized versions of the
+# following to improve sysem performance
+#
+CONFIG_ARCH_MEMCPY=n
+CONFIG_ARCH_MEMCMP=n
+CONFIG_ARCH_MEMMOVE=n
+CONFIG_ARCH_MEMSET=n
+CONFIG_ARCH_STRCMP=n
+CONFIG_ARCH_STRCPY=n
+CONFIG_ARCH_STRNCPY=n
+CONFIG_ARCH_STRLEN=n
+CONFIG_ARCH_STRNLEN=n
+CONFIG_ARCH_BZERO=n
+
+#
+# General build options
+#
+# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
+# BSPs from www.ridgerun.com using the tools/mkimage.sh script
+# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format
+# used with many different loaders using the GNU objcopy program
+# Should not be selected if you are not using the GNU toolchain.
+# CONFIG_RAW_BINARY - make a raw binary format file used with many
+# different loaders using the GNU objcopy program. This option
+# should not be selected if you are not using the GNU toolchain.
+# CONFIG_HAVE_LIBM - toolchain supports libm.a
+#
+CONFIG_RRLOAD_BINARY=n
+CONFIG_INTELHEX_BINARY=n
+CONFIG_RAW_BINARY=n
+CONFIG_HAVE_LIBM=y
+
+#
+# Sizes of configurable things (0 disables)
+#
+# CONFIG_MAX_TASKS - The maximum number of simultaneously
+# active tasks. This value must be a power of two.
+# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
+# of parameters that a task may receive (i.e., maxmum value
+# of 'argc')
+# CONFIG_NPTHREAD_KEYS - The number of items of thread-
+# specific data that can be retained
+# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
+# descriptors (one for each open)
+# CONFIG_NFILE_STREAMS - The maximum number of streams that
+# can be fopen'ed
+# CONFIG_NAME_MAX - The maximum size of a file name.
+# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
+# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_NUNGET_CHARS - Number of characters that can be
+# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
+# structures. The system manages a pool of preallocated
+# message structures to minimize dynamic allocations
+# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
+# a fixed payload size given by this settin (does not include
+# other message structure overhead.
+# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
+# can be passed to a watchdog handler
+# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
+# structures. The system manages a pool of preallocated
+# watchdog structures to minimize dynamic allocations
+# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
+# timer structures. The system manages a pool of preallocated
+# timer structures to minimize dynamic allocations. Set to
+# zero for all dynamic allocations.
+#
+CONFIG_MAX_TASKS=64
+CONFIG_MAX_TASK_ARGS=4
+CONFIG_NPTHREAD_KEYS=4
+CONFIG_NFILE_DESCRIPTORS=32
+CONFIG_NFILE_STREAMS=16
+CONFIG_NAME_MAX=32
+CONFIG_STDIO_BUFFER_SIZE=1024
+CONFIG_NUNGET_CHARS=2
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_MQ_MAXMSGSIZE=32
+CONFIG_MAX_WDOGPARMS=4
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_PREALLOC_TIMERS=8
+
+#
+# Filesystem configuration
+#
+# CONFIG_FS_FAT - Enable FAT filesystem support
+# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FAT_LCNAMES - Enable use of the NT-style upper/lower case 8.3
+# file name support.
+# CONFIG_FAT_LFN - Enable FAT long file names. NOTE: Microsoft claims
+# patents on FAT long file name technology. Please read the
+# disclaimer in the top-level COPYING file and only enable this
+# feature if you understand these issues.
+# CONFIG_FAT_MAXFNAME - If CONFIG_FAT_LFN is defined, then the
+# default, maximum long file name is 255 bytes. This can eat up
+# a lot of memory (especially stack space). If you are willing
+# to live with some non-standard, short long file names, then
+# define this value. A good choice would be the same value as
+# selected for CONFIG_NAME_MAX which will limit the visibility
+# of longer file names anyway.
+# CONFIG_FS_NXFFS: Enable NuttX FLASH file system (NXFF) support.
+# CONFIG_NXFFS_ERASEDSTATE: The erased state of FLASH.
+# This must have one of the values of 0xff or 0x00.
+# Default: 0xff.
+# CONFIG_NXFFS_PACKTHRESHOLD: When packing flash file data,
+# don't both with file chunks smaller than this number of data bytes.
+# CONFIG_NXFFS_MAXNAMLEN: The maximum size of an NXFFS file name.
+# Default: 255.
+# CONFIG_NXFFS_PACKTHRESHOLD: When packing flash file data,
+# don't both with file chunks smaller than this number of data bytes.
+# Default: 32.
+# CONFIG_NXFFS_TAILTHRESHOLD: clean-up can either mean
+# packing files together toward the end of the file or, if file are
+# deleted at the end of the file, clean up can simply mean erasing
+# the end of FLASH memory so that it can be re-used again. However,
+# doing this can also harm the life of the FLASH part because it can
+# mean that the tail end of the FLASH is re-used too often. This
+# threshold determines if/when it is worth erased the tail end of FLASH
+# and making it available for re-use (and possible over-wear).
+# Default: 8192.
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
+# CONFIG_FS_RAMMAP - For file systems that do not support XIP, this
+# option will enable a limited form of memory mapping that is
+# implemented by copying whole files into memory.
+#
+CONFIG_FS_FAT=y
+CONFIG_FAT_LCNAMES=y
+CONFIG_FAT_LFN=n
+CONFIG_FAT_MAXFNAME=32
+CONFIG_FS_NXFFS=n
+CONFIG_FS_ROMFS=y
+
+#
+# TCP/IP and UDP support via uIP
+# CONFIG_NET - Enable or disable all network features
+# CONFIG_NET_IPv6 - Build in support for IPv6
+# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
+# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
+# CONFIG_NET_BUFSIZE - uIP buffer size
+# CONFIG_NET_TCP - TCP support on or off
+# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
+# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
+# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
+# CONFIG_NET_TCPBACKLOG - Incoming connections pend in a backlog until
+# accept() is called. The size of the backlog is selected when listen() is called.
+# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
+# CONFIG_NET_UDP - UDP support on or off
+# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
+# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
+# CONFIG_NET_ICMP - ICMP ping response support on or off
+# CONFIG_NET_ICMP_PING - ICMP ping request support on or off
+# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
+# CONFIG_NET_STATISTICS - uIP statistics on or off
+# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
+# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
+# CONFIG_NET_BROADCAST - Broadcast support
+# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
+#
+CONFIG_NET=n
+CONFIG_NET_IPv6=n
+CONFIG_NSOCKET_DESCRIPTORS=0
+CONFIG_NET_SOCKOPTS=y
+CONFIG_NET_BUFSIZE=420
+CONFIG_NET_TCP=n
+CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_UDP=n
+CONFIG_NET_UDP_CHECKSUMS=y
+#CONFIG_NET_UDP_CONNS=10
+CONFIG_NET_ICMP=n
+CONFIG_NET_ICMP_PING=n
+#CONFIG_NET_PINGADDRCONF=0
+CONFIG_NET_STATISTICS=y
+#CONFIG_NET_RECEIVE_WINDOW=
+#CONFIG_NET_ARPTAB_SIZE=8
+CONFIG_NET_BROADCAST=n
+#CONFIG_NET_FWCACHE_SIZE=2
+
+#
+# UIP Network Utilities
+# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
+# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
+CONFIG_NET_DHCP_LIGHT=n
+CONFIG_NET_RESOLV_ENTRIES=4
+
+#
+# Settings for examples/uip
+CONFIG_EXAMPLE_UIP_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_UIP_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_UIP_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_UIP_DHCPC=n
+
+#
+# Settings for examples/nettest
+CONFIG_EXAMPLE_NETTEST_SERVER=n
+CONFIG_EXAMPLE_NETTEST_PERFORMANCE=n
+CONFIG_EXAMPLE_NETTEST_NOMAC=n
+CONFIG_EXAMPLE_NETTEST_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
+
+#
+# Settings for examples/ostest
+CONFIG_EXAMPLES_OSTEST_LOOPS=100
+CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
+
+#
+# Settings for apps/nshlib
+#
+# CONFIG_NSH_FILEIOSIZE - Size of a static I/O buffer
+# CONFIG_NSH_STRERROR - Use strerror(errno)
+# CONFIG_NSH_LINELEN - Maximum length of one command line
+# CONFIG_NSH_STACKSIZE - Stack size to use for new threads.
+# CONFIG_NSH_NESTDEPTH - Max number of nested if-then[-else]-fi
+# CONFIG_NSH_DISABLESCRIPT - Disable scripting support
+# CONFIG_NSH_DISABLEBG - Disable background commands
+# CONFIG_NSH_ROMFSETC - Use startup script in /etc
+# CONFIG_NSH_CONSOLE - Use serial console front end
+# CONFIG_NSH_TELNET - Use telnetd console front end
+#
+# If CONFIG_NSH_TELNET is selected:
+# CONFIG_NSH_IOBUFFER_SIZE -- Telnetd I/O buffer size
+# CONFIG_NSH_DHCPC - Obtain address using DHCP
+# CONFIG_NSH_IPADDR - Provides static IP address
+# CONFIG_NSH_DRIPADDR - Provides static router IP address
+# CONFIG_NSH_NETMASK - Provides static network mask
+# CONFIG_NSH_NOMAC - Use a bogus MAC address
+#
+# If CONFIG_NSH_ROMFSETC is selected:
+# CONFIG_NSH_ROMFSMOUNTPT - ROMFS mountpoint
+# CONFIG_NSH_INITSCRIPT - Relative path to init script
+# CONFIG_NSH_ROMFSDEVNO - ROMFS RAM device minor
+# CONFIG_NSH_ROMFSSECTSIZE - ROMF sector size
+# CONFIG_NSH_FATDEVNO - FAT FS RAM device minor
+# CONFIG_NSH_FATSECTSIZE - FAT FS sector size
+# CONFIG_NSH_FATNSECTORS - FAT FS number of sectors
+# CONFIG_NSH_FATMOUNTPT - FAT FS mountpoint
+CONFIG_NSH_FILEIOSIZE=1024
+CONFIG_NSH_STRERROR=n
+CONFIG_NSH_LINELEN=80
+CONFIG_NSH_STACKSIZE=4096
+CONFIG_NSH_NESTDEPTH=3
+CONFIG_NSH_DISABLESCRIPT=n
+CONFIG_NSH_DISABLEBG=n
+CONFIG_NSH_ROMFSETC=y
+CONFIG_NSH_CONSOLE=y
+CONFIG_NSH_TELNET=n
+CONFIG_NSH_IOBUFFER_SIZE=512
+CONFIG_NSH_DHCPC=n
+CONFIG_NSH_NOMAC=n
+CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
+CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
+CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_NSH_ROMFSMOUNTPT="/etc"
+CONFIG_NSH_INITSCRIPT="init.d/rcS"
+CONFIG_NSH_ROMFSDEVNO=1
+CONFIG_NSH_ROMFSSECTSIZE=64
+CONFIG_NSH_FATDEVNO=2
+CONFIG_NSH_FATSECTSIZE=512
+CONFIG_NSH_FATNSECTORS=1024
+CONFIG_NSH_FATMOUNTPT=/tmp
+
+#
+# Settings for examples/mount
+CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
+#CONFIG_EXAMPLES_MOUNT_NSECTORS=2048
+#CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512
+#CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1
+
+#
+# Stack and heap information
+#
+# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
+# operation from FLASH but must copy initialized .data sections to RAM.
+# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
+# but copy themselves entirely into RAM for better performance.
+# CONFIG_CUSTOM_STACK - The up_ implementation will handle
+# all stack operations outside of the nuttx model.
+# CONFIG_STACK_POINTER - The initial stack pointer
+# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack.
+# This is the thread that (1) performs the inital boot of the system up
+# to the point where user_start() is spawned, and (2) there after is the
+# IDLE thread that executes only when there is no other thread ready to
+# run.
+# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate
+# for the main user thread that begins at the user_start() entry point.
+# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
+# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
+# CONFIG_HEAP_BASE - The beginning of the heap
+# CONFIG_HEAP_SIZE - The size of the heap
+#
+CONFIG_BOOT_RUNFROMFLASH=n
+CONFIG_BOOT_COPYTORAM=n
+CONFIG_CUSTOM_STACK=n
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_USERMAIN_STACKSIZE=4096
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=8192
+CONFIG_HEAP_BASE=
+CONFIG_HEAP_SIZE=
diff --git a/nuttx/configs/sim/nsh/setenv.sh b/nuttx/configs/sim/nsh/setenv.sh
new file mode 100755
index 000000000..006beb5e2
--- /dev/null
+++ b/nuttx/configs/sim/nsh/setenv.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# sim/nsh/setenv.sh
+#
+# Copyright (C) 2008 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+if [ "$(basename $0)" = "setenv.sh" ] ; then
+ echo "You must source this script, not run it!" 1>&2
+ exit 1
+fi
+
+if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
+
+#export NUTTX_BIN=
+#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
+
+echo "PATH : ${PATH}"
diff --git a/nuttx/configs/sim/nsh2/Make.defs b/nuttx/configs/sim/nsh2/Make.defs
new file mode 100644
index 000000000..39b33dc7d
--- /dev/null
+++ b/nuttx/configs/sim/nsh2/Make.defs
@@ -0,0 +1,122 @@
+############################################################################
+# configs/sim/nsh2/Make.defs
+#
+# Copyright (C) Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+
+HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ ARCHOPTIMIZATION = -g
+else
+ ARCHOPTIMIZATION = -O2
+endif
+
+ARCHCPUFLAGS = -fno-builtin
+ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
+ARCHPICFLAGS = -fpic
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
+ARCHDEFINES =
+ARCHDEFINESXX = -DCONFIG_WCHAR_BUILTIN
+ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ARCHSCRIPT =
+
+CROSSDEV =
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINESXX) $(EXTRADEFINES) -pipe
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+OBJEXT = .o
+LIBEXT = .a
+
+ifeq ($(HOSTOS),Cygwin)
+ EXEEXT = .exe
+else
+ EXEEXT =
+endif
+
+ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
+ LDFLAGS += -g
+endif
+
+define PREPROCESS
+ @echo "CPP: $1->$2"
+ @$(CPP) $(CPPFLAGS) $1 -o $2
+endef
+
+define COMPILE
+ @echo "CC: $1"
+ @$(CC) -c $(CFLAGS) $1 -o $2
+endef
+
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
+define ASSEMBLE
+ @echo "AS: $1"
+ @$(CC) -c $(AFLAGS) $1 -o $2
+endef
+
+define ARCHIVE
+ echo "AR: $2"; \
+ $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
+endef
+
+define CLEAN
+ @rm -f *.o *.a
+endef
+
+MKDEP = $(TOPDIR)/tools/mkdeps.sh
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+HOSTLDFLAGS =
diff --git a/nuttx/configs/sim/nsh2/appconfig b/nuttx/configs/sim/nsh2/appconfig
new file mode 100644
index 000000000..b77c1a198
--- /dev/null
+++ b/nuttx/configs/sim/nsh2/appconfig
@@ -0,0 +1,49 @@
+############################################################################
+# configs/sim/nsh2/appconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+# Path to example in apps/examples containing the user_start entry point
+
+CONFIGURED_APPS += examples/nsh
+
+# The NSH Library
+
+CONFIGURED_APPS += nshlib
+
+# NSH Built-In Functions
+
+CONFIGURED_APPS += examples/nx
+CONFIGURED_APPS += examples/nxhello
+CONFIGURED_APPS += examples/nxlines
+CONFIGURED_APPS += examples/touchscreen
diff --git a/nuttx/configs/sim/nsh2/defconfig b/nuttx/configs/sim/nsh2/defconfig
new file mode 100644
index 000000000..314014044
--- /dev/null
+++ b/nuttx/configs/sim/nsh2/defconfig
@@ -0,0 +1,801 @@
+############################################################################
+# sim/nsh2/defconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+#
+# Architecture selection
+#
+# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
+# processor architecture.
+# CONFIG_ARCH_name - for use in C code. This identifies the particular
+# processor architecture (CONFIG_ARCH_SIM).
+# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
+# the board that supports the particular chip or SoC.
+# CONFIG_ARCH_BOARD_name - for use in C code
+# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
+#
+CONFIG_ARCH=sim
+CONFIG_ARCH_SIM=y
+CONFIG_ARCH_BOARD=sim
+CONFIG_ARCH_BOARD_SIM=y
+
+#
+# Framebuffer driver options
+#
+CONFIG_FB_CMAP=n
+CONFIG_FB_HWCURSOR=n
+CONFIG_FB_HWCURSORIMAGE=n
+#CONFIG_FB_HWCURSORSIZE
+#CONFIG_FB_TRANSPARENCY
+
+#
+# Simulated framebuffer configuration
+#
+CONFIG_SIM_X11FB=y
+CONFIG_SIM_FBWIDTH=480
+CONFIG_SIM_FBHEIGHT=240
+CONFIG_SIM_FBBPP=32
+
+#
+# Simulated touchscreen configuration
+# (Set both of the following to 'y' to enable)
+#
+CONFIG_INPUT=y
+CONFIG_SIM_TOUCHSCREEN=y
+
+#
+# General OS setup
+#
+# CONFIG_APPS_DIR - Identifies the relative path to the directory
+# that builds the application to link with NuttX. Default: ../apps
+# CONFIG_DEBUG - enables built-in debug options
+# CONFIG_DEBUG_VERBOSE - enables verbose debug output
+# CONFIG_DEBUG_SYMBOLS - build without optimization and with
+# debug symbols (needed for use with a debugger).
+# CONFIG_HAVE_CXX - Enable support for C++S
+# CONFIG_MM_REGIONS - If the architecture includes multiple
+# regions of memory to allocate from, this specifies the
+# number of memory regions that the memory manager must
+# handle and enables the API mm_addregion(start, end);
+# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
+# time console output
+# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz
+# or MSEC_PER_TICK=10. This setting may be defined to
+# inform NuttX that the processor hardware is providing
+# system timer interrupts at some interrupt interval other
+# than 10 msec.
+# CONFIG_RR_INTERVAL - The round robin timeslice will be set
+# this number of milliseconds; Round robin scheduling can
+# be disabled by setting this value to zero.
+# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
+# scheduler to monitor system performance
+# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
+# task name to save in the TCB. Useful if scheduler
+# instrumentation is selected. Set to zero to disable.
+# CONFIG_JULIAN_TIME - Enables Julian time conversions
+# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
+# Used to initialize the internal time logic.
+# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
+# provides /dev/console. Enables stdout, stderr, stdin.
+# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
+# driver (minimul support)
+# CONFIG_MUTEX_TYPES: Set to enable support for recursive and
+# errorcheck mutexes. Enables pthread_mutexattr_settype().
+# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority
+# inheritance on mutexes and semaphores.
+# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
+# inheritance is enabled. It defines the maximum number of
+# different threads (minus one) that can take counts on a
+# semaphore with priority inheritance support. This may be
+# set to zero if priority inheritance is disabled OR if you
+# are only using semaphores as mutexes (only one holder) OR
+# if no more than two threads participate using a counting
+# semaphore.
+# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled,
+# then this setting is the maximum number of higher priority
+# threads (minus 1) than can be waiting for another thread
+# to release a count on a semaphore. This value may be set
+# to zero if no more than one thread is expected to wait for
+# a semaphore.
+# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors
+# by task_create() when a new task is started. If set, all
+# files/drivers will appear to be closed in the new task.
+# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first
+# three file descriptors (stdin, stdout, stderr) by task_create()
+# when a new task is started. If set, all files/drivers will
+# appear to be closed in the new task except for stdin, stdout,
+# and stderr.
+# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket
+# desciptors by task_create() when a new task is started. If
+# set, all sockets will appear to be closed in the new task.
+# CONFIG_SCHED_WORKQUEUE. Create a dedicated "worker" thread to
+# handle delayed processing from interrupt handlers. This feature
+# is required for some drivers but, if there are not complaints,
+# can be safely disabled. The worker thread also performs
+# garbage collection -- completing any delayed memory deallocations
+# from interrupt handlers. If the worker thread is disabled,
+# then that clean will be performed by the IDLE thread instead
+# (which runs at the lowest of priority and may not be appropriate
+# if memory reclamation is of high priority). If CONFIG_SCHED_WORKQUEUE
+# is enabled, then the following options can also be used:
+# CONFIG_SCHED_WORKPRIORITY - The execution priority of the worker
+# thread. Default: 50
+# CONFIG_SCHED_WORKPERIOD - How often the worker thread checks for
+# work in units of microseconds. Default: 50*1000 (50 MS).
+# CONFIG_SCHED_WORKSTACKSIZE - The stack size allocated for the worker
+# thread. Default: CONFIG_IDLETHREAD_STACKSIZE.
+# CONFIG_SIG_SIGWORK - The signal number that will be used to wake-up
+# the worker thread. Default: 4
+# CONFIG_SCHED_WAITPID - Enable the waitpid() API
+# CONFIG_SCHED_ATEXIT - Enabled the atexit() API
+#
+#CONFIG_APPS_DIR=
+CONFIG_DEBUG=n
+CONFIG_DEBUG_VERBOSE=n
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DEBUG_GRAPHICS=n
+CONFIG_DEBUG_INPUT=n
+CONFIG_HAVE_CXX=y
+CONFIG_MM_REGIONS=1
+CONFIG_ARCH_LOWPUTC=y
+CONFIG_RR_INTERVAL=0
+CONFIG_SCHED_INSTRUMENTATION=n
+CONFIG_TASK_NAME_SIZE=32
+CONFIG_START_YEAR=2011
+CONFIG_START_MONTH=10
+CONFIG_START_DAY=6
+CONFIG_JULIAN_TIME=n
+CONFIG_DEV_CONSOLE=y
+CONFIG_DEV_LOWCONSOLE=n
+CONFIG_MUTEX_TYPES=n
+CONFIG_PRIORITY_INHERITANCE=n
+CONFIG_SEM_PREALLOCHOLDERS=0
+CONFIG_SEM_NNESTPRIO=0
+CONFIG_FDCLONE_DISABLE=n
+CONFIG_SIG_SIGWORK=4
+CONFIG_FDCLONE_STDIO=n
+CONFIG_SDCLONE_DISABLE=y
+CONFIG_SCHED_WORKQUEUE=n
+CONFIG_SCHED_WORKPRIORITY=50
+CONFIG_SCHED_WORKPERIOD=(50*1000)
+CONFIG_SCHED_WORKSTACKSIZE=1024
+CONFIG_SCHED_WAITPID=y
+CONFIG_SCHED_ATEXIT=n
+
+#
+# The following can be used to disable categories of
+# APIs supported by the OS. If the compiler supports
+# weak functions, then it should not be necessary to
+# disable functions unless you want to restrict usage
+# of those APIs.
+#
+# There are certain dependency relationships in these
+# features.
+#
+# o mq_notify logic depends on signals to awaken tasks
+# waiting for queues to become full or empty.
+# o pthread_condtimedwait() depends on signals to wake
+# up waiting tasks.
+#
+CONFIG_DISABLE_CLOCK=n
+CONFIG_DISABLE_POSIX_TIMERS=y
+CONFIG_DISABLE_PTHREAD=n
+CONFIG_DISABLE_SIGNALS=n
+CONFIG_DISABLE_MQUEUE=y
+CONFIG_DISABLE_MOUNTPOINT=n
+CONFIG_DISABLE_ENVIRON=n
+CONFIG_DISABLE_POLL=y
+
+#
+# Misc libc settings
+#
+# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
+# little smaller if we do not support fieldwidthes
+#
+CONFIG_NOPRINTF_FIELDWIDTH=n
+
+#
+# Allow for architecture optimized implementations
+#
+# The architecture can provide optimized versions of the
+# following to improve sysem performance
+#
+CONFIG_ARCH_MEMCPY=n
+CONFIG_ARCH_MEMCMP=n
+CONFIG_ARCH_MEMMOVE=n
+CONFIG_ARCH_MEMSET=n
+CONFIG_ARCH_STRCMP=n
+CONFIG_ARCH_STRCPY=n
+CONFIG_ARCH_STRNCPY=n
+CONFIG_ARCH_STRLEN=n
+CONFIG_ARCH_STRNLEN=n
+CONFIG_ARCH_BZERO=n
+
+#
+# General build options
+#
+# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
+# BSPs from www.ridgerun.com using the tools/mkimage.sh script
+# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format
+# used with many different loaders using the GNU objcopy program
+# Should not be selected if you are not using the GNU toolchain.
+# CONFIG_RAW_BINARY - make a raw binary format file used with many
+# different loaders using the GNU objcopy program. This option
+# should not be selected if you are not using the GNU toolchain.
+# CONFIG_HAVE_LIBM - toolchain supports libm.a
+#
+CONFIG_RRLOAD_BINARY=n
+CONFIG_INTELHEX_BINARY=n
+CONFIG_RAW_BINARY=n
+CONFIG_HAVE_LIBM=y
+
+#
+# Sizes of configurable things (0 disables)
+#
+# CONFIG_MAX_TASKS - The maximum number of simultaneously
+# active tasks. This value must be a power of two.
+# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
+# of parameters that a task may receive (i.e., maxmum value
+# of 'argc')
+# CONFIG_NPTHREAD_KEYS - The number of items of thread-
+# specific data that can be retained
+# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
+# descriptors (one for each open)
+# CONFIG_NFILE_STREAMS - The maximum number of streams that
+# can be fopen'ed
+# CONFIG_NAME_MAX - The maximum size of a file name.
+# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
+# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_NUNGET_CHARS - Number of characters that can be
+# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
+# structures. The system manages a pool of preallocated
+# message structures to minimize dynamic allocations
+# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
+# a fixed payload size given by this settin (does not include
+# other message structure overhead.
+# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
+# can be passed to a watchdog handler
+# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
+# structures. The system manages a pool of preallocated
+# watchdog structures to minimize dynamic allocations
+# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
+# timer structures. The system manages a pool of preallocated
+# timer structures to minimize dynamic allocations. Set to
+# zero for all dynamic allocations.
+#
+CONFIG_MAX_TASKS=64
+CONFIG_MAX_TASK_ARGS=4
+CONFIG_NPTHREAD_KEYS=4
+CONFIG_NFILE_DESCRIPTORS=32
+CONFIG_NFILE_STREAMS=16
+CONFIG_NAME_MAX=32
+CONFIG_STDIO_BUFFER_SIZE=1024
+CONFIG_NUNGET_CHARS=2
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_MQ_MAXMSGSIZE=32
+CONFIG_MAX_WDOGPARMS=4
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_PREALLOC_TIMERS=8
+
+#
+# Filesystem configuration
+#
+# CONFIG_FS_FAT - Enable FAT filesystem support
+# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FAT_LCNAMES - Enable use of the NT-style upper/lower case 8.3
+# file name support.
+# CONFIG_FAT_LFN - Enable FAT long file names. NOTE: Microsoft claims
+# patents on FAT long file name technology. Please read the
+# disclaimer in the top-level COPYING file and only enable this
+# feature if you understand these issues.
+# CONFIG_FAT_MAXFNAME - If CONFIG_FAT_LFN is defined, then the
+# default, maximum long file name is 255 bytes. This can eat up
+# a lot of memory (especially stack space). If you are willing
+# to live with some non-standard, short long file names, then
+# define this value. A good choice would be the same value as
+# selected for CONFIG_NAME_MAX which will limit the visibility
+# of longer file names anyway.
+# CONFIG_FS_NXFFS: Enable NuttX FLASH file system (NXFF) support.
+# CONFIG_NXFFS_ERASEDSTATE: The erased state of FLASH.
+# This must have one of the values of 0xff or 0x00.
+# Default: 0xff.
+# CONFIG_NXFFS_PACKTHRESHOLD: When packing flash file data,
+# don't both with file chunks smaller than this number of data bytes.
+# CONFIG_NXFFS_MAXNAMLEN: The maximum size of an NXFFS file name.
+# Default: 255.
+# CONFIG_NXFFS_PACKTHRESHOLD: When packing flash file data,
+# don't both with file chunks smaller than this number of data bytes.
+# Default: 32.
+# CONFIG_NXFFS_TAILTHRESHOLD: clean-up can either mean
+# packing files together toward the end of the file or, if file are
+# deleted at the end of the file, clean up can simply mean erasing
+# the end of FLASH memory so that it can be re-used again. However,
+# doing this can also harm the life of the FLASH part because it can
+# mean that the tail end of the FLASH is re-used too often. This
+# threshold determines if/when it is worth erased the tail end of FLASH
+# and making it available for re-use (and possible over-wear).
+# Default: 8192.
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
+# CONFIG_FS_RAMMAP - For file systems that do not support XIP, this
+# option will enable a limited form of memory mapping that is
+# implemented by copying whole files into memory.
+#
+CONFIG_FS_FAT=y
+CONFIG_FAT_LCNAMES=y
+CONFIG_FAT_LFN=y
+CONFIG_FAT_MAXFNAME=32
+CONFIG_FS_NXFFS=n
+CONFIG_FS_ROMFS=y
+
+#
+# TCP/IP and UDP support via uIP
+# CONFIG_NET - Enable or disable all network features
+# CONFIG_NET_IPv6 - Build in support for IPv6
+# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
+# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
+# CONFIG_NET_BUFSIZE - uIP buffer size
+# CONFIG_NET_TCP - TCP support on or off
+# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
+# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
+# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
+# CONFIG_NET_TCPBACKLOG - Incoming connections pend in a backlog until
+# accept() is called. The size of the backlog is selected when listen() is called.
+# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
+# CONFIG_NET_UDP - UDP support on or off
+# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
+# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
+# CONFIG_NET_ICMP - ICMP ping response support on or off
+# CONFIG_NET_ICMP_PING - ICMP ping request support on or off
+# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
+# CONFIG_NET_STATISTICS - uIP statistics on or off
+# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
+# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
+# CONFIG_NET_BROADCAST - Broadcast support
+# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
+#
+CONFIG_NET=n
+CONFIG_NET_IPv6=n
+CONFIG_NSOCKET_DESCRIPTORS=0
+CONFIG_NET_SOCKOPTS=y
+CONFIG_NET_BUFSIZE=420
+CONFIG_NET_TCP=n
+CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_UDP=n
+CONFIG_NET_UDP_CHECKSUMS=y
+#CONFIG_NET_UDP_CONNS=10
+CONFIG_NET_ICMP=n
+CONFIG_NET_ICMP_PING=n
+#CONFIG_NET_PINGADDRCONF=0
+CONFIG_NET_STATISTICS=y
+#CONFIG_NET_RECEIVE_WINDOW=
+#CONFIG_NET_ARPTAB_SIZE=8
+CONFIG_NET_BROADCAST=n
+#CONFIG_NET_FWCACHE_SIZE=2
+
+#
+# UIP Network Utilities
+# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
+# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
+#
+CONFIG_NET_DHCP_LIGHT=n
+CONFIG_NET_RESOLV_ENTRIES=4
+
+#
+# Graphics related configuration settings
+#
+# CONFIG_NX
+# Enables overall support for graphics library and NX
+# CONFIG_NX_MULTIUSER
+# Configures NX in multi-user mode
+# CONFIG_NX_NPLANES
+# Some YUV color formats requires support for multiple planes,
+# one for each color component. Unless you have such special
+# hardware, this value should be undefined or set to 1
+# CONFIG_NX_DISABLE_1BPP, CONFIG_NX_DISABLE_2BPP,
+# CONFIG_NX_DISABLE_4BPP, CONFIG_NX_DISABLE_8BPP,
+# CONFIG_NX_DISABLE_16BPP, CONFIG_NX_DISABLE_24BPP, and
+# CONFIG_NX_DISABLE_32BPP
+# NX supports a variety of pixel depths. You can save some
+# memory by disabling support for unused color depths.
+# CONFIG_NX_PACKEDMSFIRST
+# If a pixel depth of less than 8-bits is used, then NX needs
+# to know if the pixels pack from the MS to LS or from LS to MS
+# CONFIG_NX_MOUSE
+# Build in support for mouse input
+# CONFIG_NX_KBD
+# Build in support of keypad/keyboard input
+# CONFIG_NXTK_BORDERWIDTH
+# Specifies with with of the border (in pixels) used with
+# framed windows. The default is 4.
+# CONFIG_NXTK_BORDERCOLOR1 and CONFIG_NXTK_BORDERCOLOR2
+# Specify the colors of the border used with framed windows.
+# CONFIG_NXTK_BORDERCOLOR2 is the shadow side color and so
+# is normally darker. The default is medium and dark grey,
+# respectively
+# CONFIG_NXTK_AUTORAISE
+# If set, a window will be raised to the top if the mouse position
+# is over a visible portion of the window. Default: A mouse
+# button must be clicked over a visible portion of the window.
+# CONFIG_NXFONTS_CHARBITS
+# The number of bits in the character set. Current options are
+# only 7 and 8. The default is 7.
+# CONFIG_NXFONT_SANS23X27
+# This option enables support for a tiny, 23x27 san serif font
+# (font ID FONTID_SANS23X27 == 1).
+# CONFIG_NXFONT_SANS22X29
+# This option enables support for a small, 22x29 san serif font
+# (font ID FONTID_SANS22X29 == 2).
+# CONFIG_NXFONT_SANS28X37
+# This option enables support for a medium, 28x37 san serif font
+# (font ID FONTID_SANS28X37 == 3).
+# CONFIG_NXFONT_SANS39X48
+# This option enables support for a large, 39x48 san serif font
+# (font ID FONTID_SANS39X48 == 4).
+# CONFIG_NXFONT_SANS22X29B
+# This option enables support for a small, 22x29 san serif bold font
+# (font ID FONTID_SANS22X29B == 5).
+# CONFIG_NXFONT_SANS28X37B
+# This option enables support for a medium, 28x37 san serif bold font
+# (font ID FONTID_SANS28X37B == 6).
+# CONFIG_NXFONT_SANS40X49B
+# This option enables support for a large, 40x49 san serif bold font
+# (font ID FONTID_SANS40X49B == 7).
+# CONFIG_NXFONT_SERIF22X29
+# This option enables support for a small, 22x29 font (with serifs)
+# (font ID FONTID_SERIF22X29 == 8).
+# CONFIG_NXFONT_SERIF29X37
+# This option enables support for a medium, 29x37 font (with serifs)
+# (font ID FONTID_SERIF29X37 == 9).
+# CONFIG_NXFONT_SERIF38X48
+# This option enables support for a large, 38x48 font (with serifs)
+# (font ID FONTID_SERIF38X48 == 10).
+# CONFIG_NXFONT_SERIF22X28B
+# This option enables support for a small, 27x38 bold font (with serifs)
+# (font ID FONTID_SERIF22X28B == 11).
+# CONFIG_NXFONT_SERIF27X38B
+# This option enables support for a medium, 27x38 bold font (with serifs)
+# (font ID FONTID_SERIF27X38B == 12).
+# CONFIG_NXFONT_SERIF38X49B
+# This option enables support for a large, 38x49 bold font (with serifs)
+# (font ID FONTID_SERIF38X49B == 13).
+#
+# NX Multi-user only options:
+#
+# CONFIG_NX_BLOCKING
+# Open the client message queues in blocking mode. In this case,
+# nx_eventhandler() will not return until a message is received and processed.
+# CONFIG_NX_MXSERVERMSGS and CONFIG_NX_MXCLIENTMSGS
+# Specifies the maximum number of messages that can fit in
+# the message queues. No additional resources are allocated, but
+# this can be set to prevent flooding of the client or server with
+# too many messages (CONFIG_PREALLOC_MQ_MSGS controls how many
+# messages are pre-allocated).
+#
+CONFIG_NX=y
+CONFIG_NX_MULTIUSER=n
+CONFIG_NX_NPLANES=1
+CONFIG_NX_DISABLE_1BPP=y
+CONFIG_NX_DISABLE_2BPP=y
+CONFIG_NX_DISABLE_4BPP=y
+CONFIG_NX_DISABLE_8BPP=y
+CONFIG_NX_DISABLE_16BPP=y
+CONFIG_NX_DISABLE_24BPP=y
+CONFIG_NX_DISABLE_32BPP=n
+CONFIG_NX_PACKEDMSFIRST=n
+CONFIG_NX_MOUSE=y
+CONFIG_NX_KBD=y
+#CONFIG_NXTK_BORDERWIDTH=4
+#CONFIG_NXTK_BORDERCOLOR1
+#CONFIG_NXTK_BORDERCOLOR2
+CONFIG_NXTK_AUTORAISE=n
+CONFIG_NXFONT_SANS22X29=n
+CONFIG_NXFONT_SANS23X27=y
+CONFIG_NXFONT_SANS28X37=n
+CONFIG_NXFONT_SANS22X29B=n
+CONFIG_NXFONT_SANS28X37B=y
+CONFIG_NXFONT_SANS40X49B=n
+CONFIG_NXFONT_SERIF22X29=n
+CONFIG_NXFONT_SERIF29X37=n
+CONFIG_NXFONT_SERIF38X48=n
+CONFIG_NXFONT_SERIF22X28B=n
+CONFIG_NXFONT_SERIF27X38B=n
+CONFIG_NXFONT_SERIF38X49B=n
+CONFIG_NXFONTS_CHARBITS=7
+CONFIG_NX_BLOCKING=y
+CONFIG_NX_MXSERVERMSGS=32
+CONFIG_NX_MXCLIENTMSGS=16
+
+#
+# Settings for examples/uip
+#
+CONFIG_EXAMPLE_UIP_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_UIP_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_UIP_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_UIP_DHCPC=n
+
+#
+# Settings for examples/nettest
+#
+CONFIG_EXAMPLE_NETTEST_SERVER=n
+CONFIG_EXAMPLE_NETTEST_PERFORMANCE=n
+CONFIG_EXAMPLE_NETTEST_NOMAC=n
+CONFIG_EXAMPLE_NETTEST_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
+
+#
+# Settings for examples/ostest
+#
+CONFIG_EXAMPLES_OSTEST_LOOPS=100
+CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
+
+#
+# Settings for apps/nshlib
+#
+# CONFIG_NSH_BUILTIN_APPS - Support external registered,
+# "named" applications that can be executed from the NSH
+# command line (see apps/README.txt for more information).
+# CONFIG_NSH_FILEIOSIZE - Size of a static I/O buffer
+# CONFIG_NSH_STRERROR - Use strerror(errno)
+# CONFIG_NSH_LINELEN - Maximum length of one command line
+# CONFIG_NSH_STACKSIZE - Stack size to use for new threads.
+# CONFIG_NSH_NESTDEPTH - Max number of nested if-then[-else]-fi
+# CONFIG_NSH_DISABLESCRIPT - Disable scripting support
+# CONFIG_NSH_DISABLEBG - Disable background commands
+# CONFIG_NSH_ROMFSETC - Use startup script in /etc
+# CONFIG_NSH_CONSOLE - Use serial console front end
+# CONFIG_NSH_CONDEV - Select the serial device used to support
+# the NSH console. Default: stdin and stdout
+# CONFIG_NSH_TELNET - Use telnetd console front end
+#
+# If CONFIG_NSH_TELNET is selected:
+# CONFIG_NSH_IOBUFFER_SIZE -- Telnetd I/O buffer size
+# CONFIG_NSH_DHCPC - Obtain address using DHCP
+# CONFIG_NSH_IPADDR - Provides static IP address
+# CONFIG_NSH_DRIPADDR - Provides static router IP address
+# CONFIG_NSH_NETMASK - Provides static network mask
+# CONFIG_NSH_NOMAC - Use a bogus MAC address
+#
+# If CONFIG_NSH_ROMFSETC is selected:
+# CONFIG_NSH_ROMFSMOUNTPT - ROMFS mountpoint
+# CONFIG_NSH_INITSCRIPT - Relative path to init script
+# CONFIG_NSH_ROMFSDEVNO - ROMFS RAM device minor
+# CONFIG_NSH_ROMFSSECTSIZE - ROMF sector size
+# CONFIG_NSH_FATDEVNO - FAT FS RAM device minor
+# CONFIG_NSH_FATSECTSIZE - FAT FS sector size
+# CONFIG_NSH_FATNSECTORS - FAT FS number of sectors
+# CONFIG_NSH_FATMOUNTPT - FAT FS mountpoint
+#
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_FILEIOSIZE=1024
+CONFIG_NSH_STRERROR=n
+CONFIG_NSH_LINELEN=80
+CONFIG_NSH_STACKSIZE=4096
+CONFIG_NSH_NESTDEPTH=3
+CONFIG_NSH_DISABLESCRIPT=n
+CONFIG_NSH_DISABLEBG=n
+CONFIG_NSH_ROMFSETC=y
+CONFIG_NSH_CONSOLE=y
+#CONFIG_NSH_CONDEV="/dev/ttyS1"
+CONFIG_NSH_TELNET=n
+CONFIG_NSH_IOBUFFER_SIZE=512
+CONFIG_NSH_DHCPC=n
+CONFIG_NSH_NOMAC=n
+CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
+CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
+CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_NSH_ROMFSMOUNTPT="/etc"
+CONFIG_NSH_INITSCRIPT="init.d/rcS"
+CONFIG_NSH_ROMFSDEVNO=1
+CONFIG_NSH_ROMFSSECTSIZE=64
+CONFIG_NSH_FATDEVNO=2
+CONFIG_NSH_FATSECTSIZE=512
+CONFIG_NSH_FATNSECTORS=1024
+CONFIG_NSH_FATMOUNTPT=/tmp
+
+#
+# Settings for examples/nx
+#
+# CONFIG_EXAMPLES_NX_BUILTIN -- Build the NX example as a "built-in"
+# that can be executed from the NSH command line
+# CONFIG_EXAMPLES_NX_VPLANE -- The plane to select from the frame-
+# buffer driver for use in the test. Default: 0
+# CONFIG_EXAMPLES_NX_BGCOLOR -- The color of the background. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_COLOR1 -- The color of window 1. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_COLOR2 -- The color of window 2. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_TBCOLOR -- The color of the toolbar. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_FONTCOLOR -- The color of the toolbar. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_BPP -- Pixels per pixel to use. Valid options
+# include 2, 4, 8, 16, 24, and 32. Default is 32.
+# CONFIG_EXAMPLES_NX_RAWWINDOWS -- Use raw windows; Default is to
+# use pretty, framed NXTK windows with toolbars.
+# CONFIG_EXAMPLES_NX_STACKSIZE -- The stacksize to use when creating
+# the NX server. Default 2048
+# CONFIG_EXAMPLES_NX_CLIENTPRIO -- The client priority. Default: 80
+# CONFIG_EXAMPLES_NX_SERVERPRIO -- The server priority. Default: 120
+# CONFIG_EXAMPLES_NX_NOTIFYSIGNO -- The signal number to use with
+# nx_eventnotify(). Default: 4
+#
+CONFIG_EXAMPLES_NX_BUILTIN=y
+CONFIG_EXAMPLES_NX_VPLANE=0
+#CONFIG_EXAMPLES_NX_BGCOLOR
+#CONFIG_EXAMPLES_NX_COLOR1
+#CONFIG_EXAMPLES_NX_COLOR2
+#CONFIG_EXAMPLES_NX_TBCOLOR
+#CONFIG_EXAMPLES_NX_FONTCOLOR
+CONFIG_EXAMPLES_NX_BPP=CONFIG_SIM_FBBPP
+CONFIG_EXAMPLES_NX_RAWWINDOWS=n
+CONFIG_EXAMPLES_NX_STACKSIZE=8192
+CONFIG_EXAMPLES_NX_CLIENTPRIO=80
+CONFIG_EXAMPLES_NX_SERVERPRIO=120
+CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4
+
+#
+# Settings for examples/nxhello
+#
+# CONFIG_EXAMPLES_NXHELLO_BUILTIN -- Build the NXHELLO example as a "built-in"
+# that can be executed from the NSH command line
+# CONFIG_EXAMPLES_NXHELLO_VPLANE -- The plane to select from the frame-
+# buffer driver for use in the test. Default: 0
+# CONFIG_EXAMPLES_NXHELLO_BGCOLOR -- The color of the background. Default
+# depends on CONFIG_EXAMPLES_NXHELLO_BPP.
+# CONFIG_EXAMPLES_NXHELLO_FONTID - Selects the font (see font ID numbers in
+# include/nuttx/nx/nxfonts.h)
+# CONFIG_EXAMPLES_NXHELLO_FONTCOLOR -- The color of the fonts used in the
+# background window. Default depends on CONFIG_EXAMPLES_NXHELLO_BPP.
+# CONFIG_EXAMPLES_NXHELLO_BPP -- Pixels per pixel to use. Valid options
+# include 2, 4, 8, 16, 24, and 32. Default is 32.
+# CONFIG_EXAMPLES_NXHELLO_EXTERNINIT - The driver for the graphics device on
+# this platform requires some unusual initialization. This is the
+# for, for example, SPI LCD/OLED devices. If this configuration is
+# selected, then the platform code must provide an LCD initialization
+# function.
+#
+CONFIG_EXAMPLES_NXHELLO_BUILTIN=y
+CONFIG_EXAMPLES_NXHELLO_VPLANE=0
+#CONFIG_EXAMPLES_NXHELLO_BGCOLOR
+CONFIG_EXAMPLES_NXHELLO_FONTID=6
+#CONFIG_EXAMPLES_NXHELLO_FONTCOLOR
+CONFIG_EXAMPLES_NXHELLO_BPP=CONFIG_SIM_FBBPP
+CONFIG_EXAMPLES_NXHELLO_EXTERNINIT=n
+
+#
+# Settings for examples/nxlines
+#
+# CONFIG_EXAMPLES_NXLINES_BUILTIN -- Build the NXLINES example as a "built-in"
+# that can be executed from the NSH command line
+# CONFIG_EXAMPLES_NXLINES_VPLANE -- The plane to select from the frame-
+# buffer driver for use in the test. Default: 0
+# CONFIG_EXAMPLES_NXLINES_BGCOLOR -- The color of the background. Default
+# depends on CONFIG_EXAMPLES_NXLINES_BPP.
+# CONFIG_EXAMPLES_NXLINES_LINEWIDTH - Selects the width of the lines in
+# pixels (default: 16)
+# CONFIG_EXAMPLES_NXLINES_LINECOLOR -- The color of the central lines drawn
+# in the background window. Default depends on CONFIG_EXAMPLES_NXLINES_BPP
+# (there really is no meaningful default).
+# CONFIG_EXAMPLES_NXLINES_BORDERWIDTH -- The width of the circular border
+# drawn in the background window. (default: 4).
+# CONFIG_EXAMPLES_NXLINES_BORDERCOLOR -- The color of the circular border
+# drawn in the background window. Default depends on CONFIG_EXAMPLES_NXLINES_BPP
+# (there really is no meaningful default).
+# CONFIG_EXAMPLES_NXLINES_CIRCLECOLOR -- The color of the circular region
+# filled in the background window. Default depends on CONFIG_EXAMPLES_NXLINES_BPP
+# (there really is no meaningful default).
+# CONFIG_EXAMPLES_NXLINES_BPP -- Pixels per pixel to use. Valid options
+# include 2, 4, 8, 16, 24, and 32. Default is 16.
+# CONFIG_EXAMPLES_NXLINES_EXTERNINIT - The driver for the graphics device on
+# this platform requires some unusual initialization. This is the
+# for, for example, SPI LCD/OLED devices. If this configuration is
+# selected, then the platform code must provide an LCD initialization
+# function.
+#
+CONFIG_EXAMPLES_NXLINES_BUILTIN=n
+CONFIG_EXAMPLES_NXLINES_VPLANE=0
+#CONFIG_EXAMPLES_NXLINES_BGCOLOR
+CONFIG_EXAMPLES_NXLINES_LINEWIDTH=16
+#CONFIG_EXAMPLES_NXLINES_LINECOLOR
+CONFIG_EXAMPLES_NXLINES_BORDERWIDTH=4
+#CONFIG_EXAMPLES_NXLINES_BORDERCOLOR
+#CONFIG_EXAMPLES_NXLINES_CIRCLECOLOR
+CONFIG_EXAMPLES_NXLINES_BPP=CONFIG_SIM_FBBPP
+CONFIG_EXAMPLES_NXLINES_EXTERNINIT=n
+
+#
+# Settings for examples/touchscreen
+#
+# CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN - Build the touchscreen test as
+# an NSH built-in function. Default: Built as a standalone problem
+# CONFIG_EXAMPLES_TOUCHSCREEN_MINOR - The minor device number. Minor=N
+# correspnds to touchscreen device /dev/input0. Note this value must
+# with CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH. Default 0.
+# CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH - The path to the touchscreen
+# device. This must be consistent with CONFIG_EXAMPLES_TOUCHSCREEN_MINOR.
+# Default: "/dev/input0"
+# CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES - If CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN
+# is defined, then the number of samples is provided on the command line
+# and this value is ignored. Otherwise, this number of samples is
+# collected and the program terminates. Default: Samples are collected
+# indefinitely.
+#
+CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN=y
+CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
+CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
+CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES=25
+
+#
+# Settings for examples/mount
+#
+CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
+#CONFIG_EXAMPLES_MOUNT_NSECTORS=2048
+#CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512
+#CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1
+
+#
+# Stack and heap information
+#
+# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
+# operation from FLASH but must copy initialized .data sections to RAM.
+# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
+# but copy themselves entirely into RAM for better performance.
+# CONFIG_CUSTOM_STACK - The up_ implementation will handle
+# all stack operations outside of the nuttx model.
+# CONFIG_STACK_POINTER - The initial stack pointer
+# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack.
+# This is the thread that (1) performs the inital boot of the system up
+# to the point where user_start() is spawned, and (2) there after is the
+# IDLE thread that executes only when there is no other thread ready to
+# run.
+# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate
+# for the main user thread that begins at the user_start() entry point.
+# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
+# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
+# CONFIG_HEAP_BASE - The beginning of the heap
+# CONFIG_HEAP_SIZE - The size of the heap
+#
+CONFIG_BOOT_RUNFROMFLASH=n
+CONFIG_BOOT_COPYTORAM=n
+CONFIG_CUSTOM_STACK=n
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_USERMAIN_STACKSIZE=4096
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=8192
+CONFIG_HEAP_BASE=
+CONFIG_HEAP_SIZE=
diff --git a/nuttx/configs/sim/nsh2/setenv.sh b/nuttx/configs/sim/nsh2/setenv.sh
new file mode 100755
index 000000000..78204f6eb
--- /dev/null
+++ b/nuttx/configs/sim/nsh2/setenv.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# sim/nsh2/setenv.sh
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+if [ "$(basename $0)" = "setenv.sh" ] ; then
+ echo "You must source this script, not run it!" 1>&2
+ exit 1
+fi
+
+if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
+
+#export NUTTX_BIN=
+#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
+
+echo "PATH : ${PATH}"
diff --git a/nuttx/configs/sim/nx/Make.defs b/nuttx/configs/sim/nx/Make.defs
new file mode 100644
index 000000000..70f6066e1
--- /dev/null
+++ b/nuttx/configs/sim/nx/Make.defs
@@ -0,0 +1,121 @@
+############################################################################
+# configs/sim/nx/Make.defs
+#
+# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+
+HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ ARCHOPTIMIZATION = -g
+else
+ ARCHOPTIMIZATION = -O2
+endif
+
+ARCHCPUFLAGS = -fno-builtin
+ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
+ARCHPICFLAGS = -fpic
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
+ARCHDEFINES =
+ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ARCHSCRIPT =
+
+CROSSDEV =
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+OBJEXT = .o
+LIBEXT = .a
+
+ifeq ($(HOSTOS),Cygwin)
+ EXEEXT = .exe
+else
+ EXEEXT =
+endif
+
+ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
+ LDFLAGS += -g
+endif
+
+define PREPROCESS
+ @echo "CPP: $1->$2"
+ @$(CPP) $(CPPFLAGS) $1 -o $2
+endef
+
+define COMPILE
+ @echo "CC: $1"
+ @$(CC) -c $(CFLAGS) $1 -o $2
+endef
+
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
+define ASSEMBLE
+ @echo "AS: $1"
+ @$(CC) -c $(AFLAGS) $1 -o $2
+endef
+
+define ARCHIVE
+ echo "AR: $2"; \
+ $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
+endef
+
+define CLEAN
+ @rm -f *.o *.a
+endef
+
+MKDEP = $(TOPDIR)/tools/mkdeps.sh
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+HOSTLDFLAGS =
diff --git a/nuttx/configs/sim/nx/appconfig b/nuttx/configs/sim/nx/appconfig
new file mode 100644
index 000000000..12a1f4ac9
--- /dev/null
+++ b/nuttx/configs/sim/nx/appconfig
@@ -0,0 +1,39 @@
+############################################################################
+# configs/sim/nx/appconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+# Path to example in apps/examples containing the user_start entry point
+
+CONFIGURED_APPS += examples/nx
+
diff --git a/nuttx/configs/sim/nx/defconfig b/nuttx/configs/sim/nx/defconfig
new file mode 100644
index 000000000..e70163be7
--- /dev/null
+++ b/nuttx/configs/sim/nx/defconfig
@@ -0,0 +1,607 @@
+############################################################################
+# sim/nx/defconfig
+#
+# Copyright (C) 2008-2010 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+#
+# Architecture selection
+#
+# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
+# processor architecture.
+# CONFIG_ARCH_name - for use in C code. This identifies the particular
+# processor architecture (CONFIG_ARCH_SIM).
+# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
+# the board that supports the particular chip or SoC.
+# CONFIG_ARCH_BOARD_name - for use in C code
+# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
+#
+CONFIG_ARCH=sim
+CONFIG_ARCH_SIM=y
+CONFIG_ARCH_BOARD=sim
+CONFIG_ARCH_BOARD_SIM=y
+
+#
+# Simulated framebuffer configuration
+CONFIG_SIM_X11FB=n
+CONFIG_SIM_FBWIDTH=480
+CONFIG_SIM_FBHEIGHT=240
+CONFIG_SIM_FBBPP=8
+
+#
+# General OS setup
+#
+# CONFIG_APPS_DIR - Identifies the relative path to the directory
+# that builds the application to link with NuttX. Default: ../apps
+# CONFIG_DEBUG - enables built-in debug options
+# CONFIG_DEBUG_VERBOSE - enables verbose debug output
+# CONFIG_DEBUG_SYMBOLS - build without optimization and with
+# debug symbols (needed for use with a debugger).
+# CONFIG_HAVE_CXX - Enable support for C++
+# CONFIG_MM_REGIONS - If the architecture includes multiple
+# regions of memory to allocate from, this specifies the
+# number of memory regions that the memory manager must
+# handle and enables the API mm_addregion(start, end);
+# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
+# time console output
+# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz
+# or MSEC_PER_TICK=10. This setting may be defined to
+# inform NuttX that the processor hardware is providing
+# system timer interrupts at some interrupt interval other
+# than 10 msec.
+# CONFIG_RR_INTERVAL - The round robin timeslice will be set
+# this number of milliseconds; Round robin scheduling can
+# be disabled by setting this value to zero.
+# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
+# scheduler to monitor system performance
+# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
+# task name to save in the TCB. Useful if scheduler
+# instrumentation is selected. Set to zero to disable.
+# CONFIG_JULIAN_TIME - Enables Julian time conversions
+# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
+# Used to initialize the internal time logic.
+# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
+# provides /dev/console. Enables stdout, stderr, stdin.
+# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
+# driver (minimul support)
+# CONFIG_MUTEX_TYPES: Set to enable support for recursive and
+# errorcheck mutexes. Enables pthread_mutexattr_settype().
+# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority
+# inheritance on mutexes and semaphores.
+# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
+# inheritance is enabled. It defines the maximum number of
+# different threads (minus one) that can take counts on a
+# semaphore with priority inheritance support. This may be
+# set to zero if priority inheritance is disabled OR if you
+# are only using semaphores as mutexes (only one holder) OR
+# if no more than two threads participate using a counting
+# semaphore.
+# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled,
+# then this setting is the maximum number of higher priority
+# threads (minus 1) than can be waiting for another thread
+# to release a count on a semaphore. This value may be set
+# to zero if no more than one thread is expected to wait for
+# a semaphore.
+# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors
+# by task_create() when a new task is started. If set, all
+# files/drivers will appear to be closed in the new task.
+# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first
+# three file descriptors (stdin, stdout, stderr) by task_create()
+# when a new task is started. If set, all files/drivers will
+# appear to be closed in the new task except for stdin, stdout,
+# and stderr.
+# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket
+# desciptors by task_create() when a new task is started. If
+# set, all sockets will appear to be closed in the new task.
+#
+#CONFIG_APPS_DIR=
+CONFIG_DEBUG=y
+CONFIG_DEBUG_VERBOSE=y
+CONFIG_DEBUG_SYMBOLS=n
+CONFIG_DEBUG_GRAPHICS=y
+CONFIG_HAVE_CXX=n
+CONFIG_MM_REGIONS=1
+CONFIG_ARCH_LOWPUTC=y
+CONFIG_RR_INTERVAL=0
+CONFIG_SCHED_INSTRUMENTATION=n
+CONFIG_TASK_NAME_SIZE=32
+CONFIG_START_YEAR=2008
+CONFIG_START_MONTH=11
+CONFIG_START_DAY=28
+CONFIG_JULIAN_TIME=n
+CONFIG_DEV_CONSOLE=y
+CONFIG_DEV_LOWCONSOLE=n
+CONFIG_MUTEX_TYPES=n
+CONFIG_PRIORITY_INHERITANCE=n
+CONFIG_SEM_PREALLOCHOLDERS=0
+CONFIG_SEM_NNESTPRIO=0
+CONFIG_FDCLONE_DISABLE=n
+CONFIG_FDCLONE_STDIO=n
+CONFIG_SDCLONE_DISABLE=y
+
+#
+# The following can be used to disable categories of
+# APIs supported by the OS. If the compiler supports
+# weak functions, then it should not be necessary to
+# disable functions unless you want to restrict usage
+# of those APIs.
+#
+# There are certain dependency relationships in these
+# features.
+#
+# o mq_notify logic depends on signals to awaken tasks
+# waiting for queues to become full or empty.
+# o pthread_condtimedwait() depends on signals to wake
+# up waiting tasks.
+#
+CONFIG_DISABLE_CLOCK=n
+CONFIG_DISABLE_POSIX_TIMERS=y
+CONFIG_DISABLE_PTHREAD=n
+CONFIG_DISABLE_SIGNALS=n
+CONFIG_DISABLE_MQUEUE=n
+CONFIG_DISABLE_MOUNTPOINT=y
+CONFIG_DISABLE_ENVIRON=y
+CONFIG_DISABLE_POLL=y
+
+#
+# Misc libc settings
+#
+# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
+# little smaller if we do not support fieldwidthes
+#
+CONFIG_NOPRINTF_FIELDWIDTH=n
+
+#
+# Allow for architecture optimized implementations
+#
+# The architecture can provide optimized versions of the
+# following to improve sysem performance
+#
+CONFIG_ARCH_MEMCPY=n
+CONFIG_ARCH_MEMCMP=n
+CONFIG_ARCH_MEMMOVE=n
+CONFIG_ARCH_MEMSET=n
+CONFIG_ARCH_STRCMP=n
+CONFIG_ARCH_STRCPY=n
+CONFIG_ARCH_STRNCPY=n
+CONFIG_ARCH_STRLEN=n
+CONFIG_ARCH_STRNLEN=n
+CONFIG_ARCH_BZERO=n
+
+#
+# General build options
+#
+# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
+# BSPs from www.ridgerun.com using the tools/mkimage.sh script
+# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format
+# used with many different loaders using the GNU objcopy program
+# Should not be selected if you are not using the GNU toolchain.
+# CONFIG_RAW_BINARY - make a raw binary format file used with many
+# different loaders using the GNU objcopy program. This option
+# should not be selected if you are not using the GNU toolchain.
+# CONFIG_HAVE_LIBM - toolchain supports libm.a
+#
+CONFIG_RRLOAD_BINARY=n
+CONFIG_INTELHEX_BINARY=n
+CONFIG_RAW_BINARY=n
+CONFIG_HAVE_LIBM=y
+
+#
+# Sizes of configurable things (0 disables)
+#
+# CONFIG_MAX_TASKS - The maximum number of simultaneously
+# active tasks. This value must be a power of two.
+# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
+# of parameters that a task may receive (i.e., maxmum value
+# of 'argc')
+# CONFIG_NPTHREAD_KEYS - The number of items of thread-
+# specific data that can be retained
+# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
+# descriptors (one for each open)
+# CONFIG_NFILE_STREAMS - The maximum number of streams that
+# can be fopen'ed
+# CONFIG_NAME_MAX - The maximum size of a file name.
+# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
+# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_NUNGET_CHARS - Number of characters that can be
+# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
+# structures. The system manages a pool of preallocated
+# message structures to minimize dynamic allocations
+# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
+# a fixed payload size given by this settin (does not include
+# other message structure overhead.
+# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
+# can be passed to a watchdog handler
+# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
+# structures. The system manages a pool of preallocated
+# watchdog structures to minimize dynamic allocations
+# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
+# timer structures. The system manages a pool of preallocated
+# timer structures to minimize dynamic allocations. Set to
+# zero for all dynamic allocations.
+#
+CONFIG_MAX_TASKS=16
+CONFIG_MAX_TASK_ARGS=4
+CONFIG_NPTHREAD_KEYS=4
+CONFIG_NFILE_DESCRIPTORS=16
+CONFIG_NFILE_STREAMS=16
+CONFIG_NAME_MAX=32
+CONFIG_STDIO_BUFFER_SIZE=1024
+CONFIG_NUNGET_CHARS=2
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_MQ_MAXMSGSIZE=32
+CONFIG_MAX_WDOGPARMS=4
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_PREALLOC_TIMERS=8
+
+#
+# Framebuffer driver options
+CONFIG_FB_CMAP=n
+CONFIG_FB_HWCURSOR=n
+CONFIG_FB_HWCURSORIMAGE=n
+#CONFIG_FB_HWCURSORSIZE
+#CONFIG_FB_TRANSPARENCY
+
+#
+# FAT filesystem configuration
+# CONFIG_FS_FAT - Enable FAT filesystem support
+# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
+CONFIG_FS_FAT=n
+CONFIG_FS_ROMFS=n
+
+#
+# TCP/IP and UDP support via uIP
+# CONFIG_NET - Enable or disable all network features
+# CONFIG_NET_IPv6 - Build in support for IPv6
+# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
+# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
+# CONFIG_NET_BUFSIZE - uIP buffer size
+# CONFIG_NET_TCP - TCP support on or off
+# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
+# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
+# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
+# CONFIG_NET_TCPBACKLOG - Incoming connections pend in a backlog until
+# accept() is called. The size of the backlog is selected when listen() is called.
+# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
+# CONFIG_NET_UDP - UDP support on or off
+# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
+# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
+# CONFIG_NET_ICMP - ICMP ping response support on or off
+# CONFIG_NET_ICMP_PING - ICMP ping request support on or off
+# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
+# CONFIG_NET_STATISTICS - uIP statistics on or off
+# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
+# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
+# CONFIG_NET_BROADCAST - Broadcast support
+# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
+#
+CONFIG_NET=n
+CONFIG_NET_IPv6=n
+CONFIG_NSOCKET_DESCRIPTORS=0
+CONFIG_NET_SOCKOPTS=y
+CONFIG_NET_BUFSIZE=420
+CONFIG_NET_TCP=n
+CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_UDP=n
+CONFIG_NET_UDP_CHECKSUMS=y
+#CONFIG_NET_UDP_CONNS=10
+CONFIG_NET_ICMP=n
+CONFIG_NET_ICMP_PING=n
+#CONFIG_NET_PINGADDRCONF=0
+CONFIG_NET_STATISTICS=y
+#CONFIG_NET_RECEIVE_WINDOW=
+#CONFIG_NET_ARPTAB_SIZE=8
+CONFIG_NET_BROADCAST=n
+#CONFIG_NET_FWCACHE_SIZE=2
+
+#
+# UIP Network Utilities
+# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
+# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
+CONFIG_NET_DHCP_LIGHT=n
+CONFIG_NET_RESOLV_ENTRIES=4
+
+#
+# Graphics related configuration settings
+#
+# CONFIG_NX
+# Enables overall support for graphics library and NX
+# CONFIG_NX_MULTIUSER
+# Configures NX in multi-user mode
+# CONFIG_NX_NPLANES
+# Some YUV color formats requires support for multiple planes,
+# one for each color component. Unless you have such special
+# hardware, this value should be undefined or set to 1
+# CONFIG_NX_DISABLE_1BPP, CONFIG_NX_DISABLE_2BPP,
+# CONFIG_NX_DISABLE_4BPP, CONFIG_NX_DISABLE_8BPP,
+# CONFIG_NX_DISABLE_16BPP, CONFIG_NX_DISABLE_24BPP, and
+# CONFIG_NX_DISABLE_32BPP
+# NX supports a variety of pixel depths. You can save some
+# memory by disabling support for unused color depths.
+# CONFIG_NX_PACKEDMSFIRST
+# If a pixel depth of less than 8-bits is used, then NX needs
+# to know if the pixels pack from the MS to LS or from LS to MS
+# CONFIG_NX_MOUSE
+# Build in support for mouse input
+# CONFIG_NX_KBD
+# Build in support of keypad/keyboard input
+# CONFIG_NXTK_BORDERWIDTH
+# Specifies with with of the border (in pixels) used with
+# framed windows. The default is 4.
+# CONFIG_NXTK_BORDERCOLOR1 and CONFIG_NXTK_BORDERCOLOR2
+# Specify the colors of the border used with framed windows.
+# CONFIG_NXTK_BORDERCOLOR2 is the shadow side color and so
+# is normally darker. The default is medium and dark grey,
+# respectively
+# CONFIG_NXTK_AUTORAISE
+# If set, a window will be raised to the top if the mouse position
+# is over a visible portion of the window. Default: A mouse
+# button must be clicked over a visible portion of the window.
+# CONFIG_NXFONTS_CHARBITS
+# The number of bits in the character set. Current options are
+# only 7 and 8. The default is 7.
+# CONFIG_NXFONT_SANS23X27
+# At present, there is only one font. But if there were were more,
+# then this option would select the sans serif font.
+#
+# NX Multi-user only options:
+#
+# CONFIG_NX_BLOCKING
+# Open the client message queues in blocking mode. In this case,
+# nx_eventhandler() will not return until a message is received and processed.
+# CONFIG_NX_MXSERVERMSGS and CONFIG_NX_MXCLIENTMSGS
+# Specifies the maximum number of messages that can fit in
+# the message queues. No additional resources are allocated, but
+# this can be set to prevent flooding of the client or server with
+# too many messages (CONFIG_PREALLOC_MQ_MSGS controls how many
+# messages are pre-allocated).
+#
+CONFIG_NX=y
+CONFIG_NX_MULTIUSER=n
+CONFIG_NX_NPLANES=1
+CONFIG_NX_DISABLE_1BPP=y
+CONFIG_NX_DISABLE_2BPP=y
+CONFIG_NX_DISABLE_4BPP=y
+CONFIG_NX_DISABLE_8BPP=n
+CONFIG_NX_DISABLE_16BPP=y
+CONFIG_NX_DISABLE_24BPP=y
+CONFIG_NX_DISABLE_32BPP=y
+CONFIG_NX_PACKEDMSFIRST=n
+CONFIG_NX_MOUSE=y
+CONFIG_NX_KBD=y
+#CONFIG_NXTK_BORDERWIDTH=4
+#CONFIG_NXTK_BORDERCOLOR1
+#CONFIG_NXTK_BORDERCOLOR2
+CONFIG_NXTK_AUTORAISE=n
+CONFIG_NXFONT_SANS23X27=y
+CONFIG_NXFONTS_CHARBITS=7
+CONFIG_NX_BLOCKING=y
+CONFIG_NX_MXSERVERMSGS=32
+CONFIG_NX_MXCLIENTMSGS=16
+
+#
+# Settings for examples/uip
+CONFIG_EXAMPLE_UIP_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_UIP_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_UIP_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_UIP_DHCPC=n
+
+#
+# Settings for examples/nettest
+CONFIG_EXAMPLE_NETTEST_SERVER=n
+CONFIG_EXAMPLE_NETTEST_PERFORMANCE=n
+CONFIG_EXAMPLE_NETTEST_NOMAC=n
+CONFIG_EXAMPLE_NETTEST_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
+
+#
+# Settings for examples/ostest
+CONFIG_EXAMPLES_OSTEST_LOOPS=100
+CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
+
+#
+# Settings for apps/nshlib
+#
+# CONFIG_NSH_FILEIOSIZE - Size of a static I/O buffer
+# CONFIG_NSH_STRERROR - Use strerror(errno)
+# CONFIG_NSH_LINELEN - Maximum length of one command line
+# CONFIG_NSH_STACKSIZE - Stack size to use for new threads.
+# CONFIG_NSH_NESTDEPTH - Max number of nested if-then[-else]-fi
+# CONFIG_NSH_DISABLESCRIPT - Disable scripting support
+# CONFIG_NSH_DISABLEBG - Disable background commands
+# CONFIG_NSH_ROMFSETC - Use startup script in /etc
+# CONFIG_NSH_CONSOLE - Use serial console front end
+# CONFIG_NSH_TELNET - Use telnetd console front end
+#
+# If CONFIG_NSH_TELNET is selected:
+# CONFIG_NSH_IOBUFFER_SIZE -- Telnetd I/O buffer size
+# CONFIG_NSH_DHCPC - Obtain address using DHCP
+# CONFIG_NSH_IPADDR - Provides static IP address
+# CONFIG_NSH_DRIPADDR - Provides static router IP address
+# CONFIG_NSH_NETMASK - Provides static network mask
+# CONFIG_NSH_NOMAC - Use a bogus MAC address
+#
+# If CONFIG_NSH_ROMFSETC is selected:
+# CONFIG_NSH_ROMFSMOUNTPT - ROMFS mountpoint
+# CONFIG_NSH_INITSCRIPT - Relative path to init script
+# CONFIG_NSH_ROMFSDEVNO - ROMFS RAM device minor
+# CONFIG_NSH_ROMFSSECTSIZE - ROMF sector size
+# CONFIG_NSH_FATDEVNO - FAT FS RAM device minor
+# CONFIG_NSH_FATSECTSIZE - FAT FS sector size
+# CONFIG_NSH_FATNSECTORS - FAT FS number of sectors
+# CONFIG_NSH_FATMOUNTPT - FAT FS mountpoint
+CONFIG_NSH_FILEIOSIZE=1024
+CONFIG_NSH_STRERROR=n
+CONFIG_NSH_LINELEN=80
+CONFIG_NSH_STACKSIZE=4096
+CONFIG_NSH_NESTDEPTH=3
+CONFIG_NSH_DISABLESCRIPT=n
+CONFIG_NSH_DISABLEBG=n
+CONFIG_NSH_ROMFSETC=y
+CONFIG_NSH_CONSOLE=y
+CONFIG_NSH_TELNET=n
+CONFIG_NSH_IOBUFFER_SIZE=512
+CONFIG_NSH_DHCPC=n
+CONFIG_NSH_NOMAC=n
+CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
+CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
+CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_NSH_ROMFSMOUNTPT="/etc"
+CONFIG_NSH_INITSCRIPT="init.d/rcS"
+CONFIG_NSH_ROMFSDEVNO=1
+CONFIG_NSH_ROMFSSECTSIZE=64
+CONFIG_NSH_FATDEVNO=2
+CONFIG_NSH_FATSECTSIZE=512
+CONFIG_NSH_FATNSECTORS=1024
+CONFIG_NSH_FATMOUNTPT=/tmp
+
+#
+# Settings for examples/nx
+#
+# CONFIG_EXAMPLES_NX_VPLANE -- The plane to select from the frame-
+# buffer driver for use in the test. Default: 0
+# CONFIG_EXAMPLES_NX_BGCOLOR -- The color of the background. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_COLOR1 -- The color of window 1. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_COLOR2 -- The color of window 2. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_TBCOLOR -- The color of the toolbar. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_FONTCOLOR -- The color of the toolbar. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_BPP -- Pixels per pixel to use. Valid options
+# include 2, 4, 8, 16, 24, and 32. Default is 32.
+# CONFIG_EXAMPLES_NX_RAWWINDOWS -- Use raw windows; Default is to
+# use pretty, framed NXTK windows with toolbars.
+# CONFIG_EXAMPLES_NX_STACKSIZE -- The stacksize to use when creating
+# the NX server. Default 2048
+# CONFIG_EXAMPLES_NX_CLIENTPRIO -- The client priority. Default: 80
+# CONFIG_EXAMPLES_NX_SERVERPRIO -- The server priority. Default: 120
+# CONFIG_EXAMPLES_NX_NOTIFYSIGNO -- The signal number to use with
+# nx_eventnotify(). Default: 4
+CONFIG_EXAMPLES_NX_VPLANE=0
+#CONFIG_EXAMPLES_NX_BGCOLOR
+#CONFIG_EXAMPLES_NX_COLOR1
+#CONFIG_EXAMPLES_NX_COLOR2
+#CONFIG_EXAMPLES_NX_TBCOLOR
+#CONFIG_EXAMPLES_NX_FONTCOLOR
+CONFIG_EXAMPLES_NX_BPP=CONFIG_SIM_FBBPP
+CONFIG_EXAMPLES_NX_RAWWINDOWS=n
+CONFIG_EXAMPLES_NX_STACKSIZE=8192
+CONFIG_EXAMPLES_NX_CLIENTPRIO=80
+CONFIG_EXAMPLES_NX_SERVERPRIO=120
+CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4
+
+#
+# Settings for examples/nxlines
+#
+# CONFIG_EXAMPLES_NXLINES_BUILTIN -- Build the NXLINES example as a "built-in"
+# that can be executed from the NSH command line
+# CONFIG_EXAMPLES_NXLINES_VPLANE -- The plane to select from the frame-
+# buffer driver for use in the test. Default: 0
+# CONFIG_EXAMPLES_NXLINES_DEVNO - The LCD device to select from the LCD
+# driver for use in the test: Default: 0
+# CONFIG_EXAMPLES_NXLINES_BGCOLOR -- The color of the background. Default
+# depends on CONFIG_EXAMPLES_NXLINES_BPP.
+# CONFIG_EXAMPLES_NXLINES_LINEWIDTH - Selects the width of the lines in
+# pixels (default: 16)
+# CONFIG_EXAMPLES_NXLINES_LINECOLOR -- The color of the central lines drawn
+# in the background window. Default depends on CONFIG_EXAMPLES_NXLINES_BPP
+# (there really is no meaningful default).
+# CONFIG_EXAMPLES_NXLINES_BORDERWIDTH -- The width of the circular border
+# drawn in the background window. (default: 4).
+# CONFIG_EXAMPLES_NXLINES_BORDERCOLOR -- The color of the circular border
+# drawn in the background window. Default depends on CONFIG_EXAMPLES_NXLINES_BPP
+# (there really is no meaningful default).
+# CONFIG_EXAMPLES_NXLINES_CIRCLECOLOR -- The color of the circular region
+# filled in the background window. Default depends on CONFIG_EXAMPLES_NXLINES_BPP
+# (there really is no meaningful default).
+# CONFIG_EXAMPLES_NXLINES_BPP -- Pixels per pixel to use. Valid options
+# include 2, 4, 8, 16, 24, and 32. Default is 16.
+# CONFIG_EXAMPLES_NXLINES_EXTERNINIT - The driver for the graphics device on
+# this platform requires some unusual initialization. This is the
+# for, for example, SPI LCD/OLED devices. If this configuration is
+# selected, then the platform code must provide an LCD initialization
+# function.
+#
+CONFIG_EXAMPLES_NXLINES_BUILTIN=n
+CONFIG_EXAMPLES_NXLINES_VPLANE=0
+CONFIG_EXAMPLES_NXLINES_DEVNO=0
+#CONFIG_EXAMPLES_NXLINES_BGCOLOR=
+CONFIG_EXAMPLES_NXLINES_LINEWIDTH=16
+#CONFIG_EXAMPLES_NXLINES_LINECOLOR=
+CONFIG_EXAMPLES_NXLINES_BPP=CONFIG_SIM_FBBPP
+CONFIG_EXAMPLES_NXLINES_EXTERNINIT=n
+
+#
+# Settings for examples/mount
+CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
+#CONFIG_EXAMPLES_MOUNT_NSECTORS=2048
+#CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512
+#CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1
+
+#
+# Stack and heap information
+#
+# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
+# operation from FLASH but must copy initialized .data sections to RAM.
+# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
+# but copy themselves entirely into RAM for better performance.
+# CONFIG_CUSTOM_STACK - The up_ implementation will handle
+# all stack operations outside of the nuttx model.
+# CONFIG_STACK_POINTER - The initial stack pointer
+# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack.
+# This is the thread that (1) performs the inital boot of the system up
+# to the point where user_start() is spawned, and (2) there after is the
+# IDLE thread that executes only when there is no other thread ready to
+# run.
+# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate
+# for the main user thread that begins at the user_start() entry point.
+# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
+# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
+# CONFIG_HEAP_BASE - The beginning of the heap
+# CONFIG_HEAP_SIZE - The size of the heap
+#
+CONFIG_BOOT_RUNFROMFLASH=n
+CONFIG_BOOT_COPYTORAM=n
+CONFIG_CUSTOM_STACK=n
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_USERMAIN_STACKSIZE=4096
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=8192
+CONFIG_HEAP_BASE=
+CONFIG_HEAP_SIZE=
diff --git a/nuttx/configs/sim/nx/setenv.sh b/nuttx/configs/sim/nx/setenv.sh
new file mode 100755
index 000000000..6a5a7e6c0
--- /dev/null
+++ b/nuttx/configs/sim/nx/setenv.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# sim/nx/setenv.sh
+#
+# Copyright (C) 2008 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+if [ "$(basename $0)" = "setenv.sh" ] ; then
+ echo "You must source this script, not run it!" 1>&2
+ exit 1
+fi
+
+if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
+
+#export NUTTX_BIN=
+#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
+
+echo "PATH : ${PATH}"
diff --git a/nuttx/configs/sim/nx11/Make.defs b/nuttx/configs/sim/nx11/Make.defs
new file mode 100644
index 000000000..2dfda3e65
--- /dev/null
+++ b/nuttx/configs/sim/nx11/Make.defs
@@ -0,0 +1,121 @@
+############################################################################
+# configs/sim/nx11/Make.defs
+#
+# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+
+HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ ARCHOPTIMIZATION = -g
+else
+ ARCHOPTIMIZATION = -O2
+endif
+
+ARCHCPUFLAGS = -fno-builtin
+ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
+ARCHPICFLAGS = -fpic
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
+ARCHDEFINES =
+ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ARCHSCRIPT =
+
+CROSSDEV =
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+OBJEXT = .o
+LIBEXT = .a
+
+ifeq ($(HOSTOS),Cygwin)
+ EXEEXT = .exe
+else
+ EXEEXT =
+endif
+
+ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
+ LDFLAGS += -g
+endif
+
+define PREPROCESS
+ @echo "CPP: $1->$2"
+ @$(CPP) $(CPPFLAGS) $1 -o $2
+endef
+
+define COMPILE
+ @echo "CC: $1"
+ @$(CC) -c $(CFLAGS) $1 -o $2
+endef
+
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
+define ASSEMBLE
+ @echo "AS: $1"
+ @$(CC) -c $(AFLAGS) $1 -o $2
+endef
+
+define ARCHIVE
+ echo "AR: $2"; \
+ $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
+endef
+
+define CLEAN
+ @rm -f *.o *.a
+endef
+
+MKDEP = $(TOPDIR)/tools/mkdeps.sh
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+HOSTLDFLAGS =
diff --git a/nuttx/configs/sim/nx11/appconfig b/nuttx/configs/sim/nx11/appconfig
new file mode 100644
index 000000000..d99648abc
--- /dev/null
+++ b/nuttx/configs/sim/nx11/appconfig
@@ -0,0 +1,39 @@
+############################################################################
+# configs/sim/nx11/appconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+# Path to example in apps/examples containing the user_start entry point
+
+CONFIGURED_APPS += examples/nx
+
diff --git a/nuttx/configs/sim/nx11/defconfig b/nuttx/configs/sim/nx11/defconfig
new file mode 100644
index 000000000..420231d48
--- /dev/null
+++ b/nuttx/configs/sim/nx11/defconfig
@@ -0,0 +1,572 @@
+############################################################################
+# sim/nx11/defconfig
+#
+# Copyright (C) 2008, 2010-2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+#
+# Architecture selection
+#
+# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
+# processor architecture.
+# CONFIG_ARCH_name - for use in C code. This identifies the particular
+# processor architecture (CONFIG_ARCH_SIM).
+# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
+# the board that supports the particular chip or SoC.
+# CONFIG_ARCH_BOARD_name - for use in C code
+# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
+#
+CONFIG_ARCH=sim
+CONFIG_ARCH_SIM=y
+CONFIG_ARCH_BOARD=sim
+CONFIG_ARCH_BOARD_SIM=y
+
+#
+# Simulated framebuffer configuration
+#
+CONFIG_SIM_X11FB=y
+CONFIG_SIM_FBWIDTH=480
+CONFIG_SIM_FBHEIGHT=240
+CONFIG_SIM_FBBPP=32
+
+#
+# Simulated touchscreen configuration
+# (Set both of the following to 'y' to enable)
+#
+CONFIG_INPUT=n
+CONFIG_SIM_TOUCHSCREEN=n
+
+#
+# General OS setup
+#
+# CONFIG_APPS_DIR - Identifies the relative path to the directory
+# that builds the application to link with NuttX. Default: ../apps
+# CONFIG_DEBUG - enables built-in debug options
+# CONFIG_DEBUG_VERBOSE - enables verbose debug output
+# CONFIG_DEBUG_SYMBOLS - build without optimization and with
+# debug symbols (needed for use with a debugger).
+# CONFIG_MM_REGIONS - If the architecture includes multiple
+# regions of memory to allocate from, this specifies the
+# number of memory regions that the memory manager must
+# handle and enables the API mm_addregion(start, end);
+# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
+# time console output
+# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz
+# or MSEC_PER_TICK=10. This setting may be defined to
+# inform NuttX that the processor hardware is providing
+# system timer interrupts at some interrupt interval other
+# than 10 msec.
+# CONFIG_RR_INTERVAL - The round robin timeslice will be set
+# this number of milliseconds; Round robin scheduling can
+# be disabled by setting this value to zero.
+# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
+# scheduler to monitor system performance
+# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
+# task name to save in the TCB. Useful if scheduler
+# instrumentation is selected. Set to zero to disable.
+# CONFIG_JULIAN_TIME - Enables Julian time conversions
+# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
+# Used to initialize the internal time logic.
+# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
+# provides /dev/console. Enables stdout, stderr, stdin.
+# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
+# driver (minimul support)
+# CONFIG_MUTEX_TYPES: Set to enable support for recursive and
+# errorcheck mutexes. Enables pthread_mutexattr_settype().
+# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority
+# inheritance on mutexes and semaphores.
+# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
+# inheritance is enabled. It defines the maximum number of
+# different threads (minus one) that can take counts on a
+# semaphore with priority inheritance support. This may be
+# set to zero if priority inheritance is disabled OR if you
+# are only using semaphores as mutexes (only one holder) OR
+# if no more than two threads participate using a counting
+# semaphore.
+# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled,
+# then this setting is the maximum number of higher priority
+# threads (minus 1) than can be waiting for another thread
+# to release a count on a semaphore. This value may be set
+# to zero if no more than one thread is expected to wait for
+# a semaphore.
+# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors
+# by task_create() when a new task is started. If set, all
+# files/drivers will appear to be closed in the new task.
+# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first
+# three file descriptors (stdin, stdout, stderr) by task_create()
+# when a new task is started. If set, all files/drivers will
+# appear to be closed in the new task except for stdin, stdout,
+# and stderr.
+# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket
+# desciptors by task_create() when a new task is started. If
+# set, all sockets will appear to be closed in the new task.
+#
+#CONFIG_APPS_DIR=
+CONFIG_DEBUG=y
+CONFIG_DEBUG_VERBOSE=y
+CONFIG_DEBUG_SYMBOLS=n
+CONFIG_DEBUG_GRAPHICS=y
+CONFIG_MM_REGIONS=1
+CONFIG_ARCH_LOWPUTC=y
+CONFIG_RR_INTERVAL=0
+CONFIG_SCHED_INSTRUMENTATION=n
+CONFIG_TASK_NAME_SIZE=32
+CONFIG_START_YEAR=2008
+CONFIG_START_MONTH=11
+CONFIG_START_DAY=28
+CONFIG_JULIAN_TIME=n
+CONFIG_DEV_CONSOLE=y
+CONFIG_DEV_LOWCONSOLE=n
+CONFIG_MUTEX_TYPES=n
+CONFIG_PRIORITY_INHERITANCE=n
+CONFIG_SEM_PREALLOCHOLDERS=0
+CONFIG_SEM_NNESTPRIO=0
+CONFIG_FDCLONE_DISABLE=n
+CONFIG_FDCLONE_STDIO=n
+CONFIG_SDCLONE_DISABLE=y
+
+#
+# The following can be used to disable categories of
+# APIs supported by the OS. If the compiler supports
+# weak functions, then it should not be necessary to
+# disable functions unless you want to restrict usage
+# of those APIs.
+#
+# There are certain dependency relationships in these
+# features.
+#
+# o mq_notify logic depends on signals to awaken tasks
+# waiting for queues to become full or empty.
+# o pthread_condtimedwait() depends on signals to wake
+# up waiting tasks.
+#
+CONFIG_DISABLE_CLOCK=n
+CONFIG_DISABLE_POSIX_TIMERS=y
+CONFIG_DISABLE_PTHREAD=n
+CONFIG_DISABLE_SIGNALS=n
+CONFIG_DISABLE_MQUEUE=n
+CONFIG_DISABLE_MOUNTPOINT=y
+CONFIG_DISABLE_ENVIRON=y
+CONFIG_DISABLE_POLL=y
+
+#
+# Misc libc settings
+#
+# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
+# little smaller if we do not support fieldwidthes
+#
+CONFIG_NOPRINTF_FIELDWIDTH=n
+
+#
+# Allow for architecture optimized implementations
+#
+# The architecture can provide optimized versions of the
+# following to improve sysem performance
+#
+CONFIG_ARCH_MEMCPY=n
+CONFIG_ARCH_MEMCMP=n
+CONFIG_ARCH_MEMMOVE=n
+CONFIG_ARCH_MEMSET=n
+CONFIG_ARCH_STRCMP=n
+CONFIG_ARCH_STRCPY=n
+CONFIG_ARCH_STRNCPY=n
+CONFIG_ARCH_STRLEN=n
+CONFIG_ARCH_STRNLEN=n
+CONFIG_ARCH_BZERO=n
+
+#
+# General build options
+#
+# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
+# BSPs from www.ridgerun.com using the tools/mkimage.sh script
+# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format
+# used with many different loaders using the GNU objcopy program
+# Should not be selected if you are not using the GNU toolchain.
+# CONFIG_RAW_BINARY - make a raw binary format file used with many
+# different loaders using the GNU objcopy program. This option
+# should not be selected if you are not using the GNU toolchain.
+# CONFIG_HAVE_LIBM - toolchain supports libm.a
+#
+CONFIG_RRLOAD_BINARY=n
+CONFIG_INTELHEX_BINARY=n
+CONFIG_RAW_BINARY=n
+CONFIG_HAVE_LIBM=y
+
+#
+# Sizes of configurable things (0 disables)
+#
+# CONFIG_MAX_TASKS - The maximum number of simultaneously
+# active tasks. This value must be a power of two.
+# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
+# of parameters that a task may receive (i.e., maxmum value
+# of 'argc')
+# CONFIG_NPTHREAD_KEYS - The number of items of thread-
+# specific data that can be retained
+# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
+# descriptors (one for each open)
+# CONFIG_NFILE_STREAMS - The maximum number of streams that
+# can be fopen'ed
+# CONFIG_NAME_MAX - The maximum size of a file name.
+# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
+# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_NUNGET_CHARS - Number of characters that can be
+# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
+# structures. The system manages a pool of preallocated
+# message structures to minimize dynamic allocations
+# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
+# a fixed payload size given by this settin (does not include
+# other message structure overhead.
+# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
+# can be passed to a watchdog handler
+# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
+# structures. The system manages a pool of preallocated
+# watchdog structures to minimize dynamic allocations
+# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
+# timer structures. The system manages a pool of preallocated
+# timer structures to minimize dynamic allocations. Set to
+# zero for all dynamic allocations.
+#
+CONFIG_MAX_TASKS=16
+CONFIG_MAX_TASK_ARGS=4
+CONFIG_NPTHREAD_KEYS=4
+CONFIG_NFILE_DESCRIPTORS=16
+CONFIG_NFILE_STREAMS=16
+CONFIG_NAME_MAX=32
+CONFIG_STDIO_BUFFER_SIZE=1024
+CONFIG_NUNGET_CHARS=2
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_MQ_MAXMSGSIZE=32
+CONFIG_MAX_WDOGPARMS=4
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_PREALLOC_TIMERS=8
+
+#
+# Framebuffer driver options
+CONFIG_FB_CMAP=y
+CONFIG_FB_HWCURSOR=n
+CONFIG_FB_HWCURSORIMAGE=n
+#CONFIG_FB_HWCURSORSIZE
+#CONFIG_FB_TRANSPARENCY
+
+#
+# FAT filesystem configuration
+# CONFIG_FS_FAT - Enable FAT filesystem support
+# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
+CONFIG_FS_FAT=n
+CONFIG_FS_ROMFS=n
+
+#
+# TCP/IP and UDP support via uIP
+# CONFIG_NET - Enable or disable all network features
+# CONFIG_NET_IPv6 - Build in support for IPv6
+# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
+# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
+# CONFIG_NET_BUFSIZE - uIP buffer size
+# CONFIG_NET_TCP - TCP support on or off
+# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
+# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
+# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
+# CONFIG_NET_TCPBACKLOG - Incoming connections pend in a backlog until
+# accept() is called. The size of the backlog is selected when listen() is called.
+# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
+# CONFIG_NET_UDP - UDP support on or off
+# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
+# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
+# CONFIG_NET_ICMP - ICMP ping response support on or off
+# CONFIG_NET_ICMP_PING - ICMP ping request support on or off
+# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
+# CONFIG_NET_STATISTICS - uIP statistics on or off
+# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
+# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
+# CONFIG_NET_BROADCAST - Broadcast support
+# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
+#
+CONFIG_NET=n
+CONFIG_NET_IPv6=n
+CONFIG_NSOCKET_DESCRIPTORS=0
+CONFIG_NET_SOCKOPTS=y
+CONFIG_NET_BUFSIZE=420
+CONFIG_NET_TCP=n
+CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_UDP=n
+CONFIG_NET_UDP_CHECKSUMS=y
+#CONFIG_NET_UDP_CONNS=10
+CONFIG_NET_ICMP=n
+CONFIG_NET_ICMP_PING=n
+#CONFIG_NET_PINGADDRCONF=0
+CONFIG_NET_STATISTICS=y
+#CONFIG_NET_RECEIVE_WINDOW=
+#CONFIG_NET_ARPTAB_SIZE=8
+CONFIG_NET_BROADCAST=n
+#CONFIG_NET_FWCACHE_SIZE=2
+
+#
+# UIP Network Utilities
+# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
+# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
+CONFIG_NET_DHCP_LIGHT=n
+CONFIG_NET_RESOLV_ENTRIES=4
+
+#
+# Graphics related configuration settings
+#
+# CONFIG_NX
+# Enables overall support for graphics library and NX
+# CONFIG_NX_MULTIUSER
+# Configures NX in multi-user mode
+# CONFIG_NX_NPLANES
+# Some YUV color formats requires support for multiple planes,
+# one for each color component. Unless you have such special
+# hardware, this value should be undefined or set to 1
+# CONFIG_NX_DISABLE_1BPP, CONFIG_NX_DISABLE_2BPP,
+# CONFIG_NX_DISABLE_4BPP, CONFIG_NX_DISABLE_8BPP,
+# CONFIG_NX_DISABLE_16BPP, CONFIG_NX_DISABLE_24BPP, and
+# CONFIG_NX_DISABLE_32BPP
+# NX supports a variety of pixel depths. You can save some
+# memory by disabling support for unused color depths.
+# CONFIG_NX_PACKEDMSFIRST
+# If a pixel depth of less than 8-bits is used, then NX needs
+# to know if the pixels pack from the MS to LS or from LS to MS
+# CONFIG_NX_MOUSE
+# Build in support for mouse input
+# CONFIG_NX_KBD
+# Build in support of keypad/keyboard input
+# CONFIG_NXTK_BORDERWIDTH
+# Specifies with with of the border (in pixels) used with
+# framed windows. The default is 4.
+# CONFIG_NXTK_BORDERCOLOR1 and CONFIG_NXTK_BORDERCOLOR2
+# Specify the colors of the border used with framed windows.
+# CONFIG_NXTK_BORDERCOLOR2 is the shadow side color and so
+# is normally darker. The default is medium and dark grey,
+# respectively
+# CONFIG_NXTK_AUTORAISE
+# If set, a window will be raised to the top if the mouse position
+# is over a visible portion of the window. Default: A mouse
+# button must be clicked over a visible portion of the window.
+# CONFIG_NXFONTS_CHARBITS
+# The number of bits in the character set. Current options are
+# only 7 and 8. The default is 7.
+# CONFIG_NXFONT_SANS23X27
+# At present, there is only one font. But if there were were more,
+# then this option would select the sans serif font.
+#
+# NX Multi-user only options:
+#
+# CONFIG_NX_BLOCKING
+# Open the client message queues in blocking mode. In this case,
+# nx_eventhandler() will not return until a message is received and processed.
+# CONFIG_NX_MXSERVERMSGS and CONFIG_NX_MXCLIENTMSGS
+# Specifies the maximum number of messages that can fit in
+# the message queues. No additional resources are allocated, but
+# this can be set to prevent flooding of the client or server with
+# too many messages (CONFIG_PREALLOC_MQ_MSGS controls how many
+# messages are pre-allocated).
+#
+CONFIG_NX=y
+CONFIG_NX_MULTIUSER=n
+CONFIG_NX_NPLANES=1
+CONFIG_NX_DISABLE_1BPP=y
+CONFIG_NX_DISABLE_2BPP=y
+CONFIG_NX_DISABLE_4BPP=y
+CONFIG_NX_DISABLE_8BPP=y
+CONFIG_NX_DISABLE_16BPP=y
+CONFIG_NX_DISABLE_24BPP=y
+CONFIG_NX_DISABLE_32BPP=n
+CONFIG_NX_PACKEDMSFIRST=n
+CONFIG_NX_MOUSE=y
+CONFIG_NX_KBD=y
+#CONFIG_NXTK_BORDERWIDTH=4
+#CONFIG_NXTK_BORDERCOLOR1
+#CONFIG_NXTK_BORDERCOLOR2
+CONFIG_NXTK_AUTORAISE=n
+CONFIG_NXFONT_SANS23X27=y
+CONFIG_NXFONTS_CHARBITS=7
+CONFIG_NX_BLOCKING=y
+CONFIG_NX_MXSERVERMSGS=32
+CONFIG_NX_MXCLIENTMSGS=16
+
+#
+# Settings for examples/uip
+CONFIG_EXAMPLE_UIP_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_UIP_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_UIP_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_UIP_DHCPC=n
+
+#
+# Settings for examples/nettest
+CONFIG_EXAMPLE_NETTEST_SERVER=n
+CONFIG_EXAMPLE_NETTEST_PERFORMANCE=n
+CONFIG_EXAMPLE_NETTEST_NOMAC=n
+CONFIG_EXAMPLE_NETTEST_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
+
+#
+# Settings for examples/ostest
+CONFIG_EXAMPLES_OSTEST_LOOPS=100
+CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
+
+#
+# Settings for apps/nshlib
+#
+# CONFIG_NSH_FILEIOSIZE - Size of a static I/O buffer
+# CONFIG_NSH_STRERROR - Use strerror(errno)
+# CONFIG_NSH_LINELEN - Maximum length of one command line
+# CONFIG_NSH_STACKSIZE - Stack size to use for new threads.
+# CONFIG_NSH_NESTDEPTH - Max number of nested if-then[-else]-fi
+# CONFIG_NSH_DISABLESCRIPT - Disable scripting support
+# CONFIG_NSH_DISABLEBG - Disable background commands
+# CONFIG_NSH_ROMFSETC - Use startup script in /etc
+# CONFIG_NSH_CONSOLE - Use serial console front end
+# CONFIG_NSH_TELNET - Use telnetd console front end
+#
+# If CONFIG_NSH_TELNET is selected:
+# CONFIG_NSH_IOBUFFER_SIZE -- Telnetd I/O buffer size
+# CONFIG_NSH_DHCPC - Obtain address using DHCP
+# CONFIG_NSH_IPADDR - Provides static IP address
+# CONFIG_NSH_DRIPADDR - Provides static router IP address
+# CONFIG_NSH_NETMASK - Provides static network mask
+# CONFIG_NSH_NOMAC - Use a bogus MAC address
+#
+# If CONFIG_NSH_ROMFSETC is selected:
+# CONFIG_NSH_ROMFSMOUNTPT - ROMFS mountpoint
+# CONFIG_NSH_INITSCRIPT - Relative path to init script
+# CONFIG_NSH_ROMFSDEVNO - ROMFS RAM device minor
+# CONFIG_NSH_ROMFSSECTSIZE - ROMF sector size
+# CONFIG_NSH_FATDEVNO - FAT FS RAM device minor
+# CONFIG_NSH_FATSECTSIZE - FAT FS sector size
+# CONFIG_NSH_FATNSECTORS - FAT FS number of sectors
+# CONFIG_NSH_FATMOUNTPT - FAT FS mountpoint
+CONFIG_NSH_FILEIOSIZE=1024
+CONFIG_NSH_STRERROR=n
+CONFIG_NSH_LINELEN=80
+CONFIG_NSH_STACKSIZE=4096
+CONFIG_NSH_NESTDEPTH=3
+CONFIG_NSH_DISABLESCRIPT=n
+CONFIG_NSH_DISABLEBG=n
+CONFIG_NSH_ROMFSETC=y
+CONFIG_NSH_CONSOLE=y
+CONFIG_NSH_TELNET=n
+CONFIG_NSH_IOBUFFER_SIZE=512
+CONFIG_NSH_DHCPC=n
+CONFIG_NSH_NOMAC=n
+CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
+CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
+CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_NSH_ROMFSMOUNTPT="/etc"
+CONFIG_NSH_INITSCRIPT="init.d/rcS"
+CONFIG_NSH_ROMFSDEVNO=1
+CONFIG_NSH_ROMFSSECTSIZE=64
+CONFIG_NSH_FATDEVNO=2
+CONFIG_NSH_FATSECTSIZE=512
+CONFIG_NSH_FATNSECTORS=1024
+CONFIG_NSH_FATMOUNTPT=/tmp
+
+#
+# Settings for examples/nx
+#
+# CONFIG_EXAMPLES_NX_VPLANE -- The plane to select from the frame-
+# buffer driver for use in the test. Default: 0
+# CONFIG_EXAMPLES_NX_BGCOLOR -- The color of the background. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_COLOR1 -- The color of window 1. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_COLOR2 -- The color of window 2. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_TBCOLOR -- The color of the toolbar. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_FONTCOLOR -- The color of the toolbar. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_BPP -- Pixels per pixel to use. Valid options
+# include 2, 4, 8, 16, 24, and 32. Default is 32.
+# CONFIG_EXAMPLES_NX_RAWWINDOWS -- Use raw windows; Default is to
+# use pretty, framed NXTK windows with toolbars.
+# CONFIG_EXAMPLES_NX_STACKSIZE -- The stacksize to use when creating
+# the NX server. Default 2048
+# CONFIG_EXAMPLES_NX_CLIENTPRIO -- The client priority. Default: 80
+# CONFIG_EXAMPLES_NX_SERVERPRIO -- The server priority. Default: 120
+# CONFIG_EXAMPLES_NX_NOTIFYSIGNO -- The signal number to use with
+# nx_eventnotify(). Default: 4
+CONFIG_EXAMPLES_NX_VPLANE=0
+#CONFIG_EXAMPLES_NX_BGCOLOR
+#CONFIG_EXAMPLES_NX_COLOR1
+#CONFIG_EXAMPLES_NX_COLOR2
+#CONFIG_EXAMPLES_NX_TBCOLOR
+#CONFIG_EXAMPLES_NX_FONTCOLOR
+CONFIG_EXAMPLES_NX_BPP=CONFIG_SIM_FBBPP
+CONFIG_EXAMPLES_NX_RAWWINDOWS=n
+CONFIG_EXAMPLES_NX_STACKSIZE=8192
+CONFIG_EXAMPLES_NX_CLIENTPRIO=80
+CONFIG_EXAMPLES_NX_SERVERPRIO=120
+CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4
+
+#
+# Settings for examples/mount
+CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
+#CONFIG_EXAMPLES_MOUNT_NSECTORS=2048
+#CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512
+#CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1
+
+#
+# Stack and heap information
+#
+# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
+# operation from FLASH but must copy initialized .data sections to RAM.
+# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
+# but copy themselves entirely into RAM for better performance.
+# CONFIG_CUSTOM_STACK - The up_ implementation will handle
+# all stack operations outside of the nuttx model.
+# CONFIG_STACK_POINTER - The initial stack pointer
+# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack.
+# This is the thread that (1) performs the inital boot of the system up
+# to the point where user_start() is spawned, and (2) there after is the
+# IDLE thread that executes only when there is no other thread ready to
+# run.
+# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate
+# for the main user thread that begins at the user_start() entry point.
+# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
+# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
+# CONFIG_HEAP_BASE - The beginning of the heap
+# CONFIG_HEAP_SIZE - The size of the heap
+#
+CONFIG_BOOT_RUNFROMFLASH=n
+CONFIG_BOOT_COPYTORAM=n
+CONFIG_CUSTOM_STACK=n
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_USERMAIN_STACKSIZE=4096
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=8192
+CONFIG_HEAP_BASE=
+CONFIG_HEAP_SIZE=
diff --git a/nuttx/configs/sim/nx11/setenv.sh b/nuttx/configs/sim/nx11/setenv.sh
new file mode 100755
index 000000000..dd51ecec2
--- /dev/null
+++ b/nuttx/configs/sim/nx11/setenv.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# sim/nx11/setenv.sh
+#
+# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+if [ "$(basename $0)" = "setenv.sh" ] ; then
+ echo "You must source this script, not run it!" 1>&2
+ exit 1
+fi
+
+if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
+
+#export NUTTX_BIN=
+#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
+
+echo "PATH : ${PATH}"
diff --git a/nuttx/configs/sim/nxffs/Make.defs b/nuttx/configs/sim/nxffs/Make.defs
new file mode 100644
index 000000000..9010d2bb4
--- /dev/null
+++ b/nuttx/configs/sim/nxffs/Make.defs
@@ -0,0 +1,121 @@
+############################################################################
+# configs/sim/nxffs/Make.defs
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+
+HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ ARCHOPTIMIZATION = -g
+else
+ ARCHOPTIMIZATION = -O2
+endif
+
+ARCHCPUFLAGS = -fno-builtin
+ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
+ARCHPICFLAGS = -fpic
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
+ARCHDEFINES =
+ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ARCHSCRIPT =
+
+CROSSDEV =
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+OBJEXT = .o
+LIBEXT = .a
+
+ifeq ($(HOSTOS),Cygwin)
+ EXEEXT = .exe
+else
+ EXEEXT =
+endif
+
+ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
+ LDFLAGS += -g
+endif
+
+define PREPROCESS
+ @echo "CPP: $1->$2"
+ @$(CPP) $(CPPFLAGS) $1 -o $2
+endef
+
+define COMPILE
+ @echo "CC: $1"
+ @$(CC) -c $(CFLAGS) $1 -o $2
+endef
+
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
+define ASSEMBLE
+ @echo "AS: $1"
+ @$(CC) -c $(AFLAGS) $1 -o $2
+endef
+
+define ARCHIVE
+ echo "AR: $2"; \
+ $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
+endef
+
+define CLEAN
+ @rm -f *.o *.a
+endef
+
+MKDEP = $(TOPDIR)/tools/mkdeps.sh
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+HOSTLDFLAGS =
diff --git a/nuttx/configs/sim/nxffs/appconfig b/nuttx/configs/sim/nxffs/appconfig
new file mode 100644
index 000000000..8170a0edd
--- /dev/null
+++ b/nuttx/configs/sim/nxffs/appconfig
@@ -0,0 +1,39 @@
+############################################################################
+# configs/sim/nxffs/appconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+# Path to example in apps/examples containing the user_start entry point
+
+CONFIGURED_APPS += examples/nxffs
+
diff --git a/nuttx/configs/sim/nxffs/defconfig b/nuttx/configs/sim/nxffs/defconfig
new file mode 100644
index 000000000..2030608cd
--- /dev/null
+++ b/nuttx/configs/sim/nxffs/defconfig
@@ -0,0 +1,398 @@
+############################################################################
+# configs/sim/nxffs/defconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+#
+# Architecture selection
+#
+# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
+# processor architecture.
+# CONFIG_ARCH_name - for use in C code. This identifies the particular
+# processor architecture (CONFIG_ARCH_SIM).
+# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
+# the board that supports the particular chip or SoC.
+# CONFIG_ARCH_BOARD_name - for use in C code
+# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
+#
+CONFIG_ARCH=sim
+CONFIG_ARCH_SIM=y
+CONFIG_ARCH_BOARD=sim
+CONFIG_ARCH_BOARD_SIM=y
+
+#
+# General OS setup
+#
+# CONFIG_APPS_DIR - Identifies the relative path to the directory
+# that builds the application to link with NuttX. Default: ../apps
+# CONFIG_DEBUG - enables built-in debug options
+# CONFIG_DEBUG_VERBOSE - enables verbose debug output
+# CONFIG_DEBUG_SYMBOLS - build without optimization and with
+# debug symbols (needed for use with a debugger).
+# CONFIG_MM_REGIONS - If the architecture includes multiple
+# regions of memory to allocate from, this specifies the
+# number of memory regions that the memory manager must
+# handle and enables the API mm_addregion(start, end);
+# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
+# time console output
+# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz
+# or MSEC_PER_TICK=10. This setting may be defined to
+# inform NuttX that the processor hardware is providing
+# system timer interrupts at some interrupt interval other
+# than 10 msec.
+# CONFIG_RR_INTERVAL - The round robin timeslice will be set
+# this number of milliseconds; Round robin scheduling can
+# be disabled by setting this value to zero.
+# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
+# scheduler to monitor system performance
+# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
+# task name to save in the TCB. Useful if scheduler
+# instrumentation is selected. Set to zero to disable.
+# CONFIG_JULIAN_TIME - Enables Julian time conversions
+# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
+# Used to initialize the internal time logic.
+# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
+# provides /dev/console. Enables stdout, stderr, stdin.
+# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
+# driver (minimul support)
+# CONFIG_MUTEX_TYPES: Set to enable support for recursive and
+# errorcheck mutexes. Enables pthread_mutexattr_settype().
+# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority
+# inheritance on mutexes and semaphores.
+# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
+# inheritance is enabled. It defines the maximum number of
+# different threads (minus one) that can take counts on a
+# semaphore with priority inheritance support. This may be
+# set to zero if priority inheritance is disabled OR if you
+# are only using semaphores as mutexes (only one holder) OR
+# if no more than two threads participate using a counting
+# semaphore.
+# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled,
+# then this setting is the maximum number of higher priority
+# threads (minus 1) than can be waiting for another thread
+# to release a count on a semaphore. This value may be set
+# to zero if no more than one thread is expected to wait for
+# a semaphore.
+# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors
+# by task_create() when a new task is started. If set, all
+# files/drivers will appear to be closed in the new task.
+# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first
+# three file descriptors (stdin, stdout, stderr) by task_create()
+# when a new task is started. If set, all files/drivers will
+# appear to be closed in the new task except for stdin, stdout,
+# and stderr.
+# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket
+# desciptors by task_create() when a new task is started. If
+# set, all sockets will appear to be closed in the new task.
+#
+#CONFIG_APPS_DIR=
+CONFIG_DEBUG=y
+CONFIG_DEBUG_VERBOSE=n
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DEBUG_FS=y
+CONFIG_MM_REGIONS=1
+CONFIG_ARCH_LOWPUTC=y
+CONFIG_RR_INTERVAL=0
+CONFIG_SCHED_INSTRUMENTATION=n
+CONFIG_TASK_NAME_SIZE=32
+CONFIG_START_YEAR=2011
+CONFIG_START_MONTH=4
+CONFIG_START_DAY=29
+CONFIG_JULIAN_TIME=n
+CONFIG_DEV_CONSOLE=y
+CONFIG_DEV_LOWCONSOLE=n
+CONFIG_MUTEX_TYPES=y
+CONFIG_PRIORITY_INHERITANCE=n
+CONFIG_SEM_PREALLOCHOLDERS=0
+CONFIG_SEM_NNESTPRIO=0
+CONFIG_FDCLONE_DISABLE=n
+CONFIG_FDCLONE_STDIO=n
+CONFIG_SDCLONE_DISABLE=y
+
+#
+# The following can be used to disable categories of
+# APIs supported by the OS. If the compiler supports
+# weak functions, then it should not be necessary to
+# disable functions unless you want to restrict usage
+# of those APIs.
+#
+# There are certain dependency relationships in these
+# features.
+#
+# o mq_notify logic depends on signals to awaken tasks
+# waiting for queues to become full or empty.
+# o pthread_condtimedwait() depends on signals to wake
+# up waiting tasks.
+#
+CONFIG_DISABLE_CLOCK=n
+CONFIG_DISABLE_POSIX_TIMERS=y
+CONFIG_DISABLE_PTHREAD=y
+CONFIG_DISABLE_SIGNALS=y
+CONFIG_DISABLE_MQUEUE=y
+CONFIG_DISABLE_MOUNTPOINT=n
+CONFIG_DISABLE_ENVIRON=n
+CONFIG_DISABLE_POLL=y
+
+#
+# Misc libc settings
+#
+# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
+# little smaller if we do not support fieldwidthes
+#
+CONFIG_NOPRINTF_FIELDWIDTH=n
+
+#
+# Allow for architecture optimized implementations
+#
+# The architecture can provide optimized versions of the
+# following to improve sysem performance
+#
+CONFIG_ARCH_MEMCPY=n
+CONFIG_ARCH_MEMCMP=n
+CONFIG_ARCH_MEMMOVE=n
+CONFIG_ARCH_MEMSET=n
+CONFIG_ARCH_STRCMP=n
+CONFIG_ARCH_STRCPY=n
+CONFIG_ARCH_STRNCPY=n
+CONFIG_ARCH_STRLEN=n
+CONFIG_ARCH_STRNLEN=n
+CONFIG_ARCH_BZERO=n
+
+##
+# General build options
+#
+# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
+# BSPs from www.ridgerun.com using the tools/mkimage.sh script
+# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format
+# used with many different loaders using the GNU objcopy program
+# Should not be selected if you are not using the GNU toolchain.
+# CONFIG_RAW_BINARY - make a raw binary format file used with many
+# different loaders using the GNU objcopy program. This option
+# should not be selected if you are not using the GNU toolchain.
+# CONFIG_HAVE_LIBM - toolchain supports libm.a
+#
+CONFIG_RRLOAD_BINARY=n
+CONFIG_INTELHEX_BINARY=n
+CONFIG_RAW_BINARY=n
+CONFIG_HAVE_LIBM=y
+
+#
+# Sizes of configurable things (0 disables)
+#
+# CONFIG_MAX_TASKS - The maximum number of simultaneously
+# active tasks. This value must be a power of two.
+# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
+# of parameters that a task may receive (i.e., maxmum value
+# of 'argc')
+# CONFIG_NPTHREAD_KEYS - The number of items of thread-
+# specific data that can be retained
+# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
+# descriptors (one for each open)
+# CONFIG_NFILE_STREAMS - The maximum number of streams that
+# can be fopen'ed
+# CONFIG_NAME_MAX - The maximum size of a file name.
+# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
+# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_NUNGET_CHARS - Number of characters that can be
+# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
+# structures. The system manages a pool of preallocated
+# message structures to minimize dynamic allocations
+# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
+# a fixed payload size given by this settin (does not include
+# other message structure overhead.
+# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
+# can be passed to a watchdog handler
+# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
+# structures. The system manages a pool of preallocated
+# watchdog structures to minimize dynamic allocations
+# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
+# timer structures. The system manages a pool of preallocated
+# timer structures to minimize dynamic allocations. Set to
+# zero for all dynamic allocations.
+#
+CONFIG_MAX_TASKS=64
+CONFIG_MAX_TASK_ARGS=4
+CONFIG_NPTHREAD_KEYS=4
+CONFIG_NFILE_DESCRIPTORS=32
+CONFIG_NFILE_STREAMS=16
+CONFIG_NAME_MAX=32
+CONFIG_STDIO_BUFFER_SIZE=1024
+CONFIG_NUNGET_CHARS=2
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_MQ_MAXMSGSIZE=32
+CONFIG_MAX_WDOGPARMS=4
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_PREALLOC_TIMERS=8
+
+#
+# FAT filesystem configuration
+# CONFIG_FS_FAT - Enable FAT filesystem support
+# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
+CONFIG_FS_FAT=y
+CONFIG_FS_ROMFS=n
+
+#
+# TCP/IP and UDP support via uIP
+# CONFIG_NET - Enable or disable all network features
+# CONFIG_NET_IPv6 - Build in support for IPv6
+# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
+# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
+# CONFIG_NET_BUFSIZE - uIP buffer size
+# CONFIG_NET_TCP - TCP support on or off
+# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
+# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
+# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
+# CONFIG_NET_TCPBACKLOG - Incoming connections pend in a backlog until
+# accept() is called. The size of the backlog is selected when listen() is called.
+# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
+# CONFIG_NET_UDP - UDP support on or off
+# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
+# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
+# CONFIG_NET_ICMP - ICMP ping response support on or off
+# CONFIG_NET_ICMP_PING - ICMP ping request support on or off
+# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
+# CONFIG_NET_STATISTICS - uIP statistics on or off
+# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
+# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
+# CONFIG_NET_BROADCAST - Broadcast support
+# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
+#
+CONFIG_NET=n
+CONFIG_NET_IPv6=n
+CONFIG_NSOCKET_DESCRIPTORS=0
+CONFIG_NET_SOCKOPTS=y
+CONFIG_NET_BUFSIZE=420
+CONFIG_NET_TCP=n
+CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_UDP=n
+CONFIG_NET_UDP_CHECKSUMS=y
+#CONFIG_NET_UDP_CONNS=10
+CONFIG_NET_ICMP=n
+CONFIG_NET_ICMP_PING=n
+#CONFIG_NET_PINGADDRCONF=0
+CONFIG_NET_STATISTICS=y
+#CONFIG_NET_RECEIVE_WINDOW=
+#CONFIG_NET_ARPTAB_SIZE=8
+CONFIG_NET_BROADCAST=n
+#CONFIG_NET_FWCACHE_SIZE=2
+
+#
+# UIP Network Utilities
+# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
+# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
+CONFIG_NET_DHCP_LIGHT=n
+CONFIG_NET_RESOLV_ENTRIES=4
+
+#
+# Settings for examples/uip
+CONFIG_EXAMPLE_UIP_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_UIP_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_UIP_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_UIP_DHCPC=n
+
+#
+# Settings for examples/nettest
+CONFIG_EXAMPLE_NETTEST_SERVER=n
+CONFIG_EXAMPLE_NETTEST_PERFORMANCE=n
+CONFIG_EXAMPLE_NETTEST_NOMAC=n
+CONFIG_EXAMPLE_NETTEST_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
+
+#
+# Settings for examples/ostest
+#
+CONFIG_EXAMPLES_OSTEST_LOOPS=100
+CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
+
+#
+# Settings for apps/nshlib
+CONFIG_NSH_CONSOLE=y
+CONFIG_NSH_TELNET=n
+CONFIG_NSH_IOBUFFER_SIZE=512
+CONFIG_NSH_CMD_SIZE=40
+CONFIG_NSH_STACKSIZE=4096
+CONFIG_NSH_DHCPC=n
+CONFIG_NSH_NOMAC=n
+CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
+CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
+CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
+
+#
+# Various FS, NXFFS, RAMMTD and other settings needed for
+# apps/examples/nxffs
+#
+CONFIG_LIB_RAND_ORDER=3
+CONFIG_FS_NXFFS=y
+CONFIG_NXFFS_ERASEDSTATE=0xff
+CONFIG_NXFSS_PREALLOCATED=y
+CONFIG_RAMMTD_BLOCKSIZE=512
+CONFIG_RAMMTD_ERASESIZE=4096
+CONFIG_RAMMTD_ERASESTATE=0xff
+CONFIG_RAMMTD_FLASHSIM=y
+CONFIG_EXAMPLES_NXFFS_NEBLOCKS=32
+
+#
+# Stack and heap information
+#
+# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
+# operation from FLASH but must copy initialized .data sections to RAM.
+# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
+# but copy themselves entirely into RAM for better performance.
+# CONFIG_CUSTOM_STACK - The up_ implementation will handle
+# all stack operations outside of the nuttx model.
+# CONFIG_STACK_POINTER - The initial stack pointer
+# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack.
+# This is the thread that (1) performs the inital boot of the system up
+# to the point where user_start() is spawned, and (2) there after is the
+# IDLE thread that executes only when there is no other thread ready to
+# run.
+# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate
+# for the main user thread that begins at the user_start() entry point.
+# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
+# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
+# CONFIG_HEAP_BASE - The beginning of the heap
+# CONFIG_HEAP_SIZE - The size of the heap
+#
+CONFIG_BOOT_RUNFROMFLASH=n
+CONFIG_BOOT_COPYTORAM=n
+CONFIG_CUSTOM_STACK=n
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_USERMAIN_STACKSIZE=4096
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=8192
+CONFIG_HEAP_BASE=
+CONFIG_HEAP_SIZE=
diff --git a/nuttx/configs/sim/nxffs/setenv.sh b/nuttx/configs/sim/nxffs/setenv.sh
new file mode 100755
index 000000000..273377843
--- /dev/null
+++ b/nuttx/configs/sim/nxffs/setenv.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# confisgs/sim/nxffs/setenv.sh
+#
+# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+if [ "$(basename $0)" = "setenv.sh" ] ; then
+ echo "You must source this script, not run it!" 1>&2
+ exit 1
+fi
+
+if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
+
+#export NUTTX_BIN=
+#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
+
+echo "PATH : ${PATH}"
diff --git a/nuttx/configs/sim/ostest/Make.defs b/nuttx/configs/sim/ostest/Make.defs
new file mode 100644
index 000000000..cf0134b9b
--- /dev/null
+++ b/nuttx/configs/sim/ostest/Make.defs
@@ -0,0 +1,121 @@
+############################################################################
+# configs/sim/Make.defs
+#
+# Copyright (C) 2007-2008, 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+
+HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ ARCHOPTIMIZATION = -g
+else
+ ARCHOPTIMIZATION = -O2
+endif
+
+ARCHCPUFLAGS = -fno-builtin
+ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
+ARCHPICFLAGS = -fpic
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
+ARCHDEFINES =
+ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ARCHSCRIPT =
+
+CROSSDEV =
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+OBJEXT = .o
+LIBEXT = .a
+
+ifeq ($(HOSTOS),Cygwin)
+ EXEEXT = .exe
+else
+ EXEEXT =
+endif
+
+ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
+ LDFLAGS += -g
+endif
+
+define PREPROCESS
+ @echo "CPP: $1->$2"
+ @$(CPP) $(CPPFLAGS) $1 -o $2
+endef
+
+define COMPILE
+ @echo "CC: $1"
+ @$(CC) -c $(CFLAGS) $1 -o $2
+endef
+
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
+define ASSEMBLE
+ @echo "AS: $1"
+ @$(CC) -c $(AFLAGS) $1 -o $2
+endef
+
+define ARCHIVE
+ echo "AR: $2"; \
+ $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
+endef
+
+define CLEAN
+ @rm -f *.o *.a
+endef
+
+MKDEP = $(TOPDIR)/tools/mkdeps.sh
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+HOSTLDFLAGS =
diff --git a/nuttx/configs/sim/ostest/appconfig b/nuttx/configs/sim/ostest/appconfig
new file mode 100644
index 000000000..77707484e
--- /dev/null
+++ b/nuttx/configs/sim/ostest/appconfig
@@ -0,0 +1,39 @@
+############################################################################
+# configs/sim/ostest/appconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+# Path to example in apps/examples containing the user_start entry point
+
+CONFIGURED_APPS += examples/ostest
+
diff --git a/nuttx/configs/sim/ostest/defconfig b/nuttx/configs/sim/ostest/defconfig
new file mode 100644
index 000000000..df9bdf825
--- /dev/null
+++ b/nuttx/configs/sim/ostest/defconfig
@@ -0,0 +1,382 @@
+############################################################################
+# configs/sim/ostest/defconfig
+#
+# Copyright (C) 2007-2010 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+#
+# Architecture selection
+#
+# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
+# processor architecture.
+# CONFIG_ARCH_name - for use in C code. This identifies the particular
+# processor architecture (CONFIG_ARCH_SIM).
+# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
+# the board that supports the particular chip or SoC.
+# CONFIG_ARCH_BOARD_name - for use in C code
+# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
+#
+CONFIG_ARCH=sim
+CONFIG_ARCH_SIM=y
+CONFIG_ARCH_BOARD=sim
+CONFIG_ARCH_BOARD_SIM=y
+
+#
+# General OS setup
+#
+# CONFIG_APPS_DIR - Identifies the relative path to the directory
+# that builds the application to link with NuttX. Default: ../apps
+# CONFIG_DEBUG - enables built-in debug options
+# CONFIG_DEBUG_VERBOSE - enables verbose debug output
+# CONFIG_DEBUG_SYMBOLS - build without optimization and with
+# debug symbols (needed for use with a debugger).
+# CONFIG_MM_REGIONS - If the architecture includes multiple
+# regions of memory to allocate from, this specifies the
+# number of memory regions that the memory manager must
+# handle and enables the API mm_addregion(start, end);
+# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
+# time console output
+# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz
+# or MSEC_PER_TICK=10. This setting may be defined to
+# inform NuttX that the processor hardware is providing
+# system timer interrupts at some interrupt interval other
+# than 10 msec.
+# CONFIG_RR_INTERVAL - The round robin timeslice will be set
+# this number of milliseconds; Round robin scheduling can
+# be disabled by setting this value to zero.
+# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
+# scheduler to monitor system performance
+# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
+# task name to save in the TCB. Useful if scheduler
+# instrumentation is selected. Set to zero to disable.
+# CONFIG_JULIAN_TIME - Enables Julian time conversions
+# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
+# Used to initialize the internal time logic.
+# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
+# provides /dev/console. Enables stdout, stderr, stdin.
+# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
+# driver (minimul support)
+# CONFIG_MUTEX_TYPES: Set to enable support for recursive and
+# errorcheck mutexes. Enables pthread_mutexattr_settype().
+# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority
+# inheritance on mutexes and semaphores.
+# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
+# inheritance is enabled. It defines the maximum number of
+# different threads (minus one) that can take counts on a
+# semaphore with priority inheritance support. This may be
+# set to zero if priority inheritance is disabled OR if you
+# are only using semaphores as mutexes (only one holder) OR
+# if no more than two threads participate using a counting
+# semaphore.
+# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled,
+# then this setting is the maximum number of higher priority
+# threads (minus 1) than can be waiting for another thread
+# to release a count on a semaphore. This value may be set
+# to zero if no more than one thread is expected to wait for
+# a semaphore.
+# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors
+# by task_create() when a new task is started. If set, all
+# files/drivers will appear to be closed in the new task.
+# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first
+# three file descriptors (stdin, stdout, stderr) by task_create()
+# when a new task is started. If set, all files/drivers will
+# appear to be closed in the new task except for stdin, stdout,
+# and stderr.
+# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket
+# desciptors by task_create() when a new task is started. If
+# set, all sockets will appear to be closed in the new task.
+#
+#CONFIG_APPS_DIR=
+CONFIG_DEBUG=y
+CONFIG_DEBUG_VERBOSE=y
+CONFIG_DEBUG_SYMBOLS=n
+CONFIG_MM_REGIONS=1
+CONFIG_ARCH_LOWPUTC=y
+CONFIG_RR_INTERVAL=0
+CONFIG_SCHED_INSTRUMENTATION=n
+CONFIG_TASK_NAME_SIZE=32
+CONFIG_START_YEAR=2007
+CONFIG_START_MONTH=2
+CONFIG_START_DAY=27
+CONFIG_JULIAN_TIME=n
+CONFIG_DEV_CONSOLE=y
+CONFIG_DEV_LOWCONSOLE=n
+CONFIG_MUTEX_TYPES=y
+CONFIG_PRIORITY_INHERITANCE=n
+CONFIG_SEM_PREALLOCHOLDERS=0
+CONFIG_SEM_NNESTPRIO=0
+CONFIG_FDCLONE_DISABLE=n
+CONFIG_FDCLONE_STDIO=n
+CONFIG_SDCLONE_DISABLE=y
+
+#
+# The following can be used to disable categories of
+# APIs supported by the OS. If the compiler supports
+# weak functions, then it should not be necessary to
+# disable functions unless you want to restrict usage
+# of those APIs.
+#
+# There are certain dependency relationships in these
+# features.
+#
+# o mq_notify logic depends on signals to awaken tasks
+# waiting for queues to become full or empty.
+# o pthread_condtimedwait() depends on signals to wake
+# up waiting tasks.
+#
+CONFIG_DISABLE_CLOCK=n
+CONFIG_DISABLE_POSIX_TIMERS=n
+CONFIG_DISABLE_PTHREAD=n
+CONFIG_DISABLE_SIGNALS=n
+CONFIG_DISABLE_MQUEUE=n
+CONFIG_DISABLE_MOUNTPOINT=n
+CONFIG_DISABLE_ENVIRON=n
+CONFIG_DISABLE_POLL=y
+
+#
+# Misc libc settings
+#
+# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
+# little smaller if we do not support fieldwidthes
+#
+CONFIG_NOPRINTF_FIELDWIDTH=n
+
+#
+# Allow for architecture optimized implementations
+#
+# The architecture can provide optimized versions of the
+# following to improve sysem performance
+#
+CONFIG_ARCH_MEMCPY=n
+CONFIG_ARCH_MEMCMP=n
+CONFIG_ARCH_MEMMOVE=n
+CONFIG_ARCH_MEMSET=n
+CONFIG_ARCH_STRCMP=n
+CONFIG_ARCH_STRCPY=n
+CONFIG_ARCH_STRNCPY=n
+CONFIG_ARCH_STRLEN=n
+CONFIG_ARCH_STRNLEN=n
+CONFIG_ARCH_BZERO=n
+
+##
+# General build options
+#
+# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
+# BSPs from www.ridgerun.com using the tools/mkimage.sh script
+# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format
+# used with many different loaders using the GNU objcopy program
+# Should not be selected if you are not using the GNU toolchain.
+# CONFIG_RAW_BINARY - make a raw binary format file used with many
+# different loaders using the GNU objcopy program. This option
+# should not be selected if you are not using the GNU toolchain.
+# CONFIG_HAVE_LIBM - toolchain supports libm.a
+#
+CONFIG_RRLOAD_BINARY=n
+CONFIG_INTELHEX_BINARY=n
+CONFIG_RAW_BINARY=n
+CONFIG_HAVE_LIBM=y
+
+#
+# Sizes of configurable things (0 disables)
+#
+# CONFIG_MAX_TASKS - The maximum number of simultaneously
+# active tasks. This value must be a power of two.
+# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
+# of parameters that a task may receive (i.e., maxmum value
+# of 'argc')
+# CONFIG_NPTHREAD_KEYS - The number of items of thread-
+# specific data that can be retained
+# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
+# descriptors (one for each open)
+# CONFIG_NFILE_STREAMS - The maximum number of streams that
+# can be fopen'ed
+# CONFIG_NAME_MAX - The maximum size of a file name.
+# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
+# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_NUNGET_CHARS - Number of characters that can be
+# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
+# structures. The system manages a pool of preallocated
+# message structures to minimize dynamic allocations
+# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
+# a fixed payload size given by this settin (does not include
+# other message structure overhead.
+# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
+# can be passed to a watchdog handler
+# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
+# structures. The system manages a pool of preallocated
+# watchdog structures to minimize dynamic allocations
+# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
+# timer structures. The system manages a pool of preallocated
+# timer structures to minimize dynamic allocations. Set to
+# zero for all dynamic allocations.
+#
+CONFIG_MAX_TASKS=64
+CONFIG_MAX_TASK_ARGS=4
+CONFIG_NPTHREAD_KEYS=4
+CONFIG_NFILE_DESCRIPTORS=32
+CONFIG_NFILE_STREAMS=16
+CONFIG_NAME_MAX=32
+CONFIG_STDIO_BUFFER_SIZE=1024
+CONFIG_NUNGET_CHARS=2
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_MQ_MAXMSGSIZE=32
+CONFIG_MAX_WDOGPARMS=4
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_PREALLOC_TIMERS=8
+
+#
+# FAT filesystem configuration
+# CONFIG_FS_FAT - Enable FAT filesystem support
+# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
+CONFIG_FS_FAT=y
+CONFIG_FS_ROMFS=n
+
+#
+# TCP/IP and UDP support via uIP
+# CONFIG_NET - Enable or disable all network features
+# CONFIG_NET_IPv6 - Build in support for IPv6
+# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
+# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
+# CONFIG_NET_BUFSIZE - uIP buffer size
+# CONFIG_NET_TCP - TCP support on or off
+# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
+# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
+# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
+# CONFIG_NET_TCPBACKLOG - Incoming connections pend in a backlog until
+# accept() is called. The size of the backlog is selected when listen() is called.
+# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
+# CONFIG_NET_UDP - UDP support on or off
+# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
+# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
+# CONFIG_NET_ICMP - ICMP ping response support on or off
+# CONFIG_NET_ICMP_PING - ICMP ping request support on or off
+# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
+# CONFIG_NET_STATISTICS - uIP statistics on or off
+# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
+# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
+# CONFIG_NET_BROADCAST - Broadcast support
+# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
+#
+CONFIG_NET=n
+CONFIG_NET_IPv6=n
+CONFIG_NSOCKET_DESCRIPTORS=0
+CONFIG_NET_SOCKOPTS=y
+CONFIG_NET_BUFSIZE=420
+CONFIG_NET_TCP=n
+CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_UDP=n
+CONFIG_NET_UDP_CHECKSUMS=y
+#CONFIG_NET_UDP_CONNS=10
+CONFIG_NET_ICMP=n
+CONFIG_NET_ICMP_PING=n
+#CONFIG_NET_PINGADDRCONF=0
+CONFIG_NET_STATISTICS=y
+#CONFIG_NET_RECEIVE_WINDOW=
+#CONFIG_NET_ARPTAB_SIZE=8
+CONFIG_NET_BROADCAST=n
+#CONFIG_NET_FWCACHE_SIZE=2
+
+#
+# UIP Network Utilities
+# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
+# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
+CONFIG_NET_DHCP_LIGHT=n
+CONFIG_NET_RESOLV_ENTRIES=4
+
+#
+# Settings for examples/uip
+CONFIG_EXAMPLE_UIP_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_UIP_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_UIP_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_UIP_DHCPC=n
+
+#
+# Settings for examples/nettest
+CONFIG_EXAMPLE_NETTEST_SERVER=n
+CONFIG_EXAMPLE_NETTEST_PERFORMANCE=n
+CONFIG_EXAMPLE_NETTEST_NOMAC=n
+CONFIG_EXAMPLE_NETTEST_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
+
+#
+# Settings for examples/ostest
+CONFIG_EXAMPLES_OSTEST_LOOPS=100
+CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
+
+#
+# Settings for apps/nshlib
+CONFIG_NSH_CONSOLE=y
+CONFIG_NSH_TELNET=n
+CONFIG_NSH_IOBUFFER_SIZE=512
+CONFIG_NSH_CMD_SIZE=40
+CONFIG_NSH_STACKSIZE=4096
+CONFIG_NSH_DHCPC=n
+CONFIG_NSH_NOMAC=n
+CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
+CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
+CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
+
+#
+# Stack and heap information
+#
+# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
+# operation from FLASH but must copy initialized .data sections to RAM.
+# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
+# but copy themselves entirely into RAM for better performance.
+# CONFIG_CUSTOM_STACK - The up_ implementation will handle
+# all stack operations outside of the nuttx model.
+# CONFIG_STACK_POINTER - The initial stack pointer
+# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack.
+# This is the thread that (1) performs the inital boot of the system up
+# to the point where user_start() is spawned, and (2) there after is the
+# IDLE thread that executes only when there is no other thread ready to
+# run.
+# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate
+# for the main user thread that begins at the user_start() entry point.
+# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
+# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
+# CONFIG_HEAP_BASE - The beginning of the heap
+# CONFIG_HEAP_SIZE - The size of the heap
+#
+CONFIG_BOOT_RUNFROMFLASH=n
+CONFIG_BOOT_COPYTORAM=n
+CONFIG_CUSTOM_STACK=n
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_USERMAIN_STACKSIZE=4096
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=8192
+CONFIG_HEAP_BASE=
+CONFIG_HEAP_SIZE=
diff --git a/nuttx/configs/sim/ostest/setenv.sh b/nuttx/configs/sim/ostest/setenv.sh
new file mode 100755
index 000000000..9b3df2015
--- /dev/null
+++ b/nuttx/configs/sim/ostest/setenv.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# sim/setenv.sh
+#
+# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+if [ "$(basename $0)" = "setenv.sh" ] ; then
+ echo "You must source this script, not run it!" 1>&2
+ exit 1
+fi
+
+if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
+
+#export NUTTX_BIN=
+#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
+
+echo "PATH : ${PATH}"
diff --git a/nuttx/configs/sim/pashello/Make.defs b/nuttx/configs/sim/pashello/Make.defs
new file mode 100644
index 000000000..40dc5acb1
--- /dev/null
+++ b/nuttx/configs/sim/pashello/Make.defs
@@ -0,0 +1,122 @@
+############################################################################
+# configs/sim/pashello/Make.defs
+#
+# Copyright (C) 2007-2008, 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+
+HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ ARCHOPTIMIZATION = -g
+else
+ ARCHOPTIMIZATION = -O2
+endif
+
+ARCHCPUFLAGS = -fno-builtin
+ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
+ARCHPICFLAGS = -fpic
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
+ARCHDEFINES =
+ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ARCHSCRIPT =
+
+CROSSDEV =
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+OBJEXT = .o
+LIBEXT = .a
+
+ifeq ($(HOSTOS),Cygwin)
+ EXEEXT = .exe
+else
+ EXEEXT =
+endif
+
+ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
+ LDFLAGS += -g
+endif
+EXTRA_LIBS = -lm
+
+define PREPROCESS
+ @echo "CPP: $1->$2"
+ @$(CPP) $(CPPFLAGS) $1 -o $2
+endef
+
+define COMPILE
+ @echo "CC: $1"
+ @$(CC) -c $(CFLAGS) $1 -o $2
+endef
+
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
+define ASSEMBLE
+ @echo "AS: $1"
+ @$(CC) -c $(AFLAGS) $1 -o $2
+endef
+
+define ARCHIVE
+ echo "AR: $2"; \
+ $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
+endef
+
+define CLEAN
+ @rm -f *.o *.a
+endef
+
+MKDEP = $(TOPDIR)/tools/mkdeps.sh
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+HOSTLDFLAGS =
diff --git a/nuttx/configs/sim/pashello/appconfig b/nuttx/configs/sim/pashello/appconfig
new file mode 100644
index 000000000..d4adbcce1
--- /dev/null
+++ b/nuttx/configs/sim/pashello/appconfig
@@ -0,0 +1,42 @@
+############################################################################
+# configs/sim/pashello/appconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+# Path to example in apps/examples containing the user_start entry point
+
+CONFIGURED_APPS += examples/pashello
+
+# Path to the Pascal p-code runtime interpreter module
+
+CONFIGURED_APPS += interpreters/pcode
diff --git a/nuttx/configs/sim/pashello/defconfig b/nuttx/configs/sim/pashello/defconfig
new file mode 100644
index 000000000..c00e25b15
--- /dev/null
+++ b/nuttx/configs/sim/pashello/defconfig
@@ -0,0 +1,377 @@
+############################################################################
+# configs/sim/pashello/defconfig
+#
+# Copyright (C) 2007-2010 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+#
+# Architecture selection
+#
+# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
+# processor architecture.
+# CONFIG_ARCH_name - for use in C code. This identifies the particular
+# processor architecture (CONFIG_ARCH_SIM).
+# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
+# the board that supports the particular chip or SoC.
+# CONFIG_ARCH_BOARD_name - for use in C code
+# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
+#
+CONFIG_ARCH=sim
+CONFIG_ARCH_SIM=y
+CONFIG_ARCH_BOARD=sim
+CONFIG_ARCH_BOARD_SIM=y
+
+#
+# General OS setup
+#
+# CONFIG_APPS_DIR - Identifies the relative path to the directory
+# that builds the application to link with NuttX. Default: ../apps
+# CONFIG_DEBUG - enables built-in debug options
+# CONFIG_DEBUG_VERBOSE - enables verbose debug output
+# CONFIG_DEBUG_SYMBOLS - build without optimization and with
+# debug symbols (needed for use with a debugger).
+# CONFIG_MM_REGIONS - If the architecture includes multiple
+# regions of memory to allocate from, this specifies the
+# number of memory regions that the memory manager must
+# handle and enables the API mm_addregion(start, end);
+# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
+# time console output
+# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz
+# or MSEC_PER_TICK=10. This setting may be defined to
+# inform NuttX that the processor hardware is providing
+# system timer interrupts at some interrupt interval other
+# than 10 msec.
+# CONFIG_RR_INTERVAL - The round robin timeslice will be set
+# this number of milliseconds; Round robin scheduling can
+# be disabled by setting this value to zero.
+# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
+# scheduler to monitor system performance
+# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
+# task name to save in the TCB. Useful if scheduler
+# instrumentation is selected. Set to zero to disable.
+# CONFIG_JULIAN_TIME - Enables Julian time conversions
+# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
+# Used to initialize the internal time logic.
+# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
+# provides /dev/console. Enables stdout, stderr, stdin.
+# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
+# driver (minimul support)
+# CONFIG_MUTEX_TYPES: Set to enable support for recursive and
+# errorcheck mutexes. Enables pthread_mutexattr_settype().
+# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority
+# inheritance on mutexes and semaphores.
+# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
+# inheritance is enabled. It defines the maximum number of
+# different threads (minus one) that can take counts on a
+# semaphore with priority inheritance support. This may be
+# set to zero if priority inheritance is disabled OR if you
+# are only using semaphores as mutexes (only one holder) OR
+# if no more than two threads participate using a counting
+# semaphore.
+# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled,
+# then this setting is the maximum number of higher priority
+# threads (minus 1) than can be waiting for another thread
+# to release a count on a semaphore. This value may be set
+# to zero if no more than one thread is expected to wait for
+# a semaphore.
+# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors
+# by task_create() when a new task is started. If set, all
+# files/drivers will appear to be closed in the new task.
+# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first
+# three file descriptors (stdin, stdout, stderr) by task_create()
+# when a new task is started. If set, all files/drivers will
+# appear to be closed in the new task except for stdin, stdout,
+# and stderr.
+# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket
+# desciptors by task_create() when a new task is started. If
+# set, all sockets will appear to be closed in the new task.
+#
+#CONFIG_APPS_DIR=
+CONFIG_DEBUG=n
+CONFIG_DEBUG_VERBOSE=n
+CONFIG_DEBUG_SYMBOLS=n
+CONFIG_MM_REGIONS=1
+CONFIG_ARCH_LOWPUTC=y
+CONFIG_RR_INTERVAL=0
+CONFIG_SCHED_INSTRUMENTATION=n
+CONFIG_TASK_NAME_SIZE=32
+CONFIG_START_YEAR=2007
+CONFIG_START_MONTH=2
+CONFIG_START_DAY=27
+CONFIG_JULIAN_TIME=n
+CONFIG_DEV_CONSOLE=y
+CONFIG_DEV_LOWCONSOLE=n
+CONFIG_MUTEX_TYPES=n
+CONFIG_PRIORITY_INHERITANCE=n
+CONFIG_SEM_PREALLOCHOLDERS=0
+CONFIG_SEM_NNESTPRIO=0
+CONFIG_FDCLONE_DISABLE=n
+CONFIG_FDCLONE_STDIO=n
+CONFIG_SDCLONE_DISABLE=y
+
+#
+# The following can be used to disable categories of
+# APIs supported by the OS. If the compiler supports
+# weak functions, then it should not be necessary to
+# disable functions unless you want to restrict usage
+# of those APIs.
+#
+# There are certain dependency relationships in these
+# features.
+#
+# o mq_notify logic depends on signals to awaken tasks
+# waiting for queues to become full or empty.
+# o pthread_condtimedwait() depends on signals to wake
+# up waiting tasks.
+#
+CONFIG_DISABLE_CLOCK=n
+CONFIG_DISABLE_POSIX_TIMERS=n
+CONFIG_DISABLE_PTHREAD=n
+CONFIG_DISABLE_SIGNALS=n
+CONFIG_DISABLE_MQUEUE=n
+CONFIG_DISABLE_MOUNTPOINT=n
+CONFIG_DISABLE_ENVIRON=n
+CONFIG_DISABLE_POLL=y
+
+#
+# Misc libc settings
+#
+# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
+# little smaller if we do not support fieldwidthes
+#
+CONFIG_NOPRINTF_FIELDWIDTH=n
+
+#
+# Allow for architecture optimized implementations
+#
+# The architecture can provide optimized versions of the
+# following to improve sysem performance
+#
+CONFIG_ARCH_MEMCPY=n
+CONFIG_ARCH_MEMCMP=n
+CONFIG_ARCH_MEMMOVE=n
+CONFIG_ARCH_MEMSET=n
+CONFIG_ARCH_STRCMP=n
+CONFIG_ARCH_STRCPY=n
+CONFIG_ARCH_STRNCPY=n
+CONFIG_ARCH_STRLEN=n
+CONFIG_ARCH_STRNLEN=n
+CONFIG_ARCH_BZERO=n
+
+#
+# General build options
+#
+# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
+# BSPs from www.ridgerun.com using the tools/mkimage.sh script
+# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format
+# used with many different loaders using the GNU objcopy program
+# Should not be selected if you are not using the GNU toolchain.
+# CONFIG_RAW_BINARY - make a raw binary format file used with many
+# different loaders using the GNU objcopy program. This option
+# should not be selected if you are not using the GNU toolchain.
+# CONFIG_HAVE_LIBM - toolchain supports libm.a
+#
+CONFIG_RRLOAD_BINARY=n
+CONFIG_INTELHEX_BINARY=n
+CONFIG_RAW_BINARY=n
+CONFIG_HAVE_LIBM=y
+
+#
+# Sizes of configurable things (0 disables)
+#
+# CONFIG_MAX_TASKS - The maximum number of simultaneously
+# active tasks. This value must be a power of two.
+# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
+# of parameters that a task may receive (i.e., maxmum value
+# of 'argc')
+# CONFIG_NPTHREAD_KEYS - The number of items of thread-
+# specific data that can be retained
+# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
+# descriptors (one for each open)
+# CONFIG_NFILE_STREAMS - The maximum number of streams that
+# can be fopen'ed
+# CONFIG_NAME_MAX - The maximum size of a file name.
+# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
+# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_NUNGET_CHARS - Number of characters that can be
+# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
+# structures. The system manages a pool of preallocated
+# message structures to minimize dynamic allocations
+# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
+# a fixed payload size given by this settin (does not include
+# other message structure overhead.
+# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
+# can be passed to a watchdog handler
+# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
+# structures. The system manages a pool of preallocated
+# watchdog structures to minimize dynamic allocations
+# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
+# timer structures. The system manages a pool of preallocated
+# timer structures to minimize dynamic allocations. Set to
+# zero for all dynamic allocations.
+#
+CONFIG_MAX_TASKS=64
+CONFIG_MAX_TASK_ARGS=4
+CONFIG_NPTHREAD_KEYS=4
+CONFIG_NFILE_DESCRIPTORS=32
+CONFIG_NFILE_STREAMS=16
+CONFIG_NAME_MAX=32
+CONFIG_STDIO_BUFFER_SIZE=1024
+CONFIG_NUNGET_CHARS=2
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_MQ_MAXMSGSIZE=32
+CONFIG_MAX_WDOGPARMS=4
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_PREALLOC_TIMERS=8
+
+#
+# FAT filesystem configuration
+# CONFIG_FS_FAT - Enable FAT filesystem support
+# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
+CONFIG_FS_FAT=y
+CONFIG_FS_ROMFS=n
+
+#
+# TCP/IP and UDP support via uIP
+# CONFIG_NET - Enable or disable all network features
+# CONFIG_NET_IPv6 - Build in support for IPv6
+# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
+# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
+# CONFIG_NET_BUFSIZE - uIP buffer size
+# CONFIG_NET_TCP - TCP support on or off
+# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
+# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
+# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
+# CONFIG_NET_TCPBACKLOG - Incoming connections pend in a backlog until
+# accept() is called. The size of the backlog is selected when listen() is called.
+# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
+# CONFIG_NET_UDP - UDP support on or off
+# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
+# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
+# CONFIG_NET_ICMP - ICMP ping response support on or off
+# CONFIG_NET_ICMP_PING - ICMP ping request support on or off
+# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
+# CONFIG_NET_STATISTICS - uIP statistics on or off
+# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
+# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
+# CONFIG_NET_BROADCAST - Broadcast support
+# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
+#
+CONFIG_NET=n
+CONFIG_NET_IPv6=n
+CONFIG_NSOCKET_DESCRIPTORS=0
+CONFIG_NET_SOCKOPTS=y
+CONFIG_NET_BUFSIZE=420
+CONFIG_NET_TCP=n
+CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_UDP=n
+CONFIG_NET_UDP_CHECKSUMS=y
+#CONFIG_NET_UDP_CONNS=10
+CONFIG_NET_ICMP=n
+CONFIG_NET_ICMP_PING=n
+#CONFIG_NET_PINGADDRCONF=0
+CONFIG_NET_STATISTICS=y
+#CONFIG_NET_RECEIVE_WINDOW=
+#CONFIG_NET_ARPTAB_SIZE=8
+CONFIG_NET_BROADCAST=n
+#CONFIG_NET_FWCACHE_SIZE=2
+
+#
+# UIP Network Utilities
+# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
+# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
+CONFIG_NET_DHCP_LIGHT=n
+CONFIG_NET_RESOLV_ENTRIES=4
+
+#
+# Settings for examples/uip
+CONFIG_EXAMPLE_UIP_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_UIP_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_UIP_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_UIP_DHCPC=n
+
+#
+# Settings for examples/nettest
+CONFIG_EXAMPLE_NETTEST_SERVER=n
+CONFIG_EXAMPLE_NETTEST_PERFORMANCE=n
+CONFIG_EXAMPLE_NETTEST_NOMAC=n
+CONFIG_EXAMPLE_NETTEST_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
+
+#
+# Settings for examples/nsh
+CONFIG_NSH_CONSOLE=y
+CONFIG_NSH_TELNET=n
+CONFIG_NSH_IOBUFFER_SIZE=512
+CONFIG_NSH_CMD_SIZE=40
+CONFIG_NSH_STACKSIZE=4096
+CONFIG_NSH_DHCPC=n
+CONFIG_NSH_NOMAC=n
+CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
+CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
+CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
+
+#
+# Stack and heap information
+#
+# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
+# operation from FLASH but must copy initialized .data sections to RAM.
+# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
+# but copy themselves entirely into RAM for better performance.
+# CONFIG_CUSTOM_STACK - The up_ implementation will handle
+# all stack operations outside of the nuttx model.
+# CONFIG_STACK_POINTER - The initial stack pointer
+# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack.
+# This is the thread that (1) performs the inital boot of the system up
+# to the point where user_start() is spawned, and (2) there after is the
+# IDLE thread that executes only when there is no other thread ready to
+# run.
+# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate
+# for the main user thread that begins at the user_start() entry point.
+# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
+# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
+# CONFIG_HEAP_BASE - The beginning of the heap
+# CONFIG_HEAP_SIZE - The size of the heap
+#
+CONFIG_BOOT_RUNFROMFLASH=n
+CONFIG_BOOT_COPYTORAM=n
+CONFIG_CUSTOM_STACK=n
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_USERMAIN_STACKSIZE=4096
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=8192
+CONFIG_HEAP_BASE=
+CONFIG_HEAP_SIZE=
diff --git a/nuttx/configs/sim/pashello/setenv.sh b/nuttx/configs/sim/pashello/setenv.sh
new file mode 100755
index 000000000..9b3df2015
--- /dev/null
+++ b/nuttx/configs/sim/pashello/setenv.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# sim/setenv.sh
+#
+# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+if [ "$(basename $0)" = "setenv.sh" ] ; then
+ echo "You must source this script, not run it!" 1>&2
+ exit 1
+fi
+
+if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
+
+#export NUTTX_BIN=
+#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
+
+echo "PATH : ${PATH}"
diff --git a/nuttx/configs/sim/src/Makefile b/nuttx/configs/sim/src/Makefile
new file mode 100644
index 000000000..594942765
--- /dev/null
+++ b/nuttx/configs/sim/src/Makefile
@@ -0,0 +1,83 @@
+############################################################################
+# configs/sim/src/Makefile
+#
+# Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include $(TOPDIR)/Make.defs
+
+CFLAGS += -I$(TOPDIR)/sched
+
+ASRCS =
+AOBJS = $(ASRCS:.S=$(OBJEXT))
+
+CSRCS =
+ifeq ($(CONFIG_SIM_X11FB),y)
+ifeq ($(CONFIG_SIM_TOUCHSCREEN),y)
+ CSRCS += up_touchscreen.c
+endif
+endif
+COBJS = $(CSRCS:.c=$(OBJEXT))
+
+SRCS = $(ASRCS) $(CSRCS)
+OBJS = $(AOBJS) $(COBJS)
+
+all: libboard$(LIBEXT)
+
+$(AOBJS): %$(OBJEXT): %.S
+ $(call ASSEMBLE, $<, $@)
+
+$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
+ $(call COMPILE, $<, $@)
+
+libboard$(LIBEXT): $(OBJS)
+ @$(AR) $@ # Create an empty archive
+ifneq ($(OBJS),)
+ @( for obj in $(OBJS) ; do \
+ $(call ARCHIVE, $@, $${obj}); \
+ done ; )
+endif
+
+.depend: Makefile $(SRCS)
+ @$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
+ @touch $@
+
+depend: .depend
+
+clean:
+ @rm -f libboard$(LIBEXT) *~ .*.swp
+ $(call CLEAN)
+
+distclean: clean
+ @rm -f Make.dep .depend
+
+-include Make.dep
diff --git a/nuttx/configs/sim/src/README.txt b/nuttx/configs/sim/src/README.txt
new file mode 100644
index 000000000..28315582a
--- /dev/null
+++ b/nuttx/configs/sim/src/README.txt
@@ -0,0 +1 @@
+This directory contains drivers unique to the Linux user-mode platform.
diff --git a/nuttx/configs/sim/src/up_touchscreen.c b/nuttx/configs/sim/src/up_touchscreen.c
new file mode 100644
index 000000000..54d6d0cb3
--- /dev/null
+++ b/nuttx/configs/sim/src/up_touchscreen.c
@@ -0,0 +1,182 @@
+/****************************************************************************
+ * config/sim/src/up_touchscreen.c
+ *
+ * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <stdint.h>
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/fb.h>
+#include <nuttx/input/touchscreen.h>
+#include <nuttx/nx/nx.h>
+#include <nuttx/nx/nxglib.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+/* Configuration ************************************************************/
+/* Pick a background color */
+
+#ifndef CONFIG_EXAMPLES_TOUCHSCREEN_BGCOLOR
+# define CONFIG_EXAMPLES_TOUCHSCREEN_BGCOLOR 0x007b68ee
+#endif
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct sim_touchscreen_s
+{
+ NXHANDLE hnx;
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct sim_touchscreen_s g_simtc;
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: arch_tcinitialize()
+ *
+ * Description:
+ * Perform architecuture-specific initialization of the touchscreen
+ * hardware. This interface must be provided by all configurations
+ * using apps/examples/touchscreen
+ *
+ ****************************************************************************/
+
+int arch_tcinitialize(int minor)
+{
+ FAR NX_DRIVERTYPE *dev;
+ nxgl_mxpixel_t color;
+ int ret;
+
+ /* Initialize the simulated frame buffer device. We need to create an
+ * X11 window to support the mouse-driven touchscreen simulation.
+ */
+
+ ivdbg("Initializing framebuffer\n");
+ ret = up_fbinitialize();
+ if (ret < 0)
+ {
+ idbg("up_fbinitialize failed: %d\n", -ret);
+ goto errout;
+ }
+
+ dev = up_fbgetvplane(0);
+ if (!dev)
+ {
+ idbg("up_fbgetvplane 0 failed\n");
+ ret = -ENODEV;
+ goto errout_with_fb;
+ }
+
+ /* Then open NX */
+
+ ivdbg("Open NX\n");
+ g_simtc.hnx = nx_open(dev);
+ if (!g_simtc.hnx)
+ {
+ ret = -errno;
+ idbg("nx_open failed: %d\n", ret);
+ goto errout_with_fb;
+ }
+
+ /* Set the background to the configured background color */
+
+ ivdbg("Set background color=%d\n", CONFIG_EXAMPLES_TOUCHSCREEN_BGCOLOR);
+
+ color = CONFIG_EXAMPLES_TOUCHSCREEN_BGCOLOR;
+ ret = nx_setbgcolor(g_simtc.hnx, &color);
+ if (ret < 0)
+ {
+ idbg("nx_setbgcolor failed: %d\n", ret);
+ goto errout_with_nx;
+ }
+
+ /* Finally, initialize the touchscreen simulation on the X window */
+
+ ret = sim_tcinitialize(minor);
+ if (ret < 0)
+ {
+ idbg("sim_tcinitialize failed: %d\n", ret);
+ goto errout_with_nx;
+ }
+ return OK;
+
+errout_with_nx:
+ nx_close(g_simtc.hnx);
+ goto errout;
+errout_with_fb:
+ fb_uninitialize();
+errout:
+ return ret;
+}
+
+/****************************************************************************
+ * Name: arch_tcuninitialize()
+ *
+ * Description:
+ * Perform architecuture-specific un-initialization of the touchscreen
+ * hardware. This interface must be provided by all configurations
+ * using apps/examples/touchscreen
+ *
+ ****************************************************************************/
+
+void arch_tcuninitialize(void)
+{
+ /* Shut down the touchscreen driver */
+
+ sim_tcuninitialize();
+
+ /* Close NX */
+
+ nx_close(g_simtc.hnx);
+}
diff --git a/nuttx/configs/sim/touchscreen/Make.defs b/nuttx/configs/sim/touchscreen/Make.defs
new file mode 100644
index 000000000..599b37432
--- /dev/null
+++ b/nuttx/configs/sim/touchscreen/Make.defs
@@ -0,0 +1,121 @@
+############################################################################
+# configs/sim/touchscreen/Make.defs
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <gnutt@nuttx.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+include ${TOPDIR}/.config
+
+HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+ ARCHOPTIMIZATION = -g
+else
+ ARCHOPTIMIZATION = -O2
+endif
+
+ARCHCPUFLAGS = -fno-builtin
+ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
+ARCHPICFLAGS = -fpic
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
+ARCHDEFINES =
+ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ARCHSCRIPT =
+
+CROSSDEV =
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+OBJEXT = .o
+LIBEXT = .a
+
+ifeq ($(HOSTOS),Cygwin)
+ EXEEXT = .exe
+else
+ EXEEXT =
+endif
+
+ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
+ LDFLAGS += -g
+endif
+
+define PREPROCESS
+ @echo "CPP: $1->$2"
+ @$(CPP) $(CPPFLAGS) $1 -o $2
+endef
+
+define COMPILE
+ @echo "CC: $1"
+ @$(CC) -c $(CFLAGS) $1 -o $2
+endef
+
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
+define ASSEMBLE
+ @echo "AS: $1"
+ @$(CC) -c $(AFLAGS) $1 -o $2
+endef
+
+define ARCHIVE
+ echo "AR: $2"; \
+ $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
+endef
+
+define CLEAN
+ @rm -f *.o *.a
+endef
+
+MKDEP = $(TOPDIR)/tools/mkdeps.sh
+
+HOSTCC = gcc
+HOSTINCLUDES = -I.
+HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
+HOSTLDFLAGS =
diff --git a/nuttx/configs/sim/touchscreen/appconfig b/nuttx/configs/sim/touchscreen/appconfig
new file mode 100644
index 000000000..5dc25b81a
--- /dev/null
+++ b/nuttx/configs/sim/touchscreen/appconfig
@@ -0,0 +1,39 @@
+############################################################################
+# configs/sim/touchscreen/appconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+# Path to example in apps/examples containing the user_start entry point
+
+CONFIGURED_APPS += examples/touchscreen
+
diff --git a/nuttx/configs/sim/touchscreen/defconfig b/nuttx/configs/sim/touchscreen/defconfig
new file mode 100644
index 000000000..350502ef2
--- /dev/null
+++ b/nuttx/configs/sim/touchscreen/defconfig
@@ -0,0 +1,601 @@
+############################################################################
+# sim/touchscreen/defconfig
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+#
+# Architecture selection
+#
+# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
+# processor architecture.
+# CONFIG_ARCH_name - for use in C code. This identifies the particular
+# processor architecture (CONFIG_ARCH_SIM).
+# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
+# the board that supports the particular chip or SoC.
+# CONFIG_ARCH_BOARD_name - for use in C code
+# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
+#
+CONFIG_ARCH=sim
+CONFIG_ARCH_SIM=y
+CONFIG_ARCH_BOARD=sim
+CONFIG_ARCH_BOARD_SIM=y
+
+#
+# Simulated framebuffer configuration
+#
+CONFIG_SIM_X11FB=y
+CONFIG_SIM_FBWIDTH=240
+CONFIG_SIM_FBHEIGHT=320
+CONFIG_SIM_FBBPP=32
+
+#
+# Simulated touchscreen configuration
+# (Set both of the following to 'y' to enable)
+#
+CONFIG_INPUT=y
+CONFIG_SIM_TOUCHSCREEN=y
+
+#
+# General OS setup
+#
+# CONFIG_APPS_DIR - Identifies the relative path to the directory
+# that builds the application to link with NuttX. Default: ../apps
+# CONFIG_DEBUG - enables built-in debug options
+# CONFIG_DEBUG_VERBOSE - enables verbose debug output
+# CONFIG_DEBUG_SYMBOLS - build without optimization and with
+# debug symbols (needed for use with a debugger).
+# CONFIG_MM_REGIONS - If the architecture includes multiple
+# regions of memory to allocate from, this specifies the
+# number of memory regions that the memory manager must
+# handle and enables the API mm_addregion(start, end);
+# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
+# time console output
+# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz
+# or MSEC_PER_TICK=10. This setting may be defined to
+# inform NuttX that the processor hardware is providing
+# system timer interrupts at some interrupt interval other
+# than 10 msec.
+# CONFIG_RR_INTERVAL - The round robin timeslice will be set
+# this number of milliseconds; Round robin scheduling can
+# be disabled by setting this value to zero.
+# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
+# scheduler to monitor system performance
+# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
+# task name to save in the TCB. Useful if scheduler
+# instrumentation is selected. Set to zero to disable.
+# CONFIG_JULIAN_TIME - Enables Julian time conversions
+# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
+# Used to initialize the internal time logic.
+# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
+# provides /dev/console. Enables stdout, stderr, stdin.
+# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console
+# driver (minimul support)
+# CONFIG_MUTEX_TYPES: Set to enable support for recursive and
+# errorcheck mutexes. Enables pthread_mutexattr_settype().
+# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority
+# inheritance on mutexes and semaphores.
+# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
+# inheritance is enabled. It defines the maximum number of
+# different threads (minus one) that can take counts on a
+# semaphore with priority inheritance support. This may be
+# set to zero if priority inheritance is disabled OR if you
+# are only using semaphores as mutexes (only one holder) OR
+# if no more than two threads participate using a counting
+# semaphore.
+# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled,
+# then this setting is the maximum number of higher priority
+# threads (minus 1) than can be waiting for another thread
+# to release a count on a semaphore. This value may be set
+# to zero if no more than one thread is expected to wait for
+# a semaphore.
+# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors
+# by task_create() when a new task is started. If set, all
+# files/drivers will appear to be closed in the new task.
+# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first
+# three file descriptors (stdin, stdout, stderr) by task_create()
+# when a new task is started. If set, all files/drivers will
+# appear to be closed in the new task except for stdin, stdout,
+# and stderr.
+# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket
+# desciptors by task_create() when a new task is started. If
+# set, all sockets will appear to be closed in the new task.
+#
+#CONFIG_APPS_DIR=
+CONFIG_DEBUG=y
+CONFIG_DEBUG_VERBOSE=y
+CONFIG_DEBUG_SYMBOLS=n
+CONFIG_DEBUG_INPUT=y
+CONFIG_DEBUG_GRAPHICS=n
+CONFIG_MM_REGIONS=1
+CONFIG_ARCH_LOWPUTC=y
+CONFIG_RR_INTERVAL=0
+CONFIG_SCHED_INSTRUMENTATION=n
+CONFIG_TASK_NAME_SIZE=32
+CONFIG_START_YEAR=2008
+CONFIG_START_MONTH=11
+CONFIG_START_DAY=28
+CONFIG_JULIAN_TIME=n
+CONFIG_DEV_CONSOLE=y
+CONFIG_DEV_LOWCONSOLE=n
+CONFIG_MUTEX_TYPES=n
+CONFIG_PRIORITY_INHERITANCE=n
+CONFIG_SEM_PREALLOCHOLDERS=0
+CONFIG_SEM_NNESTPRIO=0
+CONFIG_FDCLONE_DISABLE=n
+CONFIG_FDCLONE_STDIO=n
+CONFIG_SDCLONE_DISABLE=y
+
+#
+# The following can be used to disable categories of
+# APIs supported by the OS. If the compiler supports
+# weak functions, then it should not be necessary to
+# disable functions unless you want to restrict usage
+# of those APIs.
+#
+# There are certain dependency relationships in these
+# features.
+#
+# o mq_notify logic depends on signals to awaken tasks
+# waiting for queues to become full or empty.
+# o pthread_condtimedwait() depends on signals to wake
+# up waiting tasks.
+#
+CONFIG_DISABLE_CLOCK=n
+CONFIG_DISABLE_POSIX_TIMERS=y
+CONFIG_DISABLE_PTHREAD=n
+CONFIG_DISABLE_SIGNALS=n
+CONFIG_DISABLE_MQUEUE=n
+CONFIG_DISABLE_MOUNTPOINT=y
+CONFIG_DISABLE_ENVIRON=y
+CONFIG_DISABLE_POLL=y
+
+#
+# Misc libc settings
+#
+# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
+# little smaller if we do not support fieldwidthes
+#
+CONFIG_NOPRINTF_FIELDWIDTH=n
+
+#
+# Allow for architecture optimized implementations
+#
+# The architecture can provide optimized versions of the
+# following to improve sysem performance
+#
+CONFIG_ARCH_MEMCPY=n
+CONFIG_ARCH_MEMCMP=n
+CONFIG_ARCH_MEMMOVE=n
+CONFIG_ARCH_MEMSET=n
+CONFIG_ARCH_STRCMP=n
+CONFIG_ARCH_STRCPY=n
+CONFIG_ARCH_STRNCPY=n
+CONFIG_ARCH_STRLEN=n
+CONFIG_ARCH_STRNLEN=n
+CONFIG_ARCH_BZERO=n
+
+#
+# General build options
+#
+# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
+# BSPs from www.ridgerun.com using the tools/mkimage.sh script
+# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format
+# used with many different loaders using the GNU objcopy program
+# Should not be selected if you are not using the GNU toolchain.
+# CONFIG_RAW_BINARY - make a raw binary format file used with many
+# different loaders using the GNU objcopy program. This option
+# should not be selected if you are not using the GNU toolchain.
+# CONFIG_HAVE_LIBM - toolchain supports libm.a
+#
+CONFIG_RRLOAD_BINARY=n
+CONFIG_INTELHEX_BINARY=n
+CONFIG_RAW_BINARY=n
+CONFIG_HAVE_LIBM=y
+
+#
+# Sizes of configurable things (0 disables)
+#
+# CONFIG_MAX_TASKS - The maximum number of simultaneously
+# active tasks. This value must be a power of two.
+# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
+# of parameters that a task may receive (i.e., maxmum value
+# of 'argc')
+# CONFIG_NPTHREAD_KEYS - The number of items of thread-
+# specific data that can be retained
+# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
+# descriptors (one for each open)
+# CONFIG_NFILE_STREAMS - The maximum number of streams that
+# can be fopen'ed
+# CONFIG_NAME_MAX - The maximum size of a file name.
+# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
+# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_NUNGET_CHARS - Number of characters that can be
+# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
+# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
+# structures. The system manages a pool of preallocated
+# message structures to minimize dynamic allocations
+# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
+# a fixed payload size given by this settin (does not include
+# other message structure overhead.
+# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
+# can be passed to a watchdog handler
+# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
+# structures. The system manages a pool of preallocated
+# watchdog structures to minimize dynamic allocations
+# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
+# timer structures. The system manages a pool of preallocated
+# timer structures to minimize dynamic allocations. Set to
+# zero for all dynamic allocations.
+#
+CONFIG_MAX_TASKS=16
+CONFIG_MAX_TASK_ARGS=4
+CONFIG_NPTHREAD_KEYS=4
+CONFIG_NFILE_DESCRIPTORS=16
+CONFIG_NFILE_STREAMS=16
+CONFIG_NAME_MAX=32
+CONFIG_STDIO_BUFFER_SIZE=1024
+CONFIG_NUNGET_CHARS=2
+CONFIG_PREALLOC_MQ_MSGS=32
+CONFIG_MQ_MAXMSGSIZE=32
+CONFIG_MAX_WDOGPARMS=4
+CONFIG_PREALLOC_WDOGS=32
+CONFIG_PREALLOC_TIMERS=8
+
+#
+# Framebuffer driver options
+CONFIG_FB_CMAP=y
+CONFIG_FB_HWCURSOR=n
+CONFIG_FB_HWCURSORIMAGE=n
+#CONFIG_FB_HWCURSORSIZE
+#CONFIG_FB_TRANSPARENCY
+
+#
+# FAT filesystem configuration
+# CONFIG_FS_FAT - Enable FAT filesystem support
+# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
+CONFIG_FS_FAT=n
+CONFIG_FS_ROMFS=n
+
+#
+# TCP/IP and UDP support via uIP
+# CONFIG_NET - Enable or disable all network features
+# CONFIG_NET_IPv6 - Build in support for IPv6
+# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
+# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
+# CONFIG_NET_BUFSIZE - uIP buffer size
+# CONFIG_NET_TCP - TCP support on or off
+# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks)
+# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers
+# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero)
+# CONFIG_NET_TCPBACKLOG - Incoming connections pend in a backlog until
+# accept() is called. The size of the backlog is selected when listen() is called.
+# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
+# CONFIG_NET_UDP - UDP support on or off
+# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
+# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
+# CONFIG_NET_ICMP - ICMP ping response support on or off
+# CONFIG_NET_ICMP_PING - ICMP ping request support on or off
+# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
+# CONFIG_NET_STATISTICS - uIP statistics on or off
+# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
+# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
+# CONFIG_NET_BROADCAST - Broadcast support
+# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
+#
+CONFIG_NET=n
+CONFIG_NET_IPv6=n
+CONFIG_NSOCKET_DESCRIPTORS=0
+CONFIG_NET_SOCKOPTS=y
+CONFIG_NET_BUFSIZE=420
+CONFIG_NET_TCP=n
+CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_UDP=n
+CONFIG_NET_UDP_CHECKSUMS=y
+#CONFIG_NET_UDP_CONNS=10
+CONFIG_NET_ICMP=n
+CONFIG_NET_ICMP_PING=n
+#CONFIG_NET_PINGADDRCONF=0
+CONFIG_NET_STATISTICS=y
+#CONFIG_NET_RECEIVE_WINDOW=
+#CONFIG_NET_ARPTAB_SIZE=8
+CONFIG_NET_BROADCAST=n
+#CONFIG_NET_FWCACHE_SIZE=2
+
+#
+# UIP Network Utilities
+# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
+# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
+CONFIG_NET_DHCP_LIGHT=n
+CONFIG_NET_RESOLV_ENTRIES=4
+
+#
+# Graphics related configuration settings
+#
+# CONFIG_NX
+# Enables overall support for graphics library and NX
+# CONFIG_NX_MULTIUSER
+# Configures NX in multi-user mode
+# CONFIG_NX_NPLANES
+# Some YUV color formats requires support for multiple planes,
+# one for each color component. Unless you have such special
+# hardware, this value should be undefined or set to 1
+# CONFIG_NX_DISABLE_1BPP, CONFIG_NX_DISABLE_2BPP,
+# CONFIG_NX_DISABLE_4BPP, CONFIG_NX_DISABLE_8BPP,
+# CONFIG_NX_DISABLE_16BPP, CONFIG_NX_DISABLE_24BPP, and
+# CONFIG_NX_DISABLE_32BPP
+# NX supports a variety of pixel depths. You can save some
+# memory by disabling support for unused color depths.
+# CONFIG_NX_PACKEDMSFIRST
+# If a pixel depth of less than 8-bits is used, then NX needs
+# to know if the pixels pack from the MS to LS or from LS to MS
+# CONFIG_NX_MOUSE
+# Build in support for mouse input
+# CONFIG_NX_KBD
+# Build in support of keypad/keyboard input
+# CONFIG_NXTK_BORDERWIDTH
+# Specifies with with of the border (in pixels) used with
+# framed windows. The default is 4.
+# CONFIG_NXTK_BORDERCOLOR1 and CONFIG_NXTK_BORDERCOLOR2
+# Specify the colors of the border used with framed windows.
+# CONFIG_NXTK_BORDERCOLOR2 is the shadow side color and so
+# is normally darker. The default is medium and dark grey,
+# respectively
+# CONFIG_NXTK_AUTORAISE
+# If set, a window will be raised to the top if the mouse position
+# is over a visible portion of the window. Default: A mouse
+# button must be clicked over a visible portion of the window.
+# CONFIG_NXFONTS_CHARBITS
+# The number of bits in the character set. Current options are
+# only 7 and 8. The default is 7.
+# CONFIG_NXFONT_SANS23X27
+# At present, there is only one font. But if there were were more,
+# then this option would select the sans serif font.
+#
+# NX Multi-user only options:
+#
+# CONFIG_NX_BLOCKING
+# Open the client message queues in blocking mode. In this case,
+# nx_eventhandler() will not return until a message is received and processed.
+# CONFIG_NX_MXSERVERMSGS and CONFIG_NX_MXCLIENTMSGS
+# Specifies the maximum number of messages that can fit in
+# the message queues. No additional resources are allocated, but
+# this can be set to prevent flooding of the client or server with
+# too many messages (CONFIG_PREALLOC_MQ_MSGS controls how many
+# messages are pre-allocated).
+#
+CONFIG_NX=y
+CONFIG_NX_MULTIUSER=n
+CONFIG_NX_NPLANES=1
+CONFIG_NX_DISABLE_1BPP=y
+CONFIG_NX_DISABLE_2BPP=y
+CONFIG_NX_DISABLE_4BPP=y
+CONFIG_NX_DISABLE_8BPP=y
+CONFIG_NX_DISABLE_16BPP=y
+CONFIG_NX_DISABLE_24BPP=y
+CONFIG_NX_DISABLE_32BPP=n
+CONFIG_NX_PACKEDMSFIRST=n
+CONFIG_NX_MOUSE=y
+CONFIG_NX_KBD=y
+#CONFIG_NXTK_BORDERWIDTH=4
+#CONFIG_NXTK_BORDERCOLOR1
+#CONFIG_NXTK_BORDERCOLOR2
+CONFIG_NXTK_AUTORAISE=n
+CONFIG_NXFONT_SANS23X27=y
+CONFIG_NXFONTS_CHARBITS=7
+CONFIG_NX_BLOCKING=y
+CONFIG_NX_MXSERVERMSGS=32
+CONFIG_NX_MXCLIENTMSGS=16
+
+#
+# Settings for examples/uip
+CONFIG_EXAMPLE_UIP_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_UIP_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_UIP_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_UIP_DHCPC=n
+
+#
+# Settings for examples/nettest
+CONFIG_EXAMPLE_NETTEST_SERVER=n
+CONFIG_EXAMPLE_NETTEST_PERFORMANCE=n
+CONFIG_EXAMPLE_NETTEST_NOMAC=n
+CONFIG_EXAMPLE_NETTEST_IPADDR=(192<<24|168<<16|0<<8|128)
+CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|0<<8|1)
+CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
+
+#
+# Settings for examples/ostest
+CONFIG_EXAMPLES_OSTEST_LOOPS=100
+CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
+
+#
+# Settings for apps/nshlib
+#
+# CONFIG_NSH_FILEIOSIZE - Size of a static I/O buffer
+# CONFIG_NSH_STRERROR - Use strerror(errno)
+# CONFIG_NSH_LINELEN - Maximum length of one command line
+# CONFIG_NSH_STACKSIZE - Stack size to use for new threads.
+# CONFIG_NSH_NESTDEPTH - Max number of nested if-then[-else]-fi
+# CONFIG_NSH_DISABLESCRIPT - Disable scripting support
+# CONFIG_NSH_DISABLEBG - Disable background commands
+# CONFIG_NSH_ROMFSETC - Use startup script in /etc
+# CONFIG_NSH_CONSOLE - Use serial console front end
+# CONFIG_NSH_TELNET - Use telnetd console front end
+#
+# If CONFIG_NSH_TELNET is selected:
+# CONFIG_NSH_IOBUFFER_SIZE -- Telnetd I/O buffer size
+# CONFIG_NSH_DHCPC - Obtain address using DHCP
+# CONFIG_NSH_IPADDR - Provides static IP address
+# CONFIG_NSH_DRIPADDR - Provides static router IP address
+# CONFIG_NSH_NETMASK - Provides static network mask
+# CONFIG_NSH_NOMAC - Use a bogus MAC address
+#
+# If CONFIG_NSH_ROMFSETC is selected:
+# CONFIG_NSH_ROMFSMOUNTPT - ROMFS mountpoint
+# CONFIG_NSH_INITSCRIPT - Relative path to init script
+# CONFIG_NSH_ROMFSDEVNO - ROMFS RAM device minor
+# CONFIG_NSH_ROMFSSECTSIZE - ROMF sector size
+# CONFIG_NSH_FATDEVNO - FAT FS RAM device minor
+# CONFIG_NSH_FATSECTSIZE - FAT FS sector size
+# CONFIG_NSH_FATNSECTORS - FAT FS number of sectors
+# CONFIG_NSH_FATMOUNTPT - FAT FS mountpoint
+CONFIG_NSH_FILEIOSIZE=1024
+CONFIG_NSH_STRERROR=n
+CONFIG_NSH_LINELEN=80
+CONFIG_NSH_STACKSIZE=4096
+CONFIG_NSH_NESTDEPTH=3
+CONFIG_NSH_DISABLESCRIPT=n
+CONFIG_NSH_DISABLEBG=n
+CONFIG_NSH_ROMFSETC=y
+CONFIG_NSH_CONSOLE=y
+CONFIG_NSH_TELNET=n
+CONFIG_NSH_IOBUFFER_SIZE=512
+CONFIG_NSH_DHCPC=n
+CONFIG_NSH_NOMAC=n
+CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
+CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
+CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
+CONFIG_NSH_ROMFSMOUNTPT="/etc"
+CONFIG_NSH_INITSCRIPT="init.d/rcS"
+CONFIG_NSH_ROMFSDEVNO=1
+CONFIG_NSH_ROMFSSECTSIZE=64
+CONFIG_NSH_FATDEVNO=2
+CONFIG_NSH_FATSECTSIZE=512
+CONFIG_NSH_FATNSECTORS=1024
+CONFIG_NSH_FATMOUNTPT=/tmp
+
+#
+# Settings for examples/nx
+#
+# CONFIG_EXAMPLES_NX_VPLANE -- The plane to select from the frame-
+# buffer driver for use in the test. Default: 0
+# CONFIG_EXAMPLES_NX_BGCOLOR -- The color of the background. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_COLOR1 -- The color of window 1. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_COLOR2 -- The color of window 2. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_TBCOLOR -- The color of the toolbar. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_FONTCOLOR -- The color of the toolbar. Default depends on
+# CONFIG_EXAMPLES_NX_BPP.
+# CONFIG_EXAMPLES_NX_BPP -- Pixels per pixel to use. Valid options
+# include 2, 4, 8, 16, 24, and 32. Default is 32.
+# CONFIG_EXAMPLES_NX_RAWWINDOWS -- Use raw windows; Default is to
+# use pretty, framed NXTK windows with toolbars.
+# CONFIG_EXAMPLES_NX_STACKSIZE -- The stacksize to use when creating
+# the NX server. Default 2048
+# CONFIG_EXAMPLES_NX_CLIENTPRIO -- The client priority. Default: 80
+# CONFIG_EXAMPLES_NX_SERVERPRIO -- The server priority. Default: 120
+# CONFIG_EXAMPLES_NX_NOTIFYSIGNO -- The signal number to use with
+# nx_eventnotify(). Default: 4
+CONFIG_EXAMPLES_NX_VPLANE=0
+#CONFIG_EXAMPLES_NX_BGCOLOR
+#CONFIG_EXAMPLES_NX_COLOR1
+#CONFIG_EXAMPLES_NX_COLOR2
+#CONFIG_EXAMPLES_NX_TBCOLOR
+#CONFIG_EXAMPLES_NX_FONTCOLOR
+CONFIG_EXAMPLES_NX_BPP=CONFIG_SIM_FBBPP
+CONFIG_EXAMPLES_NX_RAWWINDOWS=n
+CONFIG_EXAMPLES_NX_STACKSIZE=8192
+CONFIG_EXAMPLES_NX_CLIENTPRIO=80
+CONFIG_EXAMPLES_NX_SERVERPRIO=120
+CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4
+
+#
+# Settings for examples/mount
+CONFIG_EXAMPLES_MOUNT_DEVNAME="/dev/ram0"
+#CONFIG_EXAMPLES_MOUNT_NSECTORS=2048
+#CONFIG_EXAMPLES_MOUNT_SECTORSIZE=512
+#CONFIG_EXAMPLES_MOUNT_RAMDEVNO=1
+
+#
+# Settings for examples/touchscreen
+#
+# CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN - Build the touchscreen test as
+# an NSH built-in function. Default: Built as a standalone problem
+# CONFIG_EXAMPLES_TOUCHSCREEN_MINOR - The minor device number. Minor=N
+# correspnds to touchscreen device /dev/input0. Note this value must
+# with CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH. Default 0.
+# CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH - The path to the touchscreen
+# device. This must be consistent with CONFIG_EXAMPLES_TOUCHSCREEN_MINOR.
+# Default: "/dev/input0"
+# CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES - If CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN
+# is defined, then the number of samples is provided on the command line
+# and this value is ignored. Otherwise, this number of samples is
+# collected and the program terminates. Default: Samples are collected
+# indefinitely.
+#
+CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN=n
+CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
+CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
+CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES=25
+
+#
+# Additional examples/touchscreen needed only for the simulated target
+# CONFIG_EXAMPLES_TOUCHSCREEN_BGCOLOR -- Background color
+#
+CONFIG_EXAMPLES_TOUCHSCREEN_BGCOLOR=0x007b68ee
+
+#
+# Stack and heap information
+#
+# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
+# operation from FLASH but must copy initialized .data sections to RAM.
+# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
+# but copy themselves entirely into RAM for better performance.
+# CONFIG_CUSTOM_STACK - The up_ implementation will handle
+# all stack operations outside of the nuttx model.
+# CONFIG_STACK_POINTER - The initial stack pointer
+# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack.
+# This is the thread that (1) performs the inital boot of the system up
+# to the point where user_start() is spawned, and (2) there after is the
+# IDLE thread that executes only when there is no other thread ready to
+# run.
+# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate
+# for the main user thread that begins at the user_start() entry point.
+# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
+# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
+# CONFIG_HEAP_BASE - The beginning of the heap
+# CONFIG_HEAP_SIZE - The size of the heap
+#
+CONFIG_BOOT_RUNFROMFLASH=n
+CONFIG_BOOT_COPYTORAM=n
+CONFIG_CUSTOM_STACK=n
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_USERMAIN_STACKSIZE=4096
+CONFIG_PTHREAD_STACK_MIN=256
+CONFIG_PTHREAD_STACK_DEFAULT=8192
+CONFIG_HEAP_BASE=
+CONFIG_HEAP_SIZE=
diff --git a/nuttx/configs/sim/touchscreen/setenv.sh b/nuttx/configs/sim/touchscreen/setenv.sh
new file mode 100755
index 000000000..ffaeb5126
--- /dev/null
+++ b/nuttx/configs/sim/touchscreen/setenv.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# sim/touchscreen/setenv.sh
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+if [ "$(basename $0)" = "setenv.sh" ] ; then
+ echo "You must source this script, not run it!" 1>&2
+ exit 1
+fi
+
+if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
+
+#export NUTTX_BIN=
+#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
+
+echo "PATH : ${PATH}"