Resync new repository with old repo r5166
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5153 42af7a65-404d-4744-a932-0658087f49c3
|
After Width: | Height: | Size: 34 KiB |
@@ -0,0 +1,388 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NFS Client How-To</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<hr><hr>
|
||||
|
||||
<table width ="100%">
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NFS Client How-To</i></font></big></h1>
|
||||
<p>Last Updated: June 18, 2012</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr><hr>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1>Table of Contents</h1>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<center><table width ="80%">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#nfsconfiguration">Adding NFS to the NuttX Configuration</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#mountinterface">Mount Interface</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#nfsmount">NFS Mount Command</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#serverconfig">Configuring the NFS server (Ubuntu)</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table></center>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="nfsconfiguration"><h1>Adding NFS to the NuttX Configuration</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
The NFS client is easily added to your configuration:
|
||||
You simply need to add <code>CONFIG_NFS</code> to your <code>nuttx/.config</code> file.
|
||||
There are, however, a few dependencies on other system settings:
|
||||
</p>
|
||||
<ol>
|
||||
<li>
|
||||
First, there are number of things that you must configure in order to be able to use any file system:
|
||||
</li>
|
||||
<ul>
|
||||
<li>
|
||||
<code>CONFIG_NFILE_DESCRIPTORS > 0</code>. You must include support for file descriptors.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_DISABLE_MOUNTPOINT=n</code>. You must include support for mount points in the pseudo-file system.
|
||||
</li>
|
||||
</ul>
|
||||
<li>
|
||||
And there are several dependencies on the networking configuration.
|
||||
At a minimum, you need to have the following selections:
|
||||
</li>
|
||||
<ul>
|
||||
<li>
|
||||
<code>CONFIG_NET=y</code>. General networking support.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_UDP=y</code>. Support for UDP.
|
||||
</li>
|
||||
</ul>
|
||||
</ol>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="mountinterface"><h1>Mount Interface</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
A low-level, C-callable interface is provided to mount a file system.
|
||||
That interface is called <code>mount()</code> and is mentioned in the <a href="NuttxPortingGuide.html#NxFileSystem"><code>porting guide</code></a> and is prototyped in the header file <code>include/sys/mount.h</code>:
|
||||
</p>
|
||||
<ul><pre>
|
||||
int mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data);
|
||||
</pre></ul>
|
||||
<p>
|
||||
<b>Synopsis</b>:
|
||||
<code>mount()</code> attaches the filesystem specified by the <code>source</code> block device name into the root file system at the path specified by <code>target</code>.
|
||||
</p>
|
||||
<p>
|
||||
<b>Input Paramters</b>:
|
||||
<ul>
|
||||
<li><code>source</code>. A null-terminated string providing the fill path to a block driver in the NuttX pseudo-file system.
|
||||
<li><code>target</code>. The location in the NuttX pseudo-file system where the volume will be mounted.
|
||||
<li><code>filesystemtype</code>. A string identifying the type of file system to use.
|
||||
<li><code>mountflags</code>. Various flags that can be used to qualify how the file system is mounted.
|
||||
<li><code>data</code>. Opaque data that is passed to the file system with the mount occurs.
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
<b>Returned Values</b>
|
||||
Zero is returned on success; -1 is returned on an error and <code>errno</code> is set appropriately:
|
||||
<ul>
|
||||
<li><code>EACCES</code>.
|
||||
A component of a path was not searchable or mounting a read-onlyfilesystem was attempted without giving the <code>MS_RDONLY</code> flag.
|
||||
</li>
|
||||
<li><code>EBUSY</code>.
|
||||
<code>source</code> is already mounted.
|
||||
</li>
|
||||
<li><code>EFAULT</code>.
|
||||
One of the pointer arguments points outside the user address space.
|
||||
</li>
|
||||
<li><code>EINVAL</code>.
|
||||
<code>source</code> had an invalid superblock.
|
||||
</li>
|
||||
<li><code>ENODEV</code>.
|
||||
<code>filesystemtype</code> not configured
|
||||
</li>
|
||||
<li><code>ENOENT</code>.
|
||||
A pathname was empty or had a nonexistent component.
|
||||
</li>
|
||||
<li><code>ENOMEM</code>.
|
||||
Could not allocate a memory to copy filenames or data into.
|
||||
</li>
|
||||
<li><code>ENOTBLK</code>.
|
||||
<code>source</code> is not a block device
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
This same interface can be used to mount a remote, NFS file system using some special parameters.
|
||||
The NFS mount differs from the <i>normal</i> file system mount in that: (1) there is no block driver for the NFS file system, and (2) special parameters must be passed as <code>data</code> to describe the remote NFS server.
|
||||
Thus the following code snippet might represent how an NFS file system is mounted:
|
||||
</p>
|
||||
<ul><pre>
|
||||
#include <sys/mount.h>
|
||||
#include <nuttx/fs/nfs.h>
|
||||
|
||||
struct nfs_args data;
|
||||
char *mountpoint;
|
||||
|
||||
ret = mount(NULL, mountpoint, string "nfs", 0, (FAR void *)&data);
|
||||
</pre></ul>
|
||||
<p>
|
||||
NOTE that: (1) the block driver paramter is <code>NULL</code>.
|
||||
The <code>mount()</code> is smart enough to know that no block driver is needed with the NFS file system.
|
||||
(2) The NFS file system is identified with the simple string "nfs"
|
||||
(3) A reference to <code>struct nfs_args</code> is passed as an NFS-specific argument.
|
||||
</p>
|
||||
<p>
|
||||
The NFS-specific interface is described in the file <code>include/nuttx/fs/nfs.h</code>.
|
||||
There you can see that <code>struct nfs_args</code> is defined as:
|
||||
</p>
|
||||
<ul><pre>
|
||||
struct nfs_args
|
||||
{
|
||||
uint8_t addrlen; /* Length of address */
|
||||
uint8_t sotype; /* Socket type */
|
||||
uint8_t flags; /* Flags, determines if following are valid: */
|
||||
uint8_t timeo; /* Time value in deciseconds (with NFSMNT_TIMEO) */
|
||||
uint8_t retrans; /* Times to retry send (with NFSMNT_RETRANS) */
|
||||
uint16_t wsize; /* Write size in bytes (with NFSMNT_WSIZE) */
|
||||
uint16_t rsize; /* Read size in bytes (with NFSMNT_RSIZE) */
|
||||
uint16_t readdirsize; /* readdir size in bytes (with NFSMNT_READDIRSIZE) */
|
||||
char *path; /* Server's path of the directory being mount */
|
||||
struct sockaddr_storage addr; /* File server address (requires 32-bit alignment) */
|
||||
};
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="nfsmount"><h1>NFS Mount Command</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
The <a href="NuttShell.html">NuttShell (NSH)</a> also supports a command called <code>nfsmount</code>
|
||||
that can be used to mount a remote file system via the NSH command line.
|
||||
</p>
|
||||
<p>
|
||||
<b>Command Syntax:</b>
|
||||
</p>
|
||||
<ul><pre>
|
||||
nfsmount <server-address> <mount-point> <remote-path>
|
||||
</pre></ul>
|
||||
<p>
|
||||
<b>Synopsis</b>.
|
||||
The <code>nfsmount</code> command mounts a network file system in the NuttX pseudo filesystem.
|
||||
The <code>nfsmount</code> will use NFSv3 UDP protocol to mount the remote file system.
|
||||
</p>
|
||||
<p>
|
||||
<b>Command Line Arguments</b>.
|
||||
The <code>nfsmount</code> takes three arguments:
|
||||
</p>
|
||||
<ol>
|
||||
<li>
|
||||
The <code><server-address></code> is the IP address of the server exporting the file system you wish to mount.
|
||||
This implementation of NFS for the NuttX RTOS is only for a local area network, so the server and client must be in the same network.
|
||||
</li>
|
||||
<li>
|
||||
The <code><mount-point ></code> is the location in the NuttX pseudo filesystem where the mounted volume will appear.
|
||||
This mount point can only reside in the NuttX pseudo filesystem.
|
||||
By convention, this mount point is a subdirectory under <code>/mnt</code>.
|
||||
The mount command will create whatever pseudo directories that may be needed to complete the full path (but the full path must not already exist).
|
||||
</li>
|
||||
<li>
|
||||
The <code><remote-path></code> is the file system <code>/</code> directory being exported from server.
|
||||
This <code>/</code> directory must have been configured for exportation on the server before when the NFS server was set up.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
After the volume has been mounted in the NuttX pseudo filesystem, it may be access in the same way as other objects in the file system.
|
||||
</p>
|
||||
<p>
|
||||
<b>Example</b>.
|
||||
Suppose the the NFS server has been configured to export the directory <code>/export/shared</code>.
|
||||
The the following command would mount that file system (assuming that the target also has privileges to mount the file system).
|
||||
</p>
|
||||
<ul><pre>
|
||||
NuttShell (NSH)
|
||||
nsh> ls /mnt
|
||||
/mnt:
|
||||
nsh: ls: no such directory: /mnt
|
||||
nsh> nfsmount 10.0.0.1 /mnt/nfs /export/shared
|
||||
nsh> ls -l /mnt/nfs
|
||||
/mnt/nfs:
|
||||
drwxrwxrwx 4096 ..
|
||||
drwxrwxrwx 4096 testdir/
|
||||
-rw-rw-rw- 6 ctest.txt
|
||||
-rw-r--r-- 15 btest.txt
|
||||
drwxrwxrwx 4096 .
|
||||
nsh> echo "This is a test" >/mnt/nfs/testdir/testfile.txt
|
||||
nsh> ls -l /mnt/nfs/testdir
|
||||
/mnt/nfs/testdir:
|
||||
-rw-rw-rw- 21 another.txt
|
||||
drwxrwxrwx 4096 ..
|
||||
drwxrwxrwx 4096 .
|
||||
-rw-rw-rw- 16 testfile.txt
|
||||
nsh> cat /mnt/nfs/testdir/testfile.txt
|
||||
This is a test
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="serverconfig"><h1>Configuring the NFS server (Ubuntu)</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
Setting up the server will be done in two steps:
|
||||
First, setting up the configuration file for NFS, and then starting the NFS services.
|
||||
But first, you need to install the nfs server on Ubuntu with the these two commands:
|
||||
</p>
|
||||
<ul><pre>
|
||||
# sudo apt-get install nfs-common</FONT>
|
||||
# sudo apt-get install nfs-kernel-server</FONT>
|
||||
</pre></ul>
|
||||
|
||||
<p>
|
||||
After that, we need to make or choose the directory we want to export from the NFS server.
|
||||
In our case, we are going to make a new directory called <code>/export</code>.
|
||||
</p>
|
||||
<ul><pre>
|
||||
# sudo mkdir /export
|
||||
</pre></ul>
|
||||
<p>
|
||||
It is important that <code>/export</code> directory allow access to everyone (777 permissions) as we will be accessing the NFS share from the client with no authentication.
|
||||
</p>
|
||||
<ul><pre>
|
||||
# sudo chmod 777 /export
|
||||
</pre></ul>
|
||||
<p>
|
||||
When all this is done, we will need to edit the configuration file to set up an NFS server: <code>/etc/exports</code>.
|
||||
This file contains a list of entries;
|
||||
each entry indicates a volume that is shared and how it is shared.
|
||||
For more information for a complete description of all the setup options for this file you can check in the man pages (<code>man export</code>).</p>
|
||||
An entry in <code>/etc/exports</code> will typically look like this:
|
||||
</p>
|
||||
<ul><pre>
|
||||
directory machine1(option11,option12)
|
||||
</pre></ul>
|
||||
<p>
|
||||
So for our example we export <coce>/export</code> to the client 10.0.0.2 add the entry:
|
||||
</p>
|
||||
<ul><pre>
|
||||
/export 10.0.0.2(rw)
|
||||
</pre></ul>
|
||||
<p>
|
||||
In our case we are using all the default options except for the <code>ro</code> that we replaced with <code>rw</code> so that our client will have read and write access to the directory that we are exporting.
|
||||
</p>
|
||||
</p>
|
||||
After we do all the require configurations, we are ready to start the server with the next command:
|
||||
</p>
|
||||
<ul><pre>
|
||||
# sudo /etc/init.d/nfs-kernel-server start
|
||||
</pre></ul>
|
||||
</p>
|
||||
Note: If you later decide to add more NFS exports to the /etc/exports file, you will need to either restart NFS daemon
|
||||
or run command exportfs.
|
||||
</p>
|
||||
<ul><pre>
|
||||
# sudo /etc/init.d/nfs-kernel-server start
|
||||
</pre></ul>
|
||||
<p>Or</p>
|
||||
<ul><pre>
|
||||
# exportfs -ra
|
||||
</pre></ul>
|
||||
<p>
|
||||
Now we can check if the export directory and our mount point is properly set up.
|
||||
</p>
|
||||
<ul><pre>
|
||||
# sudo showmount -e
|
||||
# sudo showmount -a
|
||||
</pre></ul>
|
||||
<p>
|
||||
And also we can verify if NFS is running in the system with:
|
||||
</p>
|
||||
<P STYLE="margin-left: 0.49in; margin-bottom: 0in; line-height: 100%">
|
||||
<ul><pre>
|
||||
# rpcinfo –p</FONT>
|
||||
program vers proto port
|
||||
100000 2 tcp 111 portmapper
|
||||
100000 2 udp 111 portmapper
|
||||
100011 1 udp 749 rquotad
|
||||
100011 2 udp 749 rquotad
|
||||
100005 1 udp 759 mountd
|
||||
100005 1 tcp 761 mountd
|
||||
100005 2 udp 764 mountd
|
||||
100005 2 tcp 766 mountd
|
||||
100005 3 udp 769 mountd
|
||||
100005 3 tcp 771 mountd
|
||||
100003 2 udp 2049 nfs
|
||||
100003 3 udp 2049 nfs
|
||||
300019 1 tcp 830 amd
|
||||
300019 1 udp 831 amd
|
||||
100024 1 udp 944 status
|
||||
100024 1 tcp 946 status
|
||||
100021 1 udp 1042 nlockmgr
|
||||
100021 3 udp 1042 nlockmgr
|
||||
100021 4 udp 1042 nlockmgr
|
||||
100021 1 tcp 1629 nlockmgr
|
||||
100021 3 tcp 1629 nlockmgr
|
||||
100021 4 tcp 1629 nlockmgr
|
||||
</pre></ul>
|
||||
<p>
|
||||
Now your NFS sever is sharing <code>/export</code> directory to be accessed.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
@@ -0,0 +1,32 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NuttX Banner</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="80" height="100" rowspan="2">
|
||||
<img src="NuttX.png" width="80">
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4" height="20"> </td>
|
||||
<td width="100" align="center">
|
||||
<a href="http://sourceforge.net/projects/nuttx" target="_top">
|
||||
<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=189573&type=8" width="80" height="15" border="0" alt="Get NuttX at SourceForge.net. Fast, secure and Free Open Source software downloads" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="bottom">
|
||||
<h1><i><font color="#3c34ec">NuttX RTOS</font></i></b></h1>
|
||||
</td>
|
||||
<td width="100" align="center" valign="top">
|
||||
<a href="http://groups.yahoo.com/group/nuttx/join" target="_top">
|
||||
<img src="http://us.i1.yimg.com/us.yimg.com/i/yg/img/i/us/ui/join.gif"
|
||||
style="border: 0px;"
|
||||
alt="Click to join nuttx"/>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,74 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NuttX Links</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<table width="100%>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<a href="NuttXLinks.html">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</a>
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Project Links</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<a href="NuttXDocumentation.html">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</a>
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Documentation</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<a href="NuttXRelated.html">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</a>
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Related Projects</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Commercial Sites</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<li><a href="http://www.nx-engineering.com" target="main">NX-Engineering</a></li>
|
||||
<li><a href="http://www.raztek-inc.com" target="main">Raztek Solutions</a></li>
|
||||
<li><a href="http://www.2g-eng.com" target="top">2G Engineering</a></li>
|
||||
<li><a href="http://isotel.eu/Home/" target="top">ISOTEL Research</a></li>
|
||||
<li><a href="http://www.dspworks.in/" target="top">DSPWorks</a></li>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center" valign="top">
|
||||
<a href="http://download.famouswhy.com/nuttx/" target="_blank">
|
||||
<img src="http://download.famouswhy.com/awards/Famous_Software_Award_Logo.png" alt="NuttX" style="border:0">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center" valign="top">
|
||||
<a href="http://www.fiberdownload.com/Download/26542/NuttX" target="_blank">
|
||||
<img src="editor_pick_2.png" alt="NuttX" style="border:0">
|
||||
<img src="award2_151_50.png" alt="NuttX" style="border:0">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,674 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>On-Demand Paging</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<hr><hr>
|
||||
<table width ="100%">
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>On-Demand Paging</i></font></big></h1>
|
||||
<p>Last Updated: August 12, 2010</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr><hr>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1>Table of Contents</h1>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<center><table width ="80%">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#Introduction">Introduction</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="#Overview">Overview</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="#Terminology">Terminology</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#NuttXDesign">NuttX Common Logic Design Description</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="#Initialization">Initialization</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="#PageFaults">Page Faults</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="#FillInitiation">Fill Initiation</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="#FillComplete">Fill Complete</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="#TaskResumption">Task Resumption</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#ArchSupport">Architecture-Specific Support Requirements</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="#MemoryOrg">Memory Organization</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="#ArchFuncs">Architecture-Specific Functions</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table></center>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="Introduction"><h1>Introduction</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<a name="Overview"><h2>Overview</h2></a>
|
||||
|
||||
<p>
|
||||
This document summarizes the design of NuttX on-demand paging.
|
||||
This feature permits embedded MCUs with some limited RAM space to execute large programs from some non-random access media.
|
||||
This feature was first discussed in this email thread:
|
||||
<a href="http://tech.groups.yahoo.com/group/nuttx/message/213">http://tech.groups.yahoo.com/group/nuttx/message/213</a>.
|
||||
</p>
|
||||
<p>
|
||||
What kind of platforms can support NuttX on-demang paging?
|
||||
<ol>
|
||||
<li>
|
||||
The MCU should have some large, probably low-cost non-volatile storage such as serial FLASH or an SD card.
|
||||
This storage probably does not support non-random access (otherwise, why not just execute the program directly on the storage media).
|
||||
SD and serial FLASH are inexpensive and do not require very many pins and SPI support is prevalent in just about all MCUs.
|
||||
This large serial FLASH would contain a big program. Perhaps a program of several megabytes in size.
|
||||
</li>
|
||||
<li>
|
||||
The MCU must have a (relatively) small block of fast SRAM from which it can execute code.
|
||||
A size of, say 256K (or 192K as in the NXP LPC3131) would be sufficient for many applications.
|
||||
</li>
|
||||
<li>
|
||||
The MCU has an MMU (again like the NXP LPC3131).
|
||||
</li>
|
||||
</ol>
|
||||
</p>
|
||||
<p>
|
||||
If the platform meets these requirement, then NuttX can provide on-demand paging:
|
||||
It can copy .text from the large program in non-volatile media into RAM as needed to execute a huge program from the small RAM.
|
||||
</p>
|
||||
|
||||
<a name="Terminology"><h2>Terminology</h2></a>
|
||||
|
||||
<dl>
|
||||
<dt><code>g_waitingforfill</code></dt>
|
||||
<dd>An OS list that is used to hold the TCBs of tasks that are waiting for a page fill.</dd>
|
||||
<dt><code>g_pftcb</code></dt>
|
||||
<dd>A variable that holds a reference to the TCB of the thread that is currently be re-filled.</dd>
|
||||
<dt><code>g_pgworker</code></dt>
|
||||
<dd>The <i>process</i> ID of of the thread that will perform the page fills.</dd>
|
||||
<dt><code>pg_callback()</code></dt>
|
||||
<dd>The callback function that is invoked from a driver when the fill is complete.</dd>
|
||||
<dt><code>pg_miss()</code></dt>
|
||||
<dd>The function that is called from architecture-specific code to handle a page fault.</dd>
|
||||
<dt><code>TCB</code></dt>
|
||||
<dd>Task Control Block</dd>
|
||||
</dl>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="NuttXDesign"><h1>NuttX Common Logic Design Description</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<a name="Initialization"><h2>Initialization</h2></a>
|
||||
|
||||
<p>
|
||||
The following declarations will be added.
|
||||
<ul>
|
||||
<li>
|
||||
<b><code>g_waitingforfill</code></b>.
|
||||
A doubly linked list that will be used to implement a prioritized list of the TCBs of tasks that are waiting for a page fill.
|
||||
</li>
|
||||
<li>
|
||||
<b><code>g_pgworker</code></b>.
|
||||
The <i>process</i> ID of of the thread that will perform the page fills
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
During OS initialization in <code>sched/os_start.c</code>, the following steps
|
||||
will be performed:
|
||||
<ul>
|
||||
<li>
|
||||
The <code>g_waitingforfill</code> queue will be initialized.
|
||||
</li>
|
||||
<li>
|
||||
The special, page fill worker thread, will be started.
|
||||
The <code>pid</code> of the page will worker thread will be saved in <code>g_pgworker</code>.
|
||||
Note that we need a special worker thread to perform fills;
|
||||
we cannot use the "generic" worker thread facility because we cannot be
|
||||
assured that all actions called by that worker thread will always be resident in memory.
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
Declarations for <code>g_waitingforfill</code>, <code>g_pgworker</code>, and other
|
||||
internal, private definitions will be provided in <code>sched/pg_internal.h</code>.
|
||||
All public definitions that should be used by the architecture-specific code will be available
|
||||
in <code>include/nuttx/page.h</code>.
|
||||
Most architecture-specific functions are declared in <code>include/nuttx/arch.h</code>,
|
||||
but for the case of this paging logic, those architecture specific functions are instead declared in <code>include/nuttx/page.h</code>.
|
||||
</p>
|
||||
|
||||
<a name="PageFaults"><h2>Page Faults</h2></a>
|
||||
|
||||
<p>
|
||||
<b>Page fault exception handling</b>.
|
||||
Page fault handling is performed by the function <code>pg_miss()</code>.
|
||||
This function is called from architecture-specific memory segmentation
|
||||
fault handling logic. This function will perform the following
|
||||
operations:
|
||||
<ol>
|
||||
<li>
|
||||
<b>Sanity checking</b>.
|
||||
This function will ASSERT if the currently executing task is the page fill worker thread.
|
||||
The page fill worker thread is how the the page fault is resolved and all logic associated with the page fill worker
|
||||
must be "<a href="#MemoryOrg">locked</a>" and always present in memory.
|
||||
</li>
|
||||
<li>
|
||||
<b>Block the currently executing task</b>.
|
||||
This function will call <code>up_block_task()</code> to block the task at the head of the ready-to-run list.
|
||||
This should cause an interrupt level context switch to the next highest priority task.
|
||||
The blocked task will be marked with state <code>TSTATE_WAIT_PAGEFILL</code> and will be retained in the <code>g_waitingforfill</code> prioritized task list.
|
||||
</li>
|
||||
<li>
|
||||
<b>Boost the page fill worker thread priority</b>.
|
||||
Check the priority of the task at the head of the <code>g_waitingforfill</code> list.
|
||||
If the priority of that task is higher than the current priority of the page fill worker thread, then boost the priority of the page fill worker thread to that priority.
|
||||
Thus, the page fill worker thread will always run at the priority of the highest priority task that is waiting for a fill.
|
||||
</li>
|
||||
<li>
|
||||
<b>Signal the page fill worker thread</b>.
|
||||
Is there a page already being filled?
|
||||
If not then signal the page fill worker thread to start working on the queued page fill requests.
|
||||
</li>
|
||||
</ol>
|
||||
</p>
|
||||
<p>
|
||||
When signaled from <code>pg_miss()</code>, the page fill worker thread will be awakenend and will initiate the fill operation.
|
||||
</p>
|
||||
<p>
|
||||
<b>Input Parameters.</b>
|
||||
None -- The head of the ready-to-run list is assumed to be that task that caused the exception.
|
||||
The current task context should already be saved in the TCB of that task.
|
||||
No additional inputs are required.
|
||||
</p>
|
||||
<p>
|
||||
<b>Assumptions</b>.
|
||||
<ul>
|
||||
<li>
|
||||
It is assumed that this function is called from the level of an exception handler and that all interrupts are disabled.
|
||||
</li>
|
||||
<li>
|
||||
The <code>pg_miss()</code> must be "<a href="#MemoryOrg">locked</a>" in memory.
|
||||
Calling <code>pg_miss()</code> cannot cause a nested page fault.
|
||||
</li>
|
||||
<li>
|
||||
It is assumed that currently executing task (the one at the head of the ready-to-run list) is the one that cause the fault.
|
||||
This will always be true unless the page fault occurred in an interrupt handler.
|
||||
Interrupt handling logic must always be available and "<a href="#MemoryOrg">locked</a>" into memory so that page faults never come from interrupt handling.
|
||||
</li>
|
||||
<li>
|
||||
The architecture-specific page fault exception handling has already verified that the exception did not occur from interrupt/exception handling logic.
|
||||
</li>
|
||||
<li>
|
||||
As mentioned above, the task causing the page fault must not be the page fill worker thread because that is the only way to complete the page fill.
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<a name="FillInitiation"><h2>Fill Initiation</h2></a>
|
||||
|
||||
<p>
|
||||
The page fill worker thread will be awakened on one of three conditions:
|
||||
<ul>
|
||||
<li>
|
||||
When signaled by <code>pg_miss()</code>, the page fill worker thread will be awakenend (see above),
|
||||
</li>
|
||||
<li>
|
||||
From <code>pg_callback()</code> after completing last fill (when <code>CONFIG_PAGING_BLOCKINGFILL</code> is defined... see below), or
|
||||
</li>
|
||||
<li>
|
||||
A configurable timeout expires with no activity.
|
||||
This timeout can be used to detect failure conditions such things as fills that never complete.
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The page fill worker thread will maintain a static variable called <code>_TCB *g_pftcb</code>.
|
||||
If no fill is in progress, <code>g_pftcb</code> will be NULL.
|
||||
Otherwise, it will point to the TCB of the task which is receiving the fill that is in progess.
|
||||
</p>
|
||||
<ul><small>
|
||||
<b>NOTE</b>:
|
||||
I think that this is the only state in which a TCB does not reside in some list.
|
||||
Here is it in limbo, outside of the normally queuing while the page file is in progress.
|
||||
While here, it will be marked with TSTATE_TASK_INVALID.
|
||||
</small></ul>
|
||||
|
||||
<p>
|
||||
When awakened from <code>pg_miss()</code>, no fill will be in progress and <code>g_pftcb</code> will be NULL.
|
||||
In this case, the page fill worker thread will call <code>pg_startfill()</code>.
|
||||
That function will perform the following operations:
|
||||
<ul>
|
||||
<li>
|
||||
Call the architecture-specific function <code>up_checkmapping()</code> to see if the page fill
|
||||
still needs to be performed.
|
||||
In certain conditions, the page fault may occur on several threads and be queued multiple times.
|
||||
In this corner case, the blocked task will simply be restarted (see the logic below for the
|
||||
case of normal completion of the fill operation).
|
||||
</li>
|
||||
<li>
|
||||
Call <code>up_allocpage(tcb, &vpage)</code>.
|
||||
This architecture-specific function will set aside page in memory and map to virtual address (vpage).
|
||||
If all available pages are in-use (the typical case),
|
||||
this function will select a page in-use, un-map it, and make it available.
|
||||
</li>
|
||||
<li>
|
||||
Call the architecture-specific function <code>up_fillpage()</code>.
|
||||
Two versions of the up_fillpage function are supported -- a blocking and a non-blocking version based upon the configuratin setting <code>CONFIG_PAGING_BLOCKINGFILL</code>.
|
||||
<ul>
|
||||
<li>
|
||||
If <code>CONFIG_PAGING_BLOCKINGFILL</code> is defined, then up_fillpage is blocking call.
|
||||
In this case, <code>up_fillpage()</code> will accept only (1) a reference to the TCB that requires the fill.
|
||||
Architecture-specific context information within the TCB will be sufficient to perform the fill.
|
||||
And (2) the (virtual) address of the allocated page to be filled.
|
||||
The resulting status of the fill will be provided by return value from <code>up_fillpage()</code>.
|
||||
</li>
|
||||
<li>
|
||||
If <code>CONFIG_PAGING_BLOCKINGFILL</code> is defined, then up_fillpage is non-blocking call.
|
||||
In this case <code>up_fillpage()</code> will accept an additional argument:
|
||||
The page fill worker thread will provide a callback function, <code>pg_callback</code>.
|
||||
This function is non-blocking, it will start an asynchronous page fill.
|
||||
After calling the non-blocking <code>up_fillpage()</code>, the page fill worker thread will wait to be signaled for the next event -- the fill completion event.
|
||||
The callback function will be called when the page fill is finished (or an error occurs).
|
||||
The resulting status of the fill will be providing as an argument to the callback functions.
|
||||
This callback will probably occur from interrupt level.
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
In any case, while the fill is in progress, other tasks may execute.
|
||||
If another page fault occurs during this time, the faulting task will be blocked, its TCB will be added (in priority order) to <code>g_waitingforfill</code>, and the priority of the page worker task may be boosted.
|
||||
But no action will be taken until the current page fill completes.
|
||||
NOTE: The IDLE task must also be fully <a href="#MemoryOrg">locked</a> in memory.
|
||||
The IDLE task cannot be blocked.
|
||||
It the case where all tasks are blocked waiting for a page fill, the IDLE task must still be available to run.
|
||||
<p>
|
||||
The architecture-specific functions, <code>up_checkmapping()</code>, <code>up_allocpage(tcb, &vpage)</code> and <code>up_fillpage(page, pg_callback)</code>
|
||||
will be prototyped in <code>include/nuttx/arch.h</code>
|
||||
</p>
|
||||
|
||||
<a name="FillComplete"><h2>Fill Complete</h2></a>
|
||||
|
||||
<p>
|
||||
For the blocking <code>up_fillpage()</code>, the result of the fill will be returned directly from the call to <code>up_fillpage</code>.
|
||||
</p>
|
||||
<p>
|
||||
For the non-blocking <code>up_fillpage()</code>, the architecture-specific driver call the <code>pg_callback()</code> that was provided to <code>up_fillpage()</code> when the fill completes.
|
||||
In this case, the <code>pg_callback()</code> will probably be called from driver interrupt-level logic.
|
||||
The driver will provide the result of the fill as an argument to the callback function.
|
||||
NOTE: <code>pg_callback()</code> must also be <a href="#MemoryOrg">locked</a> in memory.
|
||||
</p>
|
||||
<p>
|
||||
In this non-blocking case, the callback <code>pg_callback()</code> will perform the following operations when it is notified that the fill has completed:
|
||||
<ul>
|
||||
<li>
|
||||
Verify that <code>g_pftcb</code> is non-NULL.
|
||||
</li>
|
||||
<li>
|
||||
Find the higher priority between the task waiting for the fill to complete in <code>g_pftcb</code> and the task waiting at the head of the <code>g_waitingforfill</code> list.
|
||||
That will be the priority of he highest priority task waiting for a fill.
|
||||
</li>
|
||||
<li>
|
||||
If this higher priority is higher than current page fill worker thread, then boost worker thread's priority to that level.
|
||||
Thus, the page fill worker thread will always run at the priority of the highest priority task that is waiting for a fill.
|
||||
</li>
|
||||
<li>
|
||||
Save the result of the fill operation.
|
||||
</li>
|
||||
<li>
|
||||
Signal the page fill worker thread.
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<a name="TaskResumption"><h2>Task Resumption</h2></a>
|
||||
|
||||
<p>
|
||||
For the non-blocking <code>up_fillpage()</code>, the page fill worker thread will detect that the page fill is complete when it is awakened with <code>g_pftcb</code> non-NULL and fill completion status from <code>pg_callback</code>.
|
||||
In the non-blocking case, the page fill worker thread will know that the page fill is complete when <code>up_fillpage()</code> returns.
|
||||
</p>
|
||||
<p>
|
||||
In this either, the page fill worker thread will:
|
||||
<ul>
|
||||
<li>
|
||||
Verify consistency of state information and <code>g_pftcb</code>.
|
||||
</li>
|
||||
<li>
|
||||
Verify that the page fill completed successfully, and if so,
|
||||
</li>
|
||||
<li>
|
||||
Call <code>up_unblocktask(g_pftcb)</code> to make the task that just received the fill ready-to-run.
|
||||
</li>
|
||||
<li>
|
||||
Check if the <code>g_waitingforfill</code> list is empty.
|
||||
If not:
|
||||
<ul>
|
||||
<li>
|
||||
Remove the highest priority task waiting for a page fill from <code>g_waitingforfill</code>,
|
||||
</li>
|
||||
<li>
|
||||
Save the task's TCB in <code>g_pftcb</code>,
|
||||
</li>
|
||||
<li>
|
||||
If the priority of the thread in <code>g_pftcb</code>, is higher in priority than the default priority of the page fill worker thread, then set the priority of the page fill worker thread to that priority.
|
||||
</li>
|
||||
<li>
|
||||
Call <code>pg_startfill()</code> which will start the next fill (as described above).
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
Otherwise,
|
||||
<ul>
|
||||
<li>
|
||||
Set <code>g_pftcb</code> to NULL.
|
||||
</li>
|
||||
<li>
|
||||
Restore the default priority of the page fill worker thread.
|
||||
</li>
|
||||
<li>
|
||||
Wait for the next fill related event (a new page fault).
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="ArchSupport"><h1>Architecture-Specific Support Requirements</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name="MemoryOrg"><h2>Memory Organization</h2></a>
|
||||
|
||||
<p>
|
||||
<b>Memory Regions</b>.
|
||||
Chip specific logic will map the virtual and physical address spaces into three general regions:
|
||||
<ol>
|
||||
<li>
|
||||
A .text region containing "<a href="#MemoryOrg">locked-in-memory</a>" code that is always avaialable and will never cause a page fault.
|
||||
This locked memory is loaded at boot time and remains resident for all time.
|
||||
This memory regions must include:
|
||||
<ul>
|
||||
<li>
|
||||
All logic for all interrupt paths.
|
||||
All interrupt logic must be locked in memory because the design present here will not support page faults from interrupt handlers.
|
||||
This includes the page fault handling logic and <a href="#PageFaults"><code>pg_miss()</code></a> that is called from the page fault handler.
|
||||
It also includes the <a href="#FillComplete"><code>pg_callback()</code></a> function that wakes up the page fill worker thread
|
||||
and whatever architecture-specific logic that calls <code>pg_callback()</code>.
|
||||
</li>
|
||||
<li>
|
||||
All logic for the IDLE thread.
|
||||
The IDLE thread must always be ready to run and cannot be blocked for any reason.
|
||||
</li>
|
||||
<li>
|
||||
All of the page fill worker thread must be locked in memory.
|
||||
This thread must execute in order to unblock any thread waiting for a fill.
|
||||
It this thread were to block, there would be no way to complete the fills!
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
A .text region containing pages that can be assigned allocated, mapped to various virtual addresses, and filled from some mass storage medium.
|
||||
</li>
|
||||
<li>
|
||||
And a fixed RAM space for .bss, .text, and .heap.
|
||||
</li>
|
||||
</ol>
|
||||
</p>
|
||||
<p>
|
||||
This memory organization is illustrated in the following table.
|
||||
Notice that:
|
||||
<ul>
|
||||
<li>
|
||||
There is a one-to-one relationship between pages in the virtual address space and between pages of .text in the non-volatile mass storage device.
|
||||
</li>
|
||||
<li>
|
||||
There are, however, far fewer physical pages available than virtual pages.
|
||||
Only a subset of physical pages will be mapped to virtual pages at any given time.
|
||||
This mapping will be performed on-demand as needed for program execution.
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<center><table width="80%">
|
||||
<tr>
|
||||
<th width="33%">SRAM</th>
|
||||
<th width="33%">Virtual Address Space</th>
|
||||
<th width="34%">Non-Volatile Storage</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td bgcolor="lightslategray">DATA</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td bgcolor="lightskyblue">Virtual Page <i>n</i> (<i>n</i> > <i>m</i>)</td>
|
||||
<td bgcolor="lightskyblue">Stored Page <i>n</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td bgcolor="lightskyblue">Virtual Page <i>n-1</i></td>
|
||||
<td bgcolor="lightskyblue">Stored Page <i>n-1</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="lightslategray">DATA</td>
|
||||
<td bgcolor="lightskyblue">...</td>
|
||||
<td bgcolor="lightskyblue">...</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="lightskyblue">Physical Page <i>m</i> (<i>m</i> < <i>n</i>)</td>
|
||||
<td bgcolor="lightskyblue">...</td>
|
||||
<td bgcolor="lightskyblue">...</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="lightskyblue">Physical Page <i>m-1</i></td>
|
||||
<td bgcolor="lightskyblue">...</td>
|
||||
<td bgcolor="lightskyblue">...</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="lightskyblue">...</td>
|
||||
<td bgcolor="lightskyblue">...</td>
|
||||
<td bgcolor="lightskyblue">...</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="lightskyblue">Physical Page <i>1</i></td>
|
||||
<td bgcolor="lightskyblue">Virtual Page <i>1</i></td>
|
||||
<td bgcolor="lightskyblue">Stored Page <i>1</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="slategray">Locked Memory</td>
|
||||
<td bgcolor="slategray">Locked Memory</td>
|
||||
<td bgcolor="slategray">Memory Resident</td>
|
||||
</tr>
|
||||
</table></center>
|
||||
|
||||
<p>
|
||||
<b>Example</b>.
|
||||
As an example, suppose that the size of the SRAM is 192K (as in the NXP LPC3131). And suppose further that:
|
||||
<ul>
|
||||
<li>
|
||||
The size of the locked, memory resident .text area is 32K, and
|
||||
</li>
|
||||
<li>
|
||||
The size of the DATA area is 64K.
|
||||
</li>
|
||||
<li>
|
||||
The size of one, managed page is 1K.
|
||||
</li>
|
||||
<li>
|
||||
The size of the whole .text image on the non-volatile, mass storage device is 1024K.
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
Then, the size of the locked, memory resident code is 32K (<i>m</i>=32 pages).
|
||||
The size of the physical page region is 96K (96 pages), and the
|
||||
size of the data region is 64 pages.
|
||||
And the size of the virtual paged region must then be greater than or equal to (1024-32) or 992 pages (<i>n</i>).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Building the Locked, In-Memory Image</b>.
|
||||
One way to accomplish this would be a two phase link:
|
||||
<ul>
|
||||
<li>
|
||||
In the first phase, create a partially linked objected containing all interrupt/exception handling logic, the page fill worker thread plus all parts of the IDLE thread (which must always be available for execution).
|
||||
</li>
|
||||
<li>
|
||||
All of the <code>.text</code> and <code>.rodata</code> sections of this partial link should be collected into a single section.
|
||||
</li>
|
||||
<li>
|
||||
The second link would link the partially linked object along with the remaining object to produce the final binary.
|
||||
The linker script should position the "special" section so that it lies in a reserved, "non-swappable" region.
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<a name="ArchFuncs"><h2>Architecture-Specific Functions</h2></a>
|
||||
|
||||
<p>
|
||||
Most standard, architecture-specific functions are declared in <code>include/nuttx/arch.h</code>.
|
||||
However, for the case of this paging logic, the architecture specific functions are declared in <code>include/nuttx/page.h</code>.
|
||||
Standard, architecture-specific functions that should already be provided in the architecture port.
|
||||
The following are used by the common paging logic:
|
||||
</p>
|
||||
<ul><dl>
|
||||
<dt>
|
||||
<code>void up_block_task(FAR _TCB *tcb, tstate_t task_state);</code>
|
||||
</dt>
|
||||
<dd>
|
||||
The currently executing task at the head of the ready to run list must be stopped.
|
||||
Save its context and move it to the inactive list specified by task_state.
|
||||
This function is called by the on-demand paging logic in order to block the task that requires the
|
||||
page fill, and to
|
||||
</dd>
|
||||
<dt>
|
||||
<code>void up_unblock_task(FAR _TCB *tcb);</code>
|
||||
</dt>
|
||||
<dd>
|
||||
A task is currently in an inactive task list but has been prepped to execute.
|
||||
Move the TCB to the ready-to-run list, restore its context, and start execution.
|
||||
This function will be called
|
||||
</dd>
|
||||
</dl></ul>
|
||||
|
||||
<p>
|
||||
New, additional functions that must be implemented just for on-demand paging support:
|
||||
</p>
|
||||
|
||||
<ul><dl>
|
||||
<dt>
|
||||
<code>int up_checkmapping(FAR _TCB *tcb);</code>
|
||||
</dt>
|
||||
<dd>
|
||||
The function <code>up_checkmapping()</code> returns an indication if the page fill still needs to performed or not.
|
||||
In certain conditions, the page fault may occur on several threads and be queued multiple times.
|
||||
This function will prevent the same page from be filled multiple times.
|
||||
</dd>
|
||||
<dt>
|
||||
<code>int up_allocpage(FAR _TCB *tcb, FAR void *vpage);</code>
|
||||
</dt>
|
||||
<dd>
|
||||
This architecture-specific function will set aside page in memory and map to its correct virtual address.
|
||||
Architecture-specific context information saved within the TCB will provide the function with the information needed to identify the virtual miss address.
|
||||
This function will return the allocated physical page address in <code>vpage</code>.
|
||||
The size of the underlying physical page is determined by the configuration setting <code>CONFIG_PAGING_PAGESIZE</code>.
|
||||
NOTE: This function must <i>always</i> return a page allocation.
|
||||
If all available pages are in-use (the typical case), then this function will select a page in-use, un-map it, and make it available.
|
||||
</dd>
|
||||
<dt><code>int up_fillpage(FAR _TCB *tcb, FAR const void *vpage, void (*pg_callback)(FAR _TCB *tcb, int result));</code>
|
||||
</dt>
|
||||
The actual filling of the page with data from the non-volatile, must be performed by a separate call to the architecture-specific function, <code>up_fillpage()</code>.
|
||||
This will start asynchronous page fill.
|
||||
The common paging logic will provide a callback function, <code>pg_callback</code>, that will be called when the page fill is finished (or an error occurs).
|
||||
This callback is assumed to occur from an interrupt level when the device driver completes the fill operation.
|
||||
</dt>
|
||||
</dl></ul>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NuttX Links</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<table width="100%>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<a href="NuttXLinks.html">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</a>
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Project Links</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>NuttX Documentation</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<li><a href="NuttXGettingStarted.html" target="main">Getting Started</a></li>
|
||||
<li><a href="NuttxUserGuide.html" target="main">User Guide</a></li>
|
||||
<li><a href="NuttxPortingGuide.html" target="main">Porting Guide</a></li>
|
||||
<li><a href="NuttShell.html" target="main">NuttShell (NSH)</a></li>
|
||||
<li><a href="NuttXNxFlat.html" target="main">NXFLAT</a></li>
|
||||
<li><a href="NXGraphicsSubsystem.html" target="main">NX Graphics</a></li>
|
||||
<li><a href="NxWidgets.html" target="main">NxWidgets</a></li>
|
||||
<li><a href="NfsHowto.html" target="main">NFS How-To</a></li>
|
||||
<li><a href="NuttXDemandPaging.html" target="main">Demand Paging</a></li>
|
||||
<li><a href="UsbTrace.html" target="main">USB Trace</a></li>
|
||||
<li><a href="README.html" target="main">README Files</a></li>
|
||||
<li><a href="ChangeLog.txt" target="main">Change Log</a></li>
|
||||
<li><a href="TODO.txt" target="main">To-Do List</a></li>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<a href="NuttXRelated.html">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</a>
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Related Projects</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<a href="NuttXCommercial.html">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</a>
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Commercial Sites</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center" valign="top">
|
||||
<a href="http://download.famouswhy.com/nuttx/" target="_blank">
|
||||
<img src="http://download.famouswhy.com/awards/Famous_Software_Award_Logo.png" alt="NuttX" style="border:0">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center" valign="top">
|
||||
<a href="http://www.fiberdownload.com/Download/26542/NuttX" target="_blank">
|
||||
<img src="editor_pick_2.png" alt="NuttX" style="border:0">
|
||||
<img src="award2_151_50.png" alt="NuttX" style="border:0">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NuttX Getting Started</title>
|
||||
</head>
|
||||
|
||||
<body background="backgd.gif">
|
||||
<hr><hr>
|
||||
<table width ="100%">
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>Getting Started with NuttX</i></font></big></h1>
|
||||
<p>Last Updated: December 31, 2011</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr><hr>
|
||||
<p><b>Getting Started</b>.
|
||||
There is no "Getting Started" Guide for NuttX yet.
|
||||
However, most everything that you need to get started with NuttX can be found in the <code>README.txt</code> file located in the top-level NuttX directory.
|
||||
That <code>README.txt</code> can also be read online in the NuttX SVN repository
|
||||
<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/README.txt?view=log">here</a>.
|
||||
Just click on "Links to HEAD: (view)" on that page.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,81 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NuttX Links</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<table width="100%>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Project Links</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<li><a href="http://nuttx.sourceforge.net/NuttX.html" target="main">Home</a></li>
|
||||
<li><a href="http://sourceforge.net/projects/nuttx/develop" target="_top">SourceForge</a></li>
|
||||
<li><a href="http://freshmeat.net/projects/nuttx/" target="_top">FreshMeat</a></li>
|
||||
<li><a href="http://tech.groups.yahoo.com/group/nuttx/" target="_top">Forum</a></li>
|
||||
<li><a href="http://www.oschina.net/p/nuttx" target="_top">OSChina</a></li>
|
||||
<li><a href="http://sourceforge.net/projects/nuttx/files/" target="_top">Downloads</a></li>
|
||||
<li><a href="http://www.nx-engineering.com/nuttx-wiki/" target="_top">Wiki</a></li>
|
||||
<li><a href="http://sourceforge.net/projects/nuttx/files/buildroot" target="_top">Toolchains</a></li>
|
||||
<li><a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/" target="_top">Browse SVN</a></li>
|
||||
<li><a href="freeports.html" target="header">Free Ports</a></li>
|
||||
<li><a href="http://rss.groups.yahoo.com/group/nuttx/rss" target="_top"><img src="rss.gif" border="0"></a></li>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<a href="NuttXDocumentation.html">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</a>
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Documentation</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<a href="NuttXRelated.html">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</a>
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Related Projects</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<a href="NuttXCommercial.html">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</a>
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Commercial Sites</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center" valign="top">
|
||||
<a href="http://download.famouswhy.com/nuttx/" target="_blank">
|
||||
<img src="http://download.famouswhy.com/awards/Famous_Software_Award_Logo.png" alt="NuttX" style="border:0">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center" valign="top">
|
||||
<a href="http://www.fiberdownload.com/Download/26542/NuttX" target="_blank">
|
||||
<img src="editor_pick_2.png" alt="NuttX" style="border:0">
|
||||
<img src="award2_151_50.png" alt="NuttX" style="border:0">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,781 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NXFLAT</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
|
||||
<hr><hr>
|
||||
<table width ="100%">
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NXFLAT</i></font></big></h1>
|
||||
<p>Last Updated: September 1, 2012</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr><hr>
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1>Table of Contents</h1>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<center><table width ="80%">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#overview">1.0 Overview</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#functionality">1.1 Functionality</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#background">1.2 Background</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#limitations">1.3 Limitations</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#supported">1.4 Supported Processors</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#status">1.5 Development Status</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#toolchain">2.0 NXFLAT Toolchain</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#building">1.2 Building the NXFLAT Toolchain</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#mknxflat">1.2 mknxflat</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#ldnxflat">1.3 ldnxflat</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#mksymtab">1.4 mksymtab</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<a href="#making">1.5 Making an NXFLAT module</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#binfmt">3.0. Binary Loader APIs</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#nogot">Appendix A. No GOT Operation</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" width="22"><img height="20" width="20" src="favicon.ico"></td>
|
||||
<td>
|
||||
<a href="#pictext">Appendix B. PIC Text Workaround</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table></center>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="overview"><h1>1.0 Overview</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name="functionality"><h2>1.1 Functionality</h2></a>
|
||||
|
||||
<p>
|
||||
NXFLAT is a customized and simplified version of binary format implemented a few years ago called
|
||||
<a HREF="http://xflat.sourceforge.net/">XFLAT</A>
|
||||
With the NXFLAT binary format you will be able to do the following:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Place separately linked programs in a file system, and</li>
|
||||
<li>Execute those programs by dynamically linking them to the base NuttX code.</li>
|
||||
</ul>
|
||||
<p>
|
||||
This allows you to extend the NuttX base code after it has been written into FLASH.
|
||||
One motivation for implementing NXFLAT is support clean CGI under an HTTPD server.
|
||||
</p>
|
||||
<p>
|
||||
This feature is especially attractive when combined with the NuttX ROMFS support:
|
||||
ROMFS allows you to execute programs in place (XIP) in flash without copying anything
|
||||
other than the .data section to RAM.
|
||||
In fact, the initial NXFLAT release only worked on ROMFS.
|
||||
Later extensions also support execution NXFLAT binaries from an SRAM copy as well.
|
||||
</p>
|
||||
<p>
|
||||
This NuttX feature includes:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
A dynamic loader that is built into the NuttX core
|
||||
(See <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/binfmt/">SVN</a>).
|
||||
</li>
|
||||
<li>
|
||||
Minor changes to RTOS to support position independent code, and
|
||||
</li>
|
||||
<li>
|
||||
A linker to bind ELF binaries to produce the NXFLAT binary format
|
||||
(See <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/misc/buildroot/toolchain/nxflat/">SVN).
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<a name="background"><h2>1.2 Background</h2></a>
|
||||
|
||||
<p>
|
||||
NXFLAT is derived from <a href="http://xflat.sourceforge.net/">XFLAT</a>.
|
||||
XFLAT is a toolchain add that provides full shared library and XIP executable
|
||||
support for processors that have no Memory Management Unit (MMU<sup>1</sup>).
|
||||
NXFLAT is greatly simplified for the deeply embedded environment targeted by Nuttx:
|
||||
</p>
|
||||
<ul>
|
||||
<li>NXFLAT does not support shared libraries, because</li>
|
||||
<li>NXFLAT does not support <i>exportation</i> of symbol values from a module</li>
|
||||
</ul>
|
||||
<p>
|
||||
Rather, the NXFLAT module only <i>imports</i> symbol values.
|
||||
In the NXFLAT model, the (PIC<sup>2</sup>) NXFLAT module resides in a FLASH file system and
|
||||
when it is loaded at run time, it is dynamically linked only to the (non-PIC) base NuttX
|
||||
code:
|
||||
The base NuttX <i>exports</i> a symbol table; the NXFLAT module <i>imports</i> those symbol value
|
||||
to dynamically bind the module to the base code.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<p>
|
||||
<sup>1</sup><small>MMU: "Memory Management Unit"</small><br>
|
||||
<sup>2</sup><small>PIC: "Position Independent Code"</small>
|
||||
</p>
|
||||
</ul>
|
||||
|
||||
<a name="limitations"><h2>1.3 Limitations</h2></a>
|
||||
|
||||
<ul>
|
||||
<li><b>ROMFS (or RAM mapping) Only</b>
|
||||
<ul>
|
||||
<p>
|
||||
The current NXFLAT release will work only with either (1) NXFLAT executable modules residing on a ROMFS file system, or (2) executables residing on other file systems provided that <code>CONFIG_FS_RAMMAP</code> is defined.
|
||||
This limitation is because the loader depends on the capability to <code>mmap()</code> the code segment.
|
||||
See the <a href="NuttxUserGuide.html#mmapxip">NuttX User Guide</a> for further information.
|
||||
</p>
|
||||
<p>
|
||||
NUTTX does not provide any general kind of file mapping capability.
|
||||
In fact, <i>true</i> file mapping is only possible with MCUs that provide an MMU<sup>1</sup>.
|
||||
Without an MMU, file system may support eXecution In Place (XIP) to mimic file mapping.
|
||||
Only the ROMFS file system supports that kind of XIP execution need by NXFLAT.
|
||||
</p>
|
||||
<p>
|
||||
It is also possible to <i>simulate</i> file mapping by allocating memory, copying the NXFLAT binary file into memory, and executing from the copy of the executable file in RAM.
|
||||
That capability can be enabled with the <code>CONFIG_FS_RAMMAP</code> configuration option.
|
||||
With that option enabled, NXFLAT will work that kind of file system but will require copying of all NXFLAT executables to RAM.
|
||||
</p>
|
||||
</ul>
|
||||
</li>
|
||||
<li><b>GCC/ARM/Cortex-M3/4 Only</b>
|
||||
<ul>
|
||||
<p>
|
||||
At present, the NXFLAT toolchain is only available for ARM and Cortex-M3/4 (thumb2) targets.
|
||||
</p>
|
||||
</ul>
|
||||
</li>
|
||||
<li><b>Read-Only Data in RAM</b>
|
||||
<ul>
|
||||
<p>
|
||||
Read-only data must reside in RAM.
|
||||
In code generated by GCC, all data references are indexed by the PIC<sup>2</sup> base register (that is usually R10 or <i>sl</i> for the ARM processors).
|
||||
The includes read-only data (<code>.rodata</code>).
|
||||
Embedded firmware developers normally like to keep <code>.rodata</code> in FLASH with the code sections.
|
||||
But because all data is referenced with the PIC base register, all of that data must lie in RAM.
|
||||
A NXFLAT change to work around this is under investigation<sup>3</sup>.
|
||||
</p>
|
||||
</ul>
|
||||
</li>
|
||||
<li><b>Globally Scoped Function Function Pointers</b>
|
||||
<ul>
|
||||
<p>
|
||||
If a function pointer is taken to a statically defined function, then (at least for ARM) GCC will generate a relocation that NXFLAT cannot handle.
|
||||
The workaround is make all such functions global in scope.
|
||||
A fix would involve a change to the GCC compiler as described in <a href="#pictext">Appendix B</a>.
|
||||
</p>
|
||||
</ul>
|
||||
</li>
|
||||
<li><b>Special Handling of Callbacks</b>
|
||||
<ul>
|
||||
<p>
|
||||
Callbacks through function pointers must be avoided or, when then cannot be avoided, handled very specially.
|
||||
The reason for this is that the PIC module requires setting of a special value in a PIC register.
|
||||
If the callback does not set the PIC register, then the called back function will fail because it will be unable to correctly access data memory.
|
||||
Special logic is in place to handle some NuttX callbacks: Signal callbacks and watchdog timer callbacks.
|
||||
But other callbacks (like those used with <code>qsort()</code> must be avoided in an NXFLAT module.
|
||||
</p>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul><p>
|
||||
<sup>1</sup><small>MMU: "Memory Management Unit"</small><br>
|
||||
<sup>2</sup><small>PIC: "Position Independent Code"</small><br>
|
||||
<sup>3</sup><small>A work around is under consideration:
|
||||
At run time, the <code>.rodata</code> offsets will be indexed by a RAM address.
|
||||
If the dynamic loader were to offset those <code>.rodata</code> offsets properly, it
|
||||
still might be possible to reference <code>.rodata</code> in ROM.
|
||||
That work around is still a topic of investigation at this time.</small>
|
||||
</p></ul>
|
||||
|
||||
<a name="supported"><h2>1.4 Supported Processors</h2></a>
|
||||
|
||||
<p>
|
||||
As mentioned <a href="#limitations">above</a>, the NXFLAT toolchain is only available for ARM and
|
||||
Cortex-M3 (thumb2) targets.
|
||||
Furthermore, NXFLAT has only been tested on the Eagle-100 LMS6918 Cortex-M3 board.
|
||||
</p>
|
||||
|
||||
<a name="status"><h2>1.5 Development Status</h2></a>
|
||||
|
||||
<p>
|
||||
The initial release of NXFLAT was made in NuttX version 0.4.9.
|
||||
Testing is limited to the tests found under <code>apps/examples/nxflat</code> in the source tree.
|
||||
Some known problems exist
|
||||
(see the <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/TODO?view=log">TODO</a> list).
|
||||
As such, NXFLAT is currently in an early alpha phase.
|
||||
</p>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="toolchain"><h1>2.0 NXFLAT Toolchain</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a name="building"><h2>1.2 Building the NXFLAT Toolchain</h2></a>
|
||||
|
||||
<p>
|
||||
In order to use NXFLAT, you must use special NXFLAT tools to create the binary module in FLASH.
|
||||
To do this, you will need to download the buildroot package and build it on your Linux or Cygwin machine.
|
||||
The buildroot can be downloaded from
|
||||
<a https://sourceforge.net/project/showfiles.php?group_id=189573&package_id=224585">Sourceforge</a>.
|
||||
You will need version 0.1.7 or later.
|
||||
</p>
|
||||
<p>
|
||||
Here are some general build instructions:
|
||||
</p>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
You must have already configured Nuttx in <code><some-dir>/nuttx</code>
|
||||
</li>
|
||||
<li>
|
||||
Download the buildroot package <code>buildroot-0.x.y</code> into <code><some-dir></code>
|
||||
<li>
|
||||
</li>
|
||||
Unpack <code><some-dir>/buildroot-0.x.y.tar.gz</code> using a command like <code>tar zxf buildroot-0.x.y</code>.
|
||||
This will result in a new directory like <code><some-dir>/misc/buildroot-0.x.y</code>
|
||||
</li>
|
||||
<li>
|
||||
Move this into position: <code>mv <some-dir>/misc/buildroot-0.x.y</code><some-dir>/buildroot</code>
|
||||
</li>
|
||||
<li>
|
||||
<code>cd </code><some-dir>/buildroot</code>
|
||||
</li>
|
||||
<li>
|
||||
Copy a configuration file into the top buildroot directory: <code>cp configs/abc-defconfig-x.y.z .config</code>.
|
||||
</li>
|
||||
<li>
|
||||
Enable building of the NXFLAT tools by <code>make menuconfig</code>.
|
||||
Select to build the NXFLAT toolchain with GCC (you can also select omit building GCC with and only build the
|
||||
NXFLAT toolchain for use with your own GCC toolchain).
|
||||
</li>
|
||||
<li>
|
||||
Make the toolchain: <code>make</code>.
|
||||
When the make completes, the tool binaries will be available under
|
||||
<code><some-dir>/buildroot/build_abc/staging_dir/bin</code>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<a name="mknxflat"><h2>1.2 mknxflat</h2></a>
|
||||
|
||||
<p>
|
||||
<code>mknxflat</code> is used to build a <i>thunk</i> file.
|
||||
See <a href="#making">below</a> for usage.
|
||||
|
||||
<ul><pre>
|
||||
Usage: mknxflat [options] <bfd-filename>
|
||||
|
||||
Where options are one or more of the following. Note
|
||||
that a space is always required between the option and
|
||||
any following arguments.
|
||||
|
||||
-d Use dynamic symbol table. [symtab]
|
||||
-f <cmd-filename>
|
||||
Take next commands from <cmd-filename> [cmd-line]
|
||||
-o <out-filename>
|
||||
Output to <out-filename> [stdout]
|
||||
-v Verbose output [no output]
|
||||
-w Import weakly declared functions, i.e., weakly
|
||||
declared functions are expected to be provided at
|
||||
load-time [not imported]
|
||||
</pre></ul>
|
||||
|
||||
<a name="ldnxflat"><h2>1.3 ldnxflat</h2></a>
|
||||
|
||||
<p>
|
||||
<code>ldnxflat</code> is use to link your object files along with the <i>thunk</i> file
|
||||
generated by <a href="#mknxflat"><code>mknxflat</code></a> to produce the NXFLAT binary module.
|
||||
See <a href="#making">below</a> for usage.
|
||||
</p>
|
||||
|
||||
<ul><pre>
|
||||
Usage: ldnxflat [options] <bfd-filename>
|
||||
|
||||
Where options are one or more of the following. Note
|
||||
that a space is always required between the option and
|
||||
any following arguments.
|
||||
|
||||
-d Use dynamic symbol table [Default: symtab]
|
||||
-e <entry-point>
|
||||
Entry point to module [Default: _start]
|
||||
-o <out-filename>
|
||||
Output to <out-filename> [Default: <bfd-filename>.nxf]
|
||||
-s <stack-size>
|
||||
Set stack size to <stack-size> [Default: 4096]
|
||||
-v Verbose output. If -v is applied twice, additional
|
||||
debug output is enabled [Default: no verbose output].
|
||||
</pre></ul>
|
||||
|
||||
<a name="mksymtab"><h2>1.4 mksymtab</h2></a>
|
||||
|
||||
<p>
|
||||
There is a small helper program available in <code>nuttx/tools</code> call <code>mksymtab</code>.
|
||||
<code>mksymtab</code> can be sued to generate symbol tables for the NuttX base code that would be usable by the typical NXFLAT application.
|
||||
<code>mksymtab</code> builds symbol tables from common-separated value (CSV) files.
|
||||
In particular, the CSV files:
|
||||
</p>
|
||||
<ol>
|
||||
<li>
|
||||
<code>nuttx/syscall/syscall.csv</code> that describes the NuttX RTOS interface, and
|
||||
</li>
|
||||
<li>
|
||||
<code>nuttx/lib/lib/csv</code> that describes the NuttX C library interface.
|
||||
</li>
|
||||
</ol>
|
||||
<ul><pre>
|
||||
USAGE: ./mksymtab <cvs-file> <symtab-file>
|
||||
|
||||
Where:
|
||||
|
||||
<cvs-file> : The path to the input CSV file
|
||||
<symtab-file>: The path to the output symbol table file
|
||||
-d : Enable debug output
|
||||
</pre></ul>
|
||||
<p>
|
||||
For example,
|
||||
</p>
|
||||
<ul><pre>
|
||||
cd nuttx/tools
|
||||
cat ../syscall/syscall.csv ../lib/lib.csv | sort >tmp.csv
|
||||
./mksymtab.exe tmp.csv tmp.c
|
||||
</pre></ul>
|
||||
|
||||
<a name="making"><h2>1.5 Making an NXFLAT module</h2></a>
|
||||
|
||||
<p>
|
||||
Below is a snippet from an NXFLAT make file (simplified from NuttX
|
||||
<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/examples/nxflat/tests/hello/Makefile?view=log">
|
||||
Hello, World!</a> example.
|
||||
<p>
|
||||
<ul><table width="50%">
|
||||
|
||||
<ul><table>
|
||||
<tr>
|
||||
<th>Target 1</th>
|
||||
<td><code>hello.r1:</code></td>
|
||||
<td><code>hello.o</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td><br></td>
|
||||
<td><code>abc-elf-ld -r -d -warn-common -o $@ $^</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Target 2</th>
|
||||
<td><code>hello-thunk.S:</code></td>
|
||||
<td><code>hello.r1</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td><br></td>
|
||||
<td><code>mknxflat -o $@ $^</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Target 3</th>
|
||||
<td><code>hello.r2:</code></td>
|
||||
<td><code>hello-thunk.S</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td><br></td>
|
||||
<td>
|
||||
<code>abc-elf-ld -r -d -warn-common -T binfmt/libnxflat/gnu-nxflat.ld -no-check-sections -o $@ hello.o hello-thunk.o</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Target 4</th>
|
||||
<td><code>hello:</code></td>
|
||||
<td><code>hello.r2</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br></td>
|
||||
<td><br></td>
|
||||
<td><code>ldnxflat -e main -s 2048 -o $@ $^</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
</table></ul>
|
||||
|
||||
<p><b>Target 1</b>.
|
||||
This target links all of the module's object files together into one relocatable object.
|
||||
Two relocatable objects will be generated; this is the first one (hence, the suffic <code>.r1</code>).
|
||||
In this "Hello, World!" case, there is only a single object file, <code>hello.o</code>,
|
||||
that is linked to produce the <code>hello.r1</code> object.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When the module's object files are compiled, some special compiler CFLAGS must be provided.
|
||||
First, the option <code>-fpic</code> is required to tell the compiler to generate position independent code (other
|
||||
GCC options, like <code>-fno-jump-tables</code> might also be desirable).
|
||||
For ARM compilers, two additional compilation options are required: <code>-msingle-pic-base</code>
|
||||
and <code>-mpic-register=r10</code>.
|
||||
</p>
|
||||
|
||||
<p><b>Target 2</b>.
|
||||
Given the <code>hello.r1</code> relocatable object, this target will invoke
|
||||
<a href="#mknxflat"><code>mknxflat</code></a>
|
||||
to make the <i>thunk</i> file, <code>hello-thunk.S</code>.
|
||||
This <i>thunk</i> file contains all of the information needed to create the imported function list.
|
||||
</p>
|
||||
|
||||
<p><b>Target 3</b>
|
||||
This target is similar to <b>Target 1</b>.
|
||||
In this case, it will link together the module's object files (only <code>hello.o</code> here)
|
||||
along with the assembled <i>thunk</i> file, <code>hello-thunk.o</code> to create the second relocatable object,
|
||||
<code>hello.r2</code>.
|
||||
The linker script, <code>gnu-nxflat.ld</code> is required at this point to correctly position the sections.
|
||||
This linker script produces two segments:
|
||||
An <i>I-Space</i> (Instruction Space) segment containing mostly <code>.text</code> and a <i>D-Space</i> (Data Space) segment
|
||||
containing <code>.got</code>, <code>.data</code>, and <code>.bss</code> sections.
|
||||
The I-Space section must be origined at address 0 (so that the segment's addresses are really offsets into
|
||||
the I-Space segment)
|
||||
and the D-Space section must also be origined at address 0 (so that segment's addresses are really offsets into
|
||||
the I-Space segment).
|
||||
The option <code>-no-check-sections</code> is required to prevent the linker from failing because these segments overlap.
|
||||
</p>
|
||||
|
||||
<p><b>Target 4</b>.
|
||||
Finally, this target will use the <code>hello.r2</code> relocatable object to create the final, NXFLAT module
|
||||
<code>hello</code> by executing <a href="#ldnxflat"><code>ldnxflat</code></a>.
|
||||
</p>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="binfmt"><h1>3.0 Binary Loader APIs</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><b>Relevant Header Files:</b></p>
|
||||
<ul>
|
||||
<li>
|
||||
The interface to the binary loader is described in the header file
|
||||
<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/include/nuttx/binfmt.h?view=log">
|
||||
<code>include/nuttx/binfmt.h</code></a>.
|
||||
A brief summary of the APIs prototyped in that header file are listed below.
|
||||
</li>
|
||||
<li>
|
||||
NXFLAT APIs needed to register NXFLAT as a binary loader appear in the header file
|
||||
<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/include/nuttx/nxflat.h?view=log">
|
||||
<code>include/nuttx/nxflat.h</code></a>.
|
||||
</li>
|
||||
<li>
|
||||
The format of an NXFLAT object itself is described in the header file:
|
||||
<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/include/nuttx/nxflat.h?view=log">
|
||||
<code>include/nuttx/nxflat.h</code></a>.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p><b>binfmt Registration</b>
|
||||
These first interfaces are used only by a binary loader module, such as NXFLAT itself.
|
||||
NXFLAT (or any future binary loader) calls <code>register_binfmt()</code> to incorporate
|
||||
itself into the system.
|
||||
In this way, the binary loader logic is dynamically extensible to support any kind of loader.
|
||||
Normal application code should not be concerned with these interfaces.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<p><b><code>int register_binfmt(FAR struct binfmt_s *binfmt)</code></b>
|
||||
<ul>
|
||||
<p><b>Description:</b>
|
||||
Register a loader for a binary format
|
||||
</p>
|
||||
<p><b>Returned Value:</b>
|
||||
This is a NuttX internal function so it follows the convention that
|
||||
0 (<code>OK</code>) is returned on success and a negated errno is returned on
|
||||
failure.
|
||||
</p>
|
||||
</ul>
|
||||
|
||||
<p><b><code>int unregister_binfmt(FAR struct binfmt_s *binfmt)</code></b>
|
||||
<ul>
|
||||
<p><b>Description:</b>
|
||||
Register a loader for a binary format
|
||||
</p>
|
||||
<p><b>Returned Value:</b>
|
||||
This is a NuttX internal function so it follows the convention that
|
||||
0 (<code>OK</code>) is returned on success and a negated errno is returned on
|
||||
failure.
|
||||
</p>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<p><b>NXFLAT Initialization</b>
|
||||
These interfaces are specific to NXFLAT.
|
||||
Normally, an application needs only call <code>nxflat_initialize()</code> during its initialization
|
||||
to have full NXFLAT support.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<p><b><code>int nxflat_initialize(void)</code></b>
|
||||
<ul>
|
||||
<p><b>Description:</b>
|
||||
NXFLAT support is built unconditionally. However, it order to
|
||||
use this binary format, this function must be called during system
|
||||
format in order to register the NXFLAT binary format.
|
||||
This function calls <code>register_binfmt()</code> appropriately.
|
||||
</p>
|
||||
<p><b>Returned Value:</b>
|
||||
This is a NuttX internal function so it follows the convention that
|
||||
0 (OK) is returned on success and a negated errno is returned on
|
||||
failure.
|
||||
</p>
|
||||
</ul>
|
||||
|
||||
<p><b><code>void nxflat_uninitialize(void)</code></b>
|
||||
<ul>
|
||||
<p><b>Description:</b>
|
||||
Unregister the NXFLAT binary loader
|
||||
</p>
|
||||
<p><b>Returned Value:</b>
|
||||
None
|
||||
</p>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<p><b>Binary Loader Interfaces</b>.
|
||||
The remaining APIs are called by user applications to maintain modules in the file system.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<p><b><code>int load_module(FAR struct binary_s *bin)</code></b>
|
||||
<ul>
|
||||
<p><b>Description:</b>
|
||||
Load a module into memory, bind it to an exported symbol take, and
|
||||
prep the module for execution.
|
||||
</p>
|
||||
<p><b>Returned Value:</b>
|
||||
This is an end-user function, so it follows the normal convention:
|
||||
Returns 0 (<code>OK</code>) on success. On failure, it returns -1 (<code>ERROR</code>) with
|
||||
errno set appropriately.
|
||||
</p>
|
||||
</ul>
|
||||
|
||||
<p><b><code>int unload_module(FAR const struct binary_s *bin)</code></b>
|
||||
<ul>
|
||||
<p><b>Description:</b>
|
||||
Unload a (non-executing) module from memory. If the module has
|
||||
been started (via <code>exec_module()</code>), calling this will be fatal.
|
||||
</p>
|
||||
<p><b>Returned Value:</b>
|
||||
This is a NuttX internal function so it follows the convention that
|
||||
0 (<code>OK</code>) is returned on success and a negated errno is returned on
|
||||
failure.
|
||||
</p>
|
||||
</ul>
|
||||
|
||||
<p><b><code>int exec_module(FAR const struct binary_s *bin, int priority)</code></b>
|
||||
<ul>
|
||||
<p><b>Description:</b>
|
||||
Execute a module that has been loaded into memory by load_module().
|
||||
</p>
|
||||
<p><b>Returned Value:</b>
|
||||
This is an end-user function, so it follows the normal convention:
|
||||
Returns the PID of the exec'ed module. On failure, it.returns
|
||||
-1 (<code>ERROR</code>) and sets errno appropriately.
|
||||
</p>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="nogot"><h1>Appendix A. No GOT Operation</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
When GCC generate position independent code, new code sections will appear in your programs.
|
||||
One of these is the GOT (Global Offset Table) and, in ELF environments, another is the PLT (Procedure
|
||||
Lookup Table.
|
||||
For example, if your C code generated (ARM) assembly language like this without PIC:
|
||||
<p>
|
||||
<ul><pre>
|
||||
ldr r1, .L0 <-- Fetch the offset to 'x'
|
||||
ldr r0, [r10, r1] <-- Load the value of 'x' with PIC offset`
|
||||
...
|
||||
.L0: .word x <-- Offset to 'x'
|
||||
</pre></ul>
|
||||
|
||||
<p>
|
||||
Then when PIC is enabled (say with the -fpic compiler option), it will generate code like
|
||||
this:
|
||||
</p>
|
||||
|
||||
<ul><pre>
|
||||
ldr r1, .L0 <-- Fetch the offset to the GOT entry
|
||||
ldr r1, [r10,r1] <-- Fetch the (relocated) address of 'x' from the GOT
|
||||
ldr r0, [r1, #0] <-- Fetch the value of 'x'
|
||||
...
|
||||
.L1 .word x(GOT) <-- Offset to entry in the GOT
|
||||
</pre></ul>
|
||||
|
||||
<p>See <a href="http://xflat.sourceforge.net/NoMMUSharedLibs.html#shlibsgot">reference</a></p>
|
||||
|
||||
<p>
|
||||
Notice that the generates an extra level of indirection through the GOT.
|
||||
This indirection is not needed by NXFLAT and only adds more RAM usage and
|
||||
execution time.
|
||||
</p>
|
||||
<p>
|
||||
NXFLAT (like <a href="http://xflat.sourceforge.net/">XFLAT</a>) can work even better without
|
||||
the GOT.
|
||||
Patches against older version of GCC exist to eliminate the GOT indirections.
|
||||
Several are available <a href="http://xflat.cvs.sourceforge.net/viewvc/xflat/xflat/gcc/">here</a>
|
||||
if you are inspired to port them to a new GCC version.
|
||||
</p>
|
||||
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="pictext"><h1>Appendix B. PIC Text Workaround</h1></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
There is a problem with the memory model in GCC that prevents it from
|
||||
being used as you need to use it in the NXFLAT context.
|
||||
The problem is that GCC PIC model assumes that the executable lies in a flat, contiguous (virtual) address space like:
|
||||
<p>
|
||||
<ul><table width="15%">
|
||||
<tr><th>Virtual</th></td>
|
||||
<tr>
|
||||
<td align="center" bgcolor="#e4e4e4"><code>.text</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" bgcolor="#e4e4e4"><code>.got</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" bgcolor="#e4e4e4"><code>.data</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" bgcolor="#e4e4e4"><code>.bss</code></td>
|
||||
</tr>
|
||||
</table></ul>
|
||||
<p>
|
||||
It assumes that the PIC base register (usually r10 for ARM) points to the base of <code>.text</code>
|
||||
so that any address in <code>.text</code>, <code>.got</code>, <code>.data</code>, <code>.bss</code>
|
||||
can be found with an offset from the same base address.
|
||||
But that is not the memory arrangement that we need in the XIP embedded environment.
|
||||
We need two memory regions, one in FLASH containing shared code and on per task in RAM containing task-specific data:
|
||||
</p>
|
||||
|
||||
<ul><table width="30%">
|
||||
<tr><th>Flash</th><th>RAM</th></td>
|
||||
<tr>
|
||||
<td align="center" bgcolor="#e4e4e4"><code>.text</code></td>
|
||||
<td align="center" bgcolor="#e4e4e4"><code>.got</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#e4e4e4"><br></td>
|
||||
<td align="center" bgcolor="#e4e4e4"><code>.data</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#e4e4e4"><br></td>
|
||||
<td align="center" bgcolor="#e4e4e4"><code>.bss</code></td>
|
||||
</tr>
|
||||
</table></ul>
|
||||
|
||||
<p>
|
||||
The PIC base register needs to point to the base of the <code>.got</code> and only
|
||||
addresses in the <code>.got</code>, <code>.data</code>, and <code>.bss</code>
|
||||
sections can be accessed as an offset from the PIC base register.
|
||||
See also this
|
||||
<a href="http://xflat.cvs.sourceforge.net/viewvc/*checkout*/xflat/xflat/gcc/README?revision=1.1.1.1">XFLAT discussion</a>.
|
||||
</p>
|
||||
<p>
|
||||
Patches against older version of GCC exist to correct this GCC behavior.
|
||||
Several are available <a href="http://xflat.cvs.sourceforge.net/viewvc/xflat/xflat/gcc/">here</a>
|
||||
if you are inspired to port them to a new GCC version.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,72 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NuttX Links</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<table width="100%>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<a href="NuttXLinks.html">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</a>
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Project Links</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<a href="NuttXDocumentation.html">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</a>
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Documentation</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Related Projects</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<li><a href="http://osmocom.org/" target="top">Osmocom-BB</a></li>
|
||||
<li><a href="https://pixhawk.ethz.ch/px4/" target="top">PX4 Autopilot</a></li>
|
||||
<li><a href="http://rgmp.sourceforge.net/wiki/index.php/Main_Page" target="top">RGMP</a></li>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="22">
|
||||
<a href="NuttXCommercial.html">
|
||||
<img height="20" width="20" src="favicon.ico">
|
||||
</a>
|
||||
</td>
|
||||
<td bgcolor="#e4e4e4">
|
||||
<font color="#3c34ec"><i><b>Commercial Sites</b></i></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center" valign="top">
|
||||
<a href="http://download.famouswhy.com/nuttx/" target="_blank">
|
||||
<img src="http://download.famouswhy.com/awards/Famous_Software_Award_Logo.png" alt="NuttX" style="border:0">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center" valign="top">
|
||||
<a href="http://www.fiberdownload.com/Download/26542/NuttX" target="_blank">
|
||||
<img src="editor_pick_2.png" alt="NuttX" style="border:0">
|
||||
<img src="award2_151_50.png" alt="NuttX" style="border:0">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 5.7 KiB |
@@ -0,0 +1,86 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NxWidgets</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<hr><hr>
|
||||
<table width ="100%">
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NxWidgets</i></font></big></h1>
|
||||
<p>Last Updated: March 27, 2012</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1>NXWidgets</h1>
|
||||
<p>
|
||||
In order to better support NuttX based platforms, a special graphical userinterface has been created called NXWidgets.
|
||||
NXWidgets is written in C++ and integrates seamlessly with the NuttX <a href="NXGraphicsSubsystem.html">NX graphics subsystem</a> in order to provide graphic objects, or "widgets," in the NX Graphics Subsystem
|
||||
</p>
|
||||
<p>
|
||||
Some of the features of NXWidgets include:
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>Conservative C++</b>.
|
||||
NXWidgets is written entirely in C++ but using only selected "embedded friendly" C++ constructs that are fully supported under NuttX.
|
||||
No additional C++ support libraries are required.
|
||||
</li>
|
||||
<li><b>NX Integration</b>.
|
||||
NXWidgets integrate seamlessly with the <a href="NXGraphicsSubsystem.html">NX graphics subsystem</a>.
|
||||
Think of the X server under Linux … the NX graphics system is like a tiny X server that provides windowing under NuttX.
|
||||
By adding NXWidgets, you can support graphics objects like buttons and text boxes in the NX windows and toolbars.
|
||||
</li>
|
||||
<li><b>Small Footprint</b>.
|
||||
NXWidgets is tailored for use MCUs in embedded applications.
|
||||
It is ideally suited for mid- and upper-range of most MCU families.
|
||||
A complete NXWidgets is possible in as little as 40K of FLASH and maybe 4K of SRAM.
|
||||
</li>
|
||||
<li><b>Output Devices</b>.
|
||||
NXWidgets will work on the high-end frame buffer devices as well as on LCDs connected via serial or parallel ports to a small MCU.
|
||||
</li>
|
||||
<li><b>Input Devices</b>.
|
||||
NXWidgets will accept position and selection inputs from a mouse or a touchscreen.
|
||||
It will also support character input from a keyboard such as a USB keyboard.
|
||||
NXWidgets supports on very special widget called CKeypad that will provide keyboard input via an on-screen keypad that can be operated via mouse or touchscreen inputs.
|
||||
</li>
|
||||
<li><b>Many Graphic Objects</b>.
|
||||
Some of the graphic objects supported by NXWidgets include labels, buttons, text boxes, button arrays, check boxes, cycle buttons, images, sliders, scrollable list boxes, progress bars, and more.
|
||||
</li>
|
||||
<li><b>DOxygen Documentation</b>
|
||||
DOxygen documentation is available.
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
Note: Many of the fundamental classed in NxWidgets derive from the Antony
|
||||
Dzeryn's "Woopsi" project: http://woopsi.org/ which also has a BSD style
|
||||
license. See the COPYING file for details.
|
||||
</p>
|
||||
<h1>NXWidgets DOxygen Documentation</h1>
|
||||
<p>
|
||||
Release notes, DOxygen documentation, as well as downloads for the latest NxWidgets releases are available online:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<b>NxWidgets-1.0</b>:
|
||||
<a href="http://www.nx-engineering.com/nxwidgets_v1_0/">Documentation</a>, and
|
||||
<a href="http://sourceforge.net/projects/nuttx/files/NxWidgets/NxWidgets-1.0/">Downloads</a>
|
||||
</li>
|
||||
<li>
|
||||
<b>NxWidgets-1.1</b>:
|
||||
<a href="http://www.nx-engineering.com/nxwidgets_v1_1/">Documentation</a>,
|
||||
<a href="http://sourceforge.net/projects/nuttx/files/NxWidgets/NxWidgets-1.1/">Release notes</a>, and
|
||||
<a href="http://sourceforge.net/projects/nuttx/files/NxWidgets/NxWidgets-1.1/">Downloads</a>
|
||||
</li>
|
||||
<li>
|
||||
<b>NxWidgets-1.2</b>:
|
||||
<a href="http://www.nx-engineering.com/nxwidgets_v1_2/">Documentation</a>,
|
||||
<a href="http://sourceforge.net/projects/nuttx/files/NxWidgets/NxWidgets-1.2/">Release notes</a>, and
|
||||
<a href="http://sourceforge.net/projects/nuttx/files/NxWidgets/NxWidgets-1.2/">Downloads</a>
|
||||
</li>
|
||||
</p>
|
||||
<p>
|
||||
Thanks go to Jose Pablo Carballo for contributing this!
|
||||
</p>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,277 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>README Files</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<hr><hr>
|
||||
<table width ="100%">
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NuttX README Files</i></font></big></h1>
|
||||
<p>Last Updated: September 12, 2012</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
Additional information can be found in the <code>Documentation/</code> directory and
|
||||
also in <code>README</code> files that are scattered throughout the source tree.
|
||||
Below is a guide to the available <code>README</code> files.
|
||||
Some <code>README</code> files contain more important information than others.
|
||||
The key <code>README</code> files are shown in <code><i><b>BOLDFACE/ITALIC</i></b></code> below.
|
||||
</p>
|
||||
<ul><pre>
|
||||
.
|
||||
| - nuttx
|
||||
| |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/README.txt?view=log"><b>README.txt</b></a>
|
||||
| |- arch/
|
||||
| | |
|
||||
| | |- arm
|
||||
| | | `- src
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/arm/src/lpc214x/README.txt?view=log">lpc214x/README.txt</a>
|
||||
| | |- avr/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/avr/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- sh/
|
||||
| | | |- include/
|
||||
| | | | |-<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/sh/include/m16c/README.txt?view=log">m16c/README.txt</a>
|
||||
| | | | |-<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/sh/include/sh1/README.txt?view=log">sh1/README.txt</a>
|
||||
| | | | `-<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/sh/include/README.txt?view=log">README.txt</a>
|
||||
| | | |- src/
|
||||
| | | | |-<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/sh/src/common/README.txt?view=log">common/README.txt</a>
|
||||
| | | | |-<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/sh/src/m16c/README.txt?view=log">m16c/README.txt</a>
|
||||
| | | | |-<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/sh/src/sh1/README.txt?view=log">sh1/README.txt</a>
|
||||
| | | | `-<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/sh/src/README.txt?view=log">README.txt</a>
|
||||
| | |- x86/
|
||||
| | | |- include/
|
||||
| | | | `-<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/x86/include/README.txt?view=log">README.txt</a>
|
||||
| | | `- src/
|
||||
| | | `-<a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/x86/src/README.txt?view=log">README.txt</a>
|
||||
| | |- z80/
|
||||
| | | `- src/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/z80/src/z80/README.txt?view=log">z80/README.txt</a>
|
||||
| | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/arch/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| |- configs/
|
||||
| | |- amber/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/amber/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- avr32dev1/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/avr32dev1/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- c5471evm/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/c5471evm/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/c5471evm/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/c5471evm/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- compal_e88/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/compal_e88/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- compal_e99/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/compal_e99/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- demo9s12ne64/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/demo9s12ne64/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- ea3131/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ea3131/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- ea3152/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ea3152/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- eagle100/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/eagle100/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/eagle100/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/eagle100/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- ekk-lm3s9b96/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ekk-lm3s9b96/README.txt?view=log"><b><i>README.txt
|
||||
| | |- | | |- ez80f910200kitg/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ez80f910200kitg/ostest/README.txt?view=log">ostest/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ez80f910200kitg/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- ez80f910200zco/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ez80f910200zco/ostest/README.txt?view=log">dhcpd/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ez80f910200zco/httpd/README.txt?view=log">httpd/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ez80f910200zco/nettest/README.txt?view=log">nettest/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ez80f910200zco/nsh/README.txt?view=log">nsh/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ez80f910200zco/ostest/README.txt?view=log">ostest/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ez80f910200zco/poll/README.txt?view=log">poll/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ez80f910200zco/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- fire-stm32v2/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/fire-stm32v2/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- hymini-stm32v/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/hymini-stm32v/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/hymini-stm32v/RIDE/README.txt?view=log">RIDE/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/hymini-stm32v/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/hymini-stm32v/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- lincoln60/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/lincoln60/README.txt?view=log"><b><i>README.txt | | |- kwikstik-k40/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/kwikstik-k40/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- lm3s6432-s2e/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/lm3s6432-s2e/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/lm3s6432-s2e/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/lm3s6432-s2e/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- lm3s6965-ek/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/lm3s6965-ek/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/lm3s6965-ek/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/lm3s6965-ek/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- lm3s8962-ek/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/lm3s8962-ek/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/lm3s8962-ek/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/lm3s8962-ek/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- lpcxpresso-lpc1768/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/lpcxpresso-lpc1768/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- lpc4330-xplorer/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/llpc4330-xplorer/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- m68332evb/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/m68332evb/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/m68332evb/src/README.txt?view=log">src/README.txt</a>
|
||||
| | |- mbed/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/mbed/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- mcu123-lpc214x/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/mcu123-lpc214x/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/mcu123-lpc214x/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/mcu123-lpc214x/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- micropendous3/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/micropendous3/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- mirtoo/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/mirtoo/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- mx1ads/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/mx1ads/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/mx1ads/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/mx1ads/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- ne64badge/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ne64badge/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- ntosd-dm320/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ntosd-dm320/doc/README.txt?view=log">doc/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ntosd-dm320/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ntosd-dm320/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/ntosd-dm320/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- nucleus2g/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/nucleus2g/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- olimex-lpc1766stk/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/olimex-lpc1766stk/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- olimex-lpc2378/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/olimex-lpc2378/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/olimex-lpc2378/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- olimex-strp711/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/olimex-strp711/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/olimex-strp711/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/olimex-strp711/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- pcblogic-pic32mx/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/pcblogic-pic32mx/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- pic32-starterkit/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/pic32-starterkit/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- pjrc-8051/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/pjrc-8051/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/pjrc-8051/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/pjrc-8051/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- qemu-i486/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/qemu-i486/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/qemu-i486/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/qemu-i486/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- rgmp/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/rgmp/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/rgmp/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/rgmp/README.txt?view=log"><b><i>README.txt</i></b></a>></a>
|
||||
| | |- sam3u-ek/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/sam3u-ek/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- sim/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/sim/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/sim/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/sim/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- shenzhou/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/shenzhou/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- skp16c26/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/skp16c26/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/skp16c26/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/skp16c26/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- stm3210e-eval/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/stm3210e-eval/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/stm3210e-eval/RIDE/README.txt?view=log">RIDE/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/stm3210e-eval/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/stm3210e-eval/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- stm3220g-eval/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/stm3220g-eval/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- stm3240g-eval/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/stm3240g-eval/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- stm32f4discovery/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/stm32f4discovery/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- sure-pic32mx/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/sure-pic32mx/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- teensy/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/teensy/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- twr-k60n512/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/twr-k60n512/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- us7032evb1/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/us7032evb1/bin/README.txt?view=log">bin/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/us7032evb1/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/us7032evb1/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/us7032evb1/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- vsn/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/vsn/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/vsn/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- xtrs/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/xtrs/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/xtrs/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/xtrs/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- z16f2800100zcog/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/xtrs/ostest/README.txt?view=log">ostest/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/xtrs/pashello/README.txt?view=log">pashello/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/xtrs/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- z80sim/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/z80sim/include/README.txt?view=log">include/README.txt</a>
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/z80sim/src/README.txt?view=log">src/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/z80sim/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- z8encore000zco/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/z8encore000zco/ostest/README.txt?view=log">ostest/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/z8encore000zco/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- z8f64200100kit/
|
||||
| | | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/z8f64200100kit/ostest/README.txt?view=log">ostest/README.txt</a>
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/z8f64200100kit/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/configs/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| |- drivers/
|
||||
| | |- lcd/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/drivers/lcd/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | |- sercomm/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/drivers/sercomm/README.txt?view=log">README.txt</a>
|
||||
| | |- syslog/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/drivers/syslog/README.txt?view=log">README.txt</a>
|
||||
| | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/drivers/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| |- fs/
|
||||
| | |- mmap/
|
||||
| | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/fs/mmap/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| | `- nxffs/
|
||||
| | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/fs/nxffs/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| |- graphics/
|
||||
| | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/graphics/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| |- lib/
|
||||
| | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/lib/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| |- libxx/
|
||||
| | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/libxx/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| |- mm/
|
||||
| | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/mm/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| |- syscall/
|
||||
| | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/syscall/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
| `- tools/
|
||||
| `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/tools/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
`- apps/
|
||||
|- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/README.txt?view=log"><b>README.txt</b></a>
|
||||
|- examples/
|
||||
| |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/examples/pashello/README.txt?view=log">pashello/README.txt</a>
|
||||
| `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/examples/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
|- graphics/
|
||||
| `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/graphics/tiff/README.txt?view=log">"<b><i>tiff/README.txt</i></b></a>
|
||||
|- interpreters/
|
||||
| |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/interpreters/ficl/README.txt?view=log"><b><i>ficl/README.txt</i></b></a>
|
||||
| `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/interpreters/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
|- modbus/
|
||||
| `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/modbus/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
|- netutils/
|
||||
| | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/netutils/discover/README.txt?view=log">discover/README.txt</a>
|
||||
| | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/netutils/ftpc/README.txt?view=log">ftpc/README.txt</a>
|
||||
| | |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/netutils/telnetd/README.txt?view=log">telnetd/README.txt</a>
|
||||
| `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/netutils/README?view=log"><b><i>README</i></b></a>
|
||||
|- nshlib/
|
||||
| `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/nshlib/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
|- system/
|
||||
| |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/system/i2c/README.txt?view=log"><b><i>i2c/README.txt</i></b></a>
|
||||
| |- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/system/free/README.txt?view=log">free/README.txt</a>
|
||||
| `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/system/install/README.txt?view=log">install/README.txt</a>
|
||||
`- vsn/
|
||||
|- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/vsn/poweroff/README.txt?view=log">poweroff/README.txt</a>
|
||||
|- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/vsn/ramtron/README.txt?view=log">ramtron/README.txt</a>
|
||||
|- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/vsn/sdcard/README.txt?view=log">sdcard/README.txt</a>
|
||||
|- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/vsn/sysinfo/README.txt?view=log">sysinfo/README.txt</a>
|
||||
`- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/apps/vsn/sdcard/README.txt?view=log"><b><i>README.txt</i></b></a>
|
||||
</pre></ul>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,332 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NuttX USB Trace Capability</title>
|
||||
</head>
|
||||
|
||||
<body background="backgd.gif">
|
||||
<hr><hr>
|
||||
<table width ="100%">
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NuttX USB Device Trace</i></font></big></h1>
|
||||
<p>Last Updated: March 20, 2011</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr><hr>
|
||||
<p><b>USB Device Tracing Controls</b>.
|
||||
The NuttX USB device subsystem supports a fairly sophisticated tracing facility.
|
||||
The basic trace cabability is controlled by these NuttX configuration settings:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>CONFIG_USBDEV_TRACE</code>: Enables USB tracing</li>
|
||||
<li><code>CONFIG_USBDEV_TRACE_NRECORDS</code>: Number of trace entries to remember</li>
|
||||
</ul>
|
||||
<p><b>Trace IDs</b>.
|
||||
The trace facility works like this:
|
||||
When enabled, USB events that occur in either the USB device driver or in the USB class driver are logged.
|
||||
These events are described in <code>include/nuttx/usb/usbdev_trace.h</code>.
|
||||
The logged events are identified by a set of event IDs:
|
||||
</p>
|
||||
<ul><table>
|
||||
<tr>
|
||||
<td><code>TRACE_INIT_ID</code></td>
|
||||
<td>Initialization events</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_EP_ID</code></td>
|
||||
<td>Endpoint API calls</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_DEV_ID</code></td>
|
||||
<td>USB device API calls</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_CLASS_ID</code></td>
|
||||
<td>USB class driver API calls</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_CLASSAPI_ID</code></td>
|
||||
<td>Other class driver system API calls</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_CLASSSTATE_ID</code></td>
|
||||
<td>Track class driver state changes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_INTENTRY_ID</code></td>
|
||||
<td>Interrupt handler entry</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_INTDECODE_ID</code></td>
|
||||
<td>Decoded interrupt event</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_INTEXIT_ID</code></td>
|
||||
<td>Interrupt handler exit</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_OUTREQQUEUED_ID</code></td>
|
||||
<td>Request queued for OUT endpoint</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_INREQQUEUED_ID</code></td>
|
||||
<td>Request queued for IN endpoint</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_READ_ID</code></td>
|
||||
<td>Read (OUT) action</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_WRITE_ID</code></td>
|
||||
<td>Write (IN) action</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_COMPLETE_ID</code></td>
|
||||
<td>Request completed</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_DEVERROR_ID</code></td>
|
||||
<td>USB controller driver error event</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>TRACE_CLSERROR_ID</code></td>
|
||||
<td>USB class driver error event</td>
|
||||
</tr>
|
||||
</table></ul>
|
||||
<p><b>Logged Events</b>.
|
||||
Each logged event is 32-bits in size and includes
|
||||
</p>
|
||||
<ol>
|
||||
<li>8-bits of the trace ID (values associated with the above)</li>
|
||||
<li>8-bits of additional trace ID data, and</li>
|
||||
<li>16-bits of additonal data.</li>
|
||||
</ol>
|
||||
<p><b>8-bit Trace Data</b>
|
||||
The 8-bit trace data depends on the specific event ID. As examples,
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
For the USB serial and mass storage class, the 8-bit event data is provided in <code>include/nuttx/usb/usbdev_trace.h</code>.
|
||||
</li>
|
||||
<li>
|
||||
For the USB device driver, that 8-bit event data is provided within the USB device driver itself.
|
||||
So, for example, the 8-bit event data for the LPC1768 USB device driver is found in <code>arch/arm/src/lpc17xx/lpc17_usbdev.c</code>.
|
||||
</li>
|
||||
</ul>
|
||||
<p><b>16-bit Trace Data</b>.
|
||||
The 16-bit trace data provided additional context data relevant to the specific logged event.
|
||||
</p>
|
||||
<p><b>Trace Control Interfaces</b>.
|
||||
Logging of each of these kinds events can be enabled or disabled using the interfaces described in <code>include/nuttx/usb/usbdev_trace.h</code>.
|
||||
</p>
|
||||
<p><b>Enabling USB Device Tracing</b>.
|
||||
USB device tracing will be configured if <code>CONFIG_USBDEV</code> and either of the following are set in the NuttX configuration file:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>CONFIG_USBDEV_TRACE</code>, or</li>
|
||||
<li><code>CONFIG_DEBUG and CONFIG_DEBUG_USB</code></li>
|
||||
</ul>
|
||||
<p><b>Log Data Sink</b>.
|
||||
The logged data itself may go to either (1) an internal circular buffer, or (2) may be provided on the console.
|
||||
If <code>CONFIG_USBDEV_TRACE</code> is defined, then the trace data will go to the circular buffer.
|
||||
The size of the circular buffer is determined by <code>CONFIG_USBDEV_TRACE_NRECORDS</code>.
|
||||
Otherwise, the trace data goes to console.
|
||||
<p>
|
||||
<p><b>Example</b>.
|
||||
Here is an example of USB trace output using <code>apps/examples/usbserial</code> for an LPC1768 platform with the following NuttX configuration settings:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>CONFIG_DEBUG</code>, <code>CONFIG_DEBUG_VERBOSE</code>, <code>CONFIG_USB</code>
|
||||
<li><code>CONFIG_EXAMPLES_USBSERIAL_TRACEINIT</code>, <code>CONFIG_EXAMPLES_USBSERIAL_TRACECLASS</code>,
|
||||
<code>CONFIG_EXAMPLES_USBSERIAL_TRACETRANSFERS</code>, <code>CONFIG_EXAMPLES_USBSERIAL_TRACECONTROLLER</code>,
|
||||
<code>CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS</code>
|
||||
</ul>
|
||||
<p>Console Output:</p>
|
||||
<ul><table>
|
||||
<tr>
|
||||
<td align="center"> </td>
|
||||
<td align="left"><code>ABDE</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"> </td>
|
||||
<td align="left"><code>usbserial_main: Registering USB serial driver</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"> </td>
|
||||
<td align="left"><code>uart_register: Registering /dev/ttyUSB0</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"> </td>
|
||||
<td align="left"><code>usbserial_main: Successfully registered the serial driver</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">1</td>
|
||||
<td align="left"><code>Class API call 1: 0000</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">2</td>
|
||||
<td align="left"><code>Class error: 19:0000</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"> </td>
|
||||
<td align="left"><code>usbserial_main: ERROR: Failed to open /dev/ttyUSB0 for reading: 107</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"> </td>
|
||||
<td align="left"><code>usbserial_main: Not connected. Wait and try again.</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">3</td>
|
||||
<td align="left"><code>Interrupt 1 entry: 0039</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">4</td>
|
||||
<td align="left"><code>Interrupt decode 7: 0019</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">5</td>
|
||||
<td align="left"><code>Interrupt decode 32: 0019</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">6</td>
|
||||
<td align="left"><code>Interrupt decode 6: 0019</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">7</td>
|
||||
<td align="left"><code>Class disconnect(): 0000</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">8</td>
|
||||
<td align="left"><code>Device pullup(): 0001</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">9</td>
|
||||
<td align="left"><code>Interrupt 1 exit: 0000</code></td>
|
||||
</tr>
|
||||
</table></ul>
|
||||
<p>
|
||||
The numbered items are USB USB trace output.
|
||||
You can look in the file <code>drivers/usbdev/usbdev_trprintf.c</code> to see examctly how each output line is formatted.
|
||||
Here is how each line should be interpreted:
|
||||
</p>
|
||||
<ul><table>
|
||||
<tr>
|
||||
<th align="center"> </th>
|
||||
<td align="left">USB EVENT ID</td>
|
||||
<td align="right">8-bit<br>EVENT<br>DATA</td>
|
||||
<td align="left">MEANING</td>
|
||||
<td align="left">16-bit<br>EVENT<br>DATA</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">1</td>
|
||||
<td align="left"><code>TRACE_CLASSAPI_ID</code><sup>1</sup></td>
|
||||
<td align="right">1</td>
|
||||
<td align="left"><code>USBSER_TRACECLASSAPI_SETUP</code><sup>1</sup></td>
|
||||
<td align="left">0000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">2</td>
|
||||
<td align="left"><code>TRACE_CLSERROR_ID</code><sup>1</sup></td>
|
||||
<td align="right">19</td>
|
||||
<td align="left"><code>USBSER_TRACEERR_SETUPNOTCONNECTED</code><sup>1</sup></td>
|
||||
<td align="left">0000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">3</td>
|
||||
<td align="left"><code>TRACE_INTENTRY_ID</code><sup>1</sup></td>
|
||||
<td align="right">1</td>
|
||||
<td align="left"><code>LPC17_TRACEINTID_USB</code><sup>2</sup></td>
|
||||
<td align="left">0039</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">4</td>
|
||||
<td align="left"><code>TRACE_INTDECODE_ID</code><sup>2</sup></td>
|
||||
<td align="right">7</td>
|
||||
<td align="left"><code>LPC17_TRACEINTID_DEVSTAT</code><sup>2</sup></td>
|
||||
<td align="left">0019</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">5</td>
|
||||
<td align="left"><code>TRACE_INTDECODE_ID</code><sup>2</sup></td>
|
||||
<td align="right">32</td>
|
||||
<td align="left"><code>LPC17_TRACEINTID_SUSPENDCHG</code><sup>2</sup></td>
|
||||
<td align="left">0019</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">6</td>
|
||||
<td align="left"><code>TRACE_INTDECODE_ID</code><sup>2</sup></td>
|
||||
<td align="right">6</td>
|
||||
<td align="left"><code>LPC17_TRACEINTID_DEVRESET</code><sup>2</sup></td>
|
||||
<td align="left">0019</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">7</td>
|
||||
<td align="left"><code>TRACE_CLASS_ID</code><sup>1</sup></td>
|
||||
<td align="right">3</td>
|
||||
<td align="left"><code>(See TRACE_CLASSDISCONNECT</code><sup>1</sup>)</td>
|
||||
<td align="left">0000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">8</td>
|
||||
<td align="left"><code>TRACE_DEV_ID</code><sup>1</sup></td>
|
||||
<td align="right">6</td>
|
||||
<td align="left"><code>(See TRACE_DEVPULLUP</code><sup>1</sup>)</td>
|
||||
<td align="left">0001</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">9</td>
|
||||
<td align="left"><code>TRACE_INTEXIT_ID</code><sup>1</sup></td>
|
||||
<td align="right">1</td>
|
||||
<td align="left"><code>LPC17_TRACEINTID_USB</code><sup>2</sup></td>
|
||||
<td align="left">0000</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><small><b>NOTES</b>:<br>
|
||||
<sup>1</sup>See <code>include/nuttx/usb/usbdev_trace.h</code><br>
|
||||
<sup>2</sup><code>See arch/arm/src/lpc17xx/lpc17_usbdev.c</code>
|
||||
</small></p>
|
||||
</ul>
|
||||
<p>
|
||||
In the above example you can see that:
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>1</b>.
|
||||
The serial class USB setup method was called for the USB serial class.
|
||||
This is the corresponds to the following logic in <code>drivers/usbdev/pl2303.c</code>:
|
||||
<ul><pre>
|
||||
static int pl2303_setup(FAR struct uart_dev_s *dev)
|
||||
{
|
||||
...
|
||||
usbtrace(PL2303_CLASSAPI_SETUP, 0);
|
||||
...
|
||||
</pre></ul>
|
||||
</li>
|
||||
<li><b>2</b>.
|
||||
An error occurred while processing the setup command because no configuration has yet been selected by the host.
|
||||
This corresponds to the following logic in <code>drivers/usbdev/pl2303.c</code>:
|
||||
<ul><pre>
|
||||
static int pl2303_setup(FAR struct uart_dev_s *dev)
|
||||
{
|
||||
...
|
||||
/* Check if we have been configured */
|
||||
|
||||
if (priv->config == PL2303_CONFIGIDNONE)
|
||||
{
|
||||
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_SETUPNOTCONNECTED), 0);
|
||||
return -ENOTCONN;
|
||||
}
|
||||
...
|
||||
</pre></ul>
|
||||
<li><b>3-6</b>.
|
||||
Here is a USB interrupt that suspends and resets the device.
|
||||
</li>
|
||||
<li><b>7-8</b>.
|
||||
During the interrupt processing the serial class is disconnected
|
||||
</li>
|
||||
<li><b>9</b>.
|
||||
And the interrupt returns
|
||||
</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
@@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Free NuttX Ports</title>
|
||||
</head>
|
||||
<body background="backgd.gif">
|
||||
<center>
|
||||
<table border="1" width="80%" bgcolor="#eeeeee">
|
||||
<tr>
|
||||
<td width="210">
|
||||
<a href="freeports.html" target="_blank">
|
||||
<img src="freeports.gif" width="210" height="62" border="0"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
If you have a hardware platform that you would like to see NuttX ported to then have I got a deal for you:
|
||||
I am willing to port NuttX to run on your hardware <b><i>FREE</i></b>.
|
||||
If you are interested, contact
|
||||
<a href="http://sourceforge.net/users/patacongo/" target="_top">patacongo</a> at SourceForge.
|
||||
<a href="NuttXBanner.html">>>back<<</a>.
|
||||
</td>
|
||||
</tr></table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>NuttX</title>
|
||||
</head>
|
||||
<frameset rows="96,*" framespacing="0" border="0" frameborder="0">
|
||||
<frame name="header" scrolling="no" target="main" src="NuttXBanner.html" marginwidth="0" marginheight="0">
|
||||
<frameset cols="15%,*">
|
||||
<frame name="links" scrolling="auto" target="main" src="NuttXLinks.html" marginwidth="0" marginheight="0">
|
||||
<frame name="main" src="NuttX.html">
|
||||
</frameset>
|
||||
<noframes>
|
||||
<body>
|
||||
<p>
|
||||
This page uses frames, but your browser doesn't support them.
|
||||
Try this <a href="http://nuttx.sourceforge.net/NuttX.html">link</a>.
|
||||
</p>
|
||||
</body>
|
||||
</noframes>
|
||||
</frameset>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 451 B |