mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
Add support for platoform specific ROMFS startup files
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3350 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
<tr align="center" bgcolor="#e4e4e4">
|
<tr align="center" bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
<h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
|
<h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1>
|
||||||
<p>Last Updated: March 1, 2011</p>
|
<p>Last Updated: March 7, 2011</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -580,9 +580,8 @@ mount -t vfat /dev/ram1 /tmp
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b>Modifying the ROMFS Image</b>.
|
<b>Modifying the ROMFS Image</b>.
|
||||||
The contents of the <code>/etc</code> directory are retained in the file
|
The contents of the <code>/etc</code> directory are retained in the file <code>examples/nsh/nsh_romfsimg.h</code> OR, if <code>CONFIG_EXAMPLES_NSH_ARCHROMFS</code> is defined, <code>include/arch/board/rcs.template</code>).
|
||||||
<code>examples/nsh/nsh_romfsimg.h</code>. In order to modify the start-up
|
In order to modify the start-up behavior, there are three things to study:
|
||||||
behavior, there are three things to study:
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
<b>Configuration Options.</b>
|
<b>Configuration Options.</b>
|
||||||
@@ -591,30 +590,37 @@ mount -t vfat /dev/ram1 /tmp
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<p>
|
<p>
|
||||||
<b><code>mkromfsimg.sh</code> Script</b>.
|
<b><code>tools/mkromfsimg.sh</code> Script</b>.
|
||||||
The script <code>examples/nsh/mkromfsimg.sh</code> creates <code>nsh_romfsimg.h</code>.
|
The script <code>tools/mkromfsimg.sh</code> creates <code>nsh_romfsimg.h</code>.
|
||||||
It is not automatically executed. If you want to change the
|
It is not automatically executed. If you want to change the
|
||||||
configuration settings associated with creating and mounting
|
configuration settings associated with creating and mounting
|
||||||
the <code>/tmp</code> directory, then it will be necessary to re-generate
|
the <code>/tmp</code> directory, then it will be necessary to re-generate
|
||||||
this header file using the <code>mkromfsimg.sh</code> script.
|
this header file using the <code>tools/mkromfsimg.sh</code> script.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The behavior of this script depends upon three things:
|
The behavior of this script depends upon three things:
|
||||||
<ul>
|
<ul>
|
||||||
<li>The configuration settings then installed configuration.
|
<li>The configuration settings then installed configuration.
|
||||||
<li>The <code>genromfs<code> tool (available from <a href="http://romfs.sourceforge.net">http://romfs.sourceforge.net</a>).
|
<li>The <code>genromfs<code> tool (available from <a href="http://romfs.sourceforge.net">http://romfs.sourceforge.net</a>).
|
||||||
<li>The file <code>examples/nsh/rcS.template</code>.
|
<li>The file <code>examples/nsh/rcS.template</code>
|
||||||
|
(OR, if <code>CONFIG_EXAMPLES_NSH_ARCHROMFS</code> is defined <code>include/arch/board/rcs.template</code>.
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<b><code>rcS.template</code></b>.
|
<b><code>rcS.template</code></b>.
|
||||||
The file <code>examples/nsh/rcS.template</code> contains the general form
|
The file <code>examples/nsh/rcS.template</code> contains the general form
|
||||||
of the <code>rcS</code> file; configurated values are plugged into this
|
of the <code>rcS</code> file; configured values are plugged into this
|
||||||
template file to produce the final <code>rcS</code> file.
|
template file to produce the final <code>rcS</code> file.
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
<b>NOTE</b>:
|
||||||
|
<code>examples/nsh/rcS.template</code> generates the standard, default <code>nsh_romfsimg.h</code> file.
|
||||||
|
If <code>CONFIG_EXAMPLES_NSH_ARCHROMFS<code> is defined in the NuttX configuration file, then a custom, board-specific <code>nsh_romfsimg.h</code> file residing in <code>configs/<board>/include</code> will be used.
|
||||||
|
NOTE when the OS is configured, <code>include/arch/board</code> will be linked to <code>configs/<board>/include</code>.
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
All of the startup-behavior is contained in <code>rcS.template</code>. The
|
All of the startup-behavior is contained in <code>rcS.template</code>. The
|
||||||
role of <code>mkromfsimg.sh</code> is to (1) apply the specific configuration
|
role of <code>mkromfsimg.sh</code> is to (1) apply the specific configuration
|
||||||
@@ -2254,6 +2260,12 @@ nsh>
|
|||||||
<th align="left" width="25%">Configuration</th>
|
<th align="left" width="25%">Configuration</th>
|
||||||
<th align="left">Description</th>
|
<th align="left">Description</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_ARCHROMFS</code></b></td>
|
||||||
|
<td>
|
||||||
|
May be defined to specify an alternative ROMFS image that can be found at <code>configs/<board>/include/nsh_romfsimg.h</code>.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT</code></b></td>
|
<td valign="top"><b><code>CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT</code></b></td>
|
||||||
<td>
|
<td>
|
||||||
@@ -2353,6 +2365,7 @@ nsh>
|
|||||||
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_NOMAC</code></a></li>
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_NOMAC</code></a></li>
|
||||||
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_ROMFSDEVNO</code></a></li>
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_ROMFSDEVNO</code></a></li>
|
||||||
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_ROMFSETC</code></a></li>
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_ROMFSETC</code></a></li>
|
||||||
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_ARCHROMFS</code></a></li>
|
||||||
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT</code></a></li>
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT</code></a></li>
|
||||||
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_ROMFSSECTSIZE</code></a></li>
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_ROMFSSECTSIZE</code></a></li>
|
||||||
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_STACKSIZE</code></a></li>
|
<li><a href="#nshconfiguration"><code>CONFIG_EXAMPLES_NSH_STACKSIZE</code></a></li>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# Makefile
|
# Makefile
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007-2010 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2007-2011 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@@ -309,6 +309,13 @@ ifeq ($(CONFIG_RAW_BINARY),y)
|
|||||||
@$(OBJCOPY) $(OBJCOPYARGS) -O binary $(NUTTX)$(EXEEXT) $(NUTTX)$(EXEEXT).bin
|
@$(OBJCOPY) $(OBJCOPYARGS) -O binary $(NUTTX)$(EXEEXT) $(NUTTX)$(EXEEXT).bin
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# This is a helper target that will rebuild NuttX and download it to the
|
||||||
|
# target system in one step. It will generate an error an error if the
|
||||||
|
# DOWNLOAD command is not defined in platform Make.defs file.
|
||||||
|
|
||||||
|
download: $(BIN)
|
||||||
|
$(call DOWNLOAD, $@)
|
||||||
|
|
||||||
depend:
|
depend:
|
||||||
@for dir in $(MAKEDIRS) ; do \
|
@for dir in $(MAKEDIRS) ; do \
|
||||||
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \
|
$(MAKE) -C $$dir TOPDIR="$(TOPDIR)" depend ; \
|
||||||
|
|||||||
@@ -65,7 +65,15 @@ ARCHPICFLAGS = -fpic
|
|||||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
||||||
ARCHDEFINES =
|
ARCHDEFINES =
|
||||||
|
|
||||||
|
# We have to use a cross-development toolchain under Cygwin because the native
|
||||||
|
# Cygwin toolchains don't generate ELF binaries.
|
||||||
|
|
||||||
|
ifeq ($(HOSTOS),Cygwin)
|
||||||
|
CROSSDEV = i486-elf-
|
||||||
|
else
|
||||||
CROSSDEV =
|
CROSSDEV =
|
||||||
|
endif
|
||||||
|
|
||||||
CC = $(CROSSDEV)gcc
|
CC = $(CROSSDEV)gcc
|
||||||
CPP = $(CROSSDEV)gcc -E
|
CPP = $(CROSSDEV)gcc -E
|
||||||
LD = $(CROSSDEV)ld
|
LD = $(CROSSDEV)ld
|
||||||
|
|||||||
@@ -39,8 +39,10 @@ fi
|
|||||||
|
|
||||||
if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
|
if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
|
||||||
|
|
||||||
# Define the following if you are using anything other than the system GCC
|
# Uncomment and modify the following if you are using anything other
|
||||||
#export NUTTX_BIN=
|
# than the system GCC
|
||||||
#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
|
# WD=`pwd`
|
||||||
|
# export BUILDROOT_BIN="${WD}/../../buildroot/build_i486/staging_dir/bin"
|
||||||
|
# export PATH="${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||||
|
|
||||||
echo "PATH : ${PATH}"
|
echo "PATH : ${PATH}"
|
||||||
|
|||||||
Executable
+89
@@ -0,0 +1,89 @@
|
|||||||
|
unsigned char romfs_img[] = {
|
||||||
|
0x2d, 0x72, 0x6f, 0x6d, 0x31, 0x66, 0x73, 0x2d, 0x00, 0x00, 0x01, 0xf0,
|
||||||
|
0x38, 0x85, 0x3a, 0x23, 0x4e, 0x53, 0x48, 0x49, 0x6e, 0x69, 0x74, 0x56,
|
||||||
|
0x6f, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49,
|
||||||
|
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0xd1, 0xff, 0xff, 0x97,
|
||||||
|
0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x20,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0xd1, 0xd1, 0xff, 0x80, 0x2e, 0x2e, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x68, 0x2d, 0x96, 0x03, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x64, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0,
|
||||||
|
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0xd1, 0xd1, 0xff, 0x40,
|
||||||
|
0x2e, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x60,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0xd1, 0xff, 0xfe, 0xe0, 0x2e, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0f,
|
||||||
|
0x8d, 0x9c, 0xab, 0xe7, 0x72, 0x63, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x63, 0x68, 0x6f,
|
||||||
|
0x20, 0x22, 0x56, 0x53, 0x4e, 0x20, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x20,
|
||||||
|
0x31, 0x2e, 0x32, 0x2c, 0x20, 0x77, 0x77, 0x77, 0x2e, 0x6e, 0x65, 0x74,
|
||||||
|
0x63, 0x6c, 0x61, 0x6d, 0x70, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0x0a,
|
||||||
|
0x0a, 0x23, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20,
|
||||||
|
0x52, 0x41, 0x4d, 0x44, 0x49, 0x53, 0x4b, 0x20, 0x61, 0x6e, 0x64, 0x20,
|
||||||
|
0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x69, 0x74, 0x20, 0x61, 0x74, 0x20,
|
||||||
|
0x2f, 0x74, 0x6d, 0x70, 0x0a, 0x23, 0x6d, 0x6b, 0x72, 0x64, 0x20, 0x2d,
|
||||||
|
0x6d, 0x20, 0x31, 0x20, 0x2d, 0x73, 0x20, 0x35, 0x31, 0x32, 0x20, 0x34,
|
||||||
|
0x30, 0x0a, 0x23, 0x6d, 0x6b, 0x66, 0x61, 0x74, 0x66, 0x73, 0x20, 0x2f,
|
||||||
|
0x64, 0x65, 0x76, 0x2f, 0x72, 0x61, 0x6d, 0x31, 0x0a, 0x23, 0x6d, 0x6f,
|
||||||
|
0x75, 0x6e, 0x74, 0x20, 0x2d, 0x74, 0x20, 0x76, 0x66, 0x61, 0x74, 0x20,
|
||||||
|
0x2f, 0x64, 0x65, 0x76, 0x2f, 0x72, 0x61, 0x6d, 0x31, 0x20, 0x2f, 0x74,
|
||||||
|
0x6d, 0x70, 0x0a, 0x0a, 0x65, 0x63, 0x68, 0x6f, 0x20, 0x22, 0x4d, 0x6f,
|
||||||
|
0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x46, 0x52, 0x41, 0x4d, 0x20,
|
||||||
|
0x74, 0x6f, 0x20, 0x2f, 0x75, 0x73, 0x72, 0x20, 0x61, 0x6e, 0x64, 0x20,
|
||||||
|
0x53, 0x44, 0x63, 0x61, 0x72, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x2f, 0x73,
|
||||||
|
0x64, 0x63, 0x61, 0x72, 0x64, 0x22, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
|
||||||
|
0x20, 0x2d, 0x74, 0x20, 0x76, 0x66, 0x61, 0x74, 0x20, 0x2f, 0x64, 0x65,
|
||||||
|
0x76, 0x2f, 0x6d, 0x74, 0x64, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x30, 0x20,
|
||||||
|
0x2f, 0x75, 0x73, 0x72, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x2d,
|
||||||
|
0x74, 0x20, 0x76, 0x66, 0x61, 0x74, 0x20, 0x2f, 0x64, 0x65, 0x76, 0x2f,
|
||||||
|
0x6d, 0x6d, 0x63, 0x73, 0x64, 0x30, 0x20, 0x2f, 0x73, 0x64, 0x63, 0x61,
|
||||||
|
0x72, 0x64, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00
|
||||||
|
};
|
||||||
|
unsigned int romfs_img_len = 1024;
|
||||||
Executable
+10
@@ -0,0 +1,10 @@
|
|||||||
|
echo "VSN Board 1.2, www.netclamps.com"
|
||||||
|
|
||||||
|
# Create a RAMDISK and mount it at XXXRDMOUNTPOUNTXXX
|
||||||
|
#mkrd -m XXXMKRDMINORXXX -s XXMKRDSECTORSIZEXXX XXMKRDBLOCKSXXX
|
||||||
|
#mkfatfs /dev/ramXXXMKRDMINORXXX
|
||||||
|
#mount -t vfat /dev/ramXXXMKRDMINORXXX XXXRDMOUNTPOUNTXXX
|
||||||
|
|
||||||
|
echo "Mounting FRAM to /usr and SDcard to /sdcard"
|
||||||
|
mount -t vfat /dev/mtdblock0 /usr
|
||||||
|
mount -t vfat /dev/mmcsd0 /sdcard
|
||||||
@@ -167,6 +167,10 @@ define CLEAN
|
|||||||
@rm -f *.o *.a
|
@rm -f *.o *.a
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define DOWNLOAD
|
||||||
|
@armst /dev/ttyUSB0 nuttx.srec
|
||||||
|
endef
|
||||||
|
|
||||||
HOSTCC = gcc
|
HOSTCC = gcc
|
||||||
HOSTINCLUDES = -I.
|
HOSTINCLUDES = -I.
|
||||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||||
|
|||||||
@@ -716,6 +716,8 @@ CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3
|
|||||||
# CONFIG_EXAMPLES_NSH_NOMAC - Use a bogus MAC address
|
# CONFIG_EXAMPLES_NSH_NOMAC - Use a bogus MAC address
|
||||||
#
|
#
|
||||||
# If CONFIG_EXAMPLES_NSH_ROMFSETC is selected:
|
# If CONFIG_EXAMPLES_NSH_ROMFSETC is selected:
|
||||||
|
# CONFIG_EXAMPLES_NSH_ARCHROMFS - May be defined to specify an alternative
|
||||||
|
# ROMFS image that can be found at configs/<board>/include/nsh_romfsimg.h.
|
||||||
# CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT - ROMFS mountpoint
|
# CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT - ROMFS mountpoint
|
||||||
# CONFIG_EXAMPLES_NSH_INITSCRIPT - Relative path to init script
|
# CONFIG_EXAMPLES_NSH_INITSCRIPT - Relative path to init script
|
||||||
# CONFIG_EXAMPLES_NSH_ROMFSDEVNO - ROMFS RAM device minor
|
# CONFIG_EXAMPLES_NSH_ROMFSDEVNO - ROMFS RAM device minor
|
||||||
@@ -742,6 +744,7 @@ CONFIG_EXAMPLES_NSH_NOMAC=n
|
|||||||
CONFIG_EXAMPLES_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
|
CONFIG_EXAMPLES_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
|
||||||
CONFIG_EXAMPLES_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
|
CONFIG_EXAMPLES_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
|
||||||
CONFIG_EXAMPLES_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
|
CONFIG_EXAMPLES_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
|
||||||
|
CONFIG_EXAMPLES_NSH_ARCHROMFS=y
|
||||||
CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT="/etc"
|
CONFIG_EXAMPLES_NSH_ROMFSMOUNTPT="/etc"
|
||||||
CONFIG_EXAMPLES_NSH_INITSCRIPT="init.d/rcS"
|
CONFIG_EXAMPLES_NSH_INITSCRIPT="init.d/rcS"
|
||||||
CONFIG_EXAMPLES_NSH_ROMFSDEVNO=0
|
CONFIG_EXAMPLES_NSH_ROMFSDEVNO=0
|
||||||
|
|||||||
+18
-7
@@ -159,15 +159,16 @@ Modifying the ROMFS Image
|
|||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
The contents of the /etc directory are retained in the file
|
The contents of the /etc directory are retained in the file
|
||||||
examples/nsh/nsh_romfsimg.h. In order to modify the start-up
|
examples/nsh/nsh_romfsimg.h (OR, if CONFIG_EXAMPLES_NSH_ARCHROMFS
|
||||||
behavior, there are three things to study:
|
is defined, include/arch/board/rcs.template). In order to modify
|
||||||
|
the start-up behavior, there are three things to study:
|
||||||
|
|
||||||
1. Configuration Options.
|
1. Configuration Options.
|
||||||
The additional CONFIG_EXAMPLES_NSH_ROMFSETC configuration options
|
The additional CONFIG_EXAMPLES_NSH_ROMFSETC configuration options
|
||||||
discussed in the final section of this README.
|
discussed in the final section of this README.
|
||||||
|
|
||||||
2. mkromfsimg.sh Script.
|
2. tools/mkromfsimg.sh Script.
|
||||||
The script examples/nsh/mkromfsimg.sh creates nsh_romfsimg.h.
|
The script tools/mkromfsimg.sh creates nsh_romfsimg.h.
|
||||||
It is not automatically executed. If you want to change the
|
It is not automatically executed. If you want to change the
|
||||||
configuration settings associated with creating and mounting
|
configuration settings associated with creating and mounting
|
||||||
the /tmp directory, then it will be necessary to re-generate
|
the /tmp directory, then it will be necessary to re-generate
|
||||||
@@ -175,15 +176,25 @@ behavior, there are three things to study:
|
|||||||
|
|
||||||
The behavior of this script depends upon three things:
|
The behavior of this script depends upon three things:
|
||||||
|
|
||||||
- The configuration settings then installed configuration.
|
- The configuration settings of the installed NuttX configuration.
|
||||||
- The genromfs tool (available from http://romfs.sourceforge.net).
|
- The genromfs tool (available from http://romfs.sourceforge.net).
|
||||||
- The file examples/nsh/rcS.template.
|
- The file examples/nsh/rcS.template (OR, if
|
||||||
|
CONFIG_EXAMPLES_NSH_ARCHROMFS is defined, include/arch/board/rcs.template)
|
||||||
|
|
||||||
3. rcS.template.
|
3. rcS.template.
|
||||||
The file examples/nsh/rcS.template contains the general form
|
The file examples/nsh/rcS.template contains the general form
|
||||||
of the rcS file; configurated values are plugged into this
|
of the rcS file; configured values are plugged into this
|
||||||
template file to produce the final rcS file.
|
template file to produce the final rcS file.
|
||||||
|
|
||||||
|
NOTE:
|
||||||
|
|
||||||
|
examples/nsh/rcS.template generates the standard, default
|
||||||
|
nsh_romfsimg.h file. If CONFIG_EXAMPLES_NSH_ARCHROMFS is defined
|
||||||
|
in the NuttX configuration file, then a custom, board-specific
|
||||||
|
nsh_romfsimg.h file residing in configs/<board>/include will be
|
||||||
|
used. NOTE when the OS is configured, include/arch/board will
|
||||||
|
be linked to configs/<board>/include.
|
||||||
|
|
||||||
All of the startup-behavior is contained in rcS.template. The
|
All of the startup-behavior is contained in rcS.template. The
|
||||||
role of mkromfsimg.sh is to (1) apply the specific configuration
|
role of mkromfsimg.sh is to (1) apply the specific configuration
|
||||||
settings to rcS.template to create the final rcS, and (2) to
|
settings to rcS.template to create the final rcS, and (2) to
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nsh/nsh_romfsetc.c
|
* examples/nsh/nsh_romfsetc.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2010 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2011 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -49,7 +49,15 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_EXAMPLES_NSH_ROMFSETC
|
#ifdef CONFIG_EXAMPLES_NSH_ROMFSETC
|
||||||
|
|
||||||
#include "nsh_romfsimg.h"
|
/* Should we use the default ROMFS image? Or a custom, board-specific
|
||||||
|
* ROMFS image?
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_EXAMPLES_NSH_ARCHROMFS
|
||||||
|
# include <arch/board/nsh_romfsimg.h>
|
||||||
|
#else
|
||||||
|
# include "nsh_romfsimg.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
|
|||||||
@@ -31,6 +31,12 @@ mkconfig.c
|
|||||||
into include/nuttx/config.h. config.h is a another version of the
|
into include/nuttx/config.h. config.h is a another version of the
|
||||||
NuttX configuration that can be included by C files.
|
NuttX configuration that can be included by C files.
|
||||||
|
|
||||||
|
mkromfsimg.sh
|
||||||
|
|
||||||
|
This script may be used to automate the generate of a ROMFS file system
|
||||||
|
image. It accepts an rcS script "template" and generates and image that
|
||||||
|
may be mounted under /etc in the NuttX pseudo file system.
|
||||||
|
|
||||||
Makefile.mkconfig
|
Makefile.mkconfig
|
||||||
|
|
||||||
This is the makefile that is used to make the mkconfig program from
|
This is the makefile that is used to make the mkconfig program from
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
############################################################################
|
############################################################################
|
||||||
# examples/nsh/mkromfsimg.sh
|
# tools/mkromfsimg.sh
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
Reference in New Issue
Block a user