diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index b6380ec34f..6d7774dec7 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -1106,6 +1106,7 @@ nuttx-0.3.15 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> ioctl command in the ROMFS filesystem. This is a requirement for eXecute In Place (XIP) support. * Add mmap() API with restricted capability (only for XIP support) + * Extend ROMFS test at /examples/romfs to verify mmap() and XIP support. pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index 55eb1ce68b..557d59036e 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -6,31 +6,39 @@ -
-
-

Under Construction

-
-
-
-NuttX Operating System -

-User's Manual - -

-by -

-Gregory Nutt -

-Last Update: September 1, 2008 -

+

+ + + + +
+

NuttX Operating System

User's Manual

+

by

+

Gregory Nutt

+

Last Updated: September 10, 2008

+
+

-

1.0 Introduction

+ + + + +
+

1.0 Introduction

+

This manual provides general usage information for the NuttX RTOS from the perspective of the firmware developer. -

1.1 Document Overview

+ + + + +
+

1.1 Document Overview

+
+

This user's manual is divided into three sections plus a index:

@@ -74,7 +82,14 @@ Gregory Nutt -

1.2 Intended Audience and Scope

+ + + + +
+

1.2 Intended Audience and Scope

+
+

The intended audience for this document are firmware developers who are implementing applications on NuttX. Specifically, this documented is limited to addressing only NuttX RTOS APIs that are available to the application developer. @@ -86,9 +101,14 @@ Gregory Nutt That information can also be found in the NuttX Porting Guide.

-
+ + + + +
+

2.0 OS Interfaces

+
-

2.0 OS Interfaces

This section describes each C-callable interface to the NuttX Operating System. The description of each interface is presented @@ -120,9 +140,15 @@ NOTE: In order to achieve an independent name space for the NuttX interface functions, differences in function names and types are to be expected and will not be identified as differences in these paragraphs. -


+

-

2.1 Task Control Interfaces

+ + + + +
+

2.1 Task Control Interfaces

+

Tasks. @@ -554,8 +580,15 @@ level.

POSIX Compatibility: Compatible with the POSIX interface of the same name. +

-

2.2 Task Scheduling Interfaces

+ + + + +
+

2.2 Task Scheduling Interfaces

+

By default, NuttX performs strict priority scheduling: Tasks of higher @@ -916,7 +949,13 @@ priority of the calling task is returned. interface of the same name.

-

2.3 Task Switching Interfaces

+ + + + +
+

2.3 Task Switching Interfaces

+

-

2.11.6 FAT File System Support

-

2.11.5.1 mkfatfs

+

2.11.6 FAT File System Support

+

2.11.6.1 mkfatfs

Function Prototype:

@@ -6158,7 +6246,164 @@ struct fat_format_s

-

2.12 Network Interfaces

+

2.11.7 mmap() and eXecute In Place (XIP)

+

+ NuttX operates in a flat open address space. + Therefore, it generally does not require mmap() functionality. + There is one one exception: + mmap() is the API that is used to support direct access to random + access media under the following very restrictive conditions: +

    +
  1. + The filesystem supports the FIOC_MMAP ioctl command. + Any file system that maps files contiguously on the media should support this + ioctl command. + By comparison, most file system scatter files over the media in non-contiguous + sectors. As of this writing, ROMFS is the only file system that meets this requirement. +
  2. +
  3. + The underly block driver supports the BIOC_XIPBASE ioctl command + that maps the underlying media to a randomly accessible address. + At present, only the RAM/ROM disk driver does this. +
  4. +
+

+ +

2.11.7.1 mmap

+

+ Function Prototype: +

+ +

+ Description: +

+

+

+ Input Parameters: +

+

+

+ Returned Values: +

+

+ + + + + +
+

2.12 Network Interfaces

+
+

NuttX includes a simple interface layer based on uIP (see http://www.sics.se). NuttX supports subset of a standard socket interface to uIP. These network feature can be enabled by settings in the architecture @@ -6185,7 +6430,7 @@ Those socket APIs are discussed in the following paragraphs.

Function Prototype:

-  #include 
+  #include <sys/socket.h>
   int socket(int domain, int type, int protocol);
 

@@ -6227,7 +6472,7 @@ Those socket APIs are discussed in the following paragraphs.

Function Prototype:

-  #include 
+  #include <sys/socket.h>
   int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
 

@@ -6269,7 +6514,7 @@ Those socket APIs are discussed in the following paragraphs.

Function Prototype:

-  #include 
+  #include <sys/socket.h>
   int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
 

@@ -6348,7 +6593,7 @@ Those socket APIs are discussed in the following paragraphs.

Function Prototype:

-  #include 
+  #include <sys/socket.h>
   int listen(int sockfd, int backlog);
 

@@ -6386,7 +6631,7 @@ Those socket APIs are discussed in the following paragraphs.

Function Prototype:

-  #include 
+  #include <sys/socket.h>
   int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
 

@@ -6464,7 +6709,7 @@ Those socket APIs are discussed in the following paragraphs.

Function Prototype:

-  #include 
+  #include <sys/socket.h>
   ssize_t send(int sockfd, const void *buf, size_t len, int flags);
 

@@ -6496,7 +6741,7 @@ Those socket APIs are discussed in the following paragraphs.

Function Prototype:

-  #include 
+  #include <sys/socket.h>
   ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
                  const struct sockaddr *to, socklen_t tolen);
 
@@ -6569,7 +6814,7 @@ Those socket APIs are discussed in the following paragraphs.

Function Prototype:

-  #include 
+  #include <sys/socket.h>
   ssize_t recv(int sockfd, void *buf, size_t len, int flags);
 

@@ -6600,7 +6845,7 @@ Those socket APIs are discussed in the following paragraphs.

Function Prototype:

-  #include 
+  #include <sys/socket.h>
   ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags,
                    struct sockaddr *from, socklen_t *fromlen);
 
@@ -6662,7 +6907,7 @@ Those socket APIs are discussed in the following paragraphs.

Function Prototype:

-  #include 
+  #include <sys/socket.h>
   int setsockopt(int sockfd, int level, int option,
                  const void *value, socklen_t value_len);
 
@@ -6678,7 +6923,7 @@ Those socket APIs are discussed in the following paragraphs.

options at the socket level, specify the level argument as SOL_SOCKET.

- See a complete list of values for the option argument. + See sys/socket.h for a complete list of values for the option argument.

Input Parameters: @@ -6722,7 +6967,7 @@ Those socket APIs are discussed in the following paragraphs.

Function Prototype:

-  #include 
+  #include <sys/socket.h>
   int getsockopt(int sockfd, int level, int option,
                  void *value, socklen_t *value_len);
 
@@ -6741,7 +6986,7 @@ Those socket APIs are discussed in the following paragraphs.

SOL_SOCKET.

- See a complete list of values for the option argument. + See sys/socket.hfor a complete list of values for the option argument.

Input Parameters: @@ -6772,9 +7017,22 @@ Those socket APIs are discussed in the following paragraphs.

Insufficient resources are available in the system to complete the call. -
-

3.0 OS Data Structures

-

3.1 Scalar Types

+ + + + +
+

3.0 OS Data Structures

+
+ + + + + +
+

3.1 Scalar Types

+
+

Many of the types used to communicate with NuttX are simple scalar types. These types are used to provide architecture independence @@ -6788,7 +7046,14 @@ interface include:

  • time_t -

    3.2 Hidden Interface Structures

    + + + + +
    +

    3.2 Hidden Interface Structures

    +
    +

    Several of the types used to interface with NuttX are structures that are intended to be hidden from the application. @@ -6807,9 +7072,15 @@ OS resources. These hidden structures include: specific elements within these hidden structures. These hidden structures will not be described further in this user's manual.

    -

    -

    3.3 Access to the errno Variable

    + + + + +
    +

    3.3 Access to the errno Variable

    +
    +

    A pointer to the thread-specific errno value is available through a function call: @@ -6817,7 +7088,7 @@ OS resources. These hidden structures include:

    Function Prototype:

    -

        #include 
    +
        #include <errno.h>
         #define errno *get_errno_ptr()
         int *get_errno_ptr( void )

    @@ -6841,10 +7112,16 @@ OS resources. These hidden structures include:

    • A pointer to the thread-specific errno value.
    -

    +

    + + + + + +
    +

    3.4 User Interface Structures

    +
    -

    3.4 User Interface Structures

    -

    3.4.1 main_t

    main_t defines the type of a task entry point. main_t is declared @@ -6984,12 +7261,20 @@ notify a task when a message is available on a queue. have to do some redesign.

    -

    Index

    + + + + +
    +

    Index

    +
    +
  • accept
  • bind
  • +
  • BIOC_XIPBASE
  • chdir
  • clock_getres
  • clock_gettime
  • @@ -7003,6 +7288,7 @@ notify a task when a message is available on a queue.
  • Driver operations
  • dup
  • dup2
  • +
  • eXecute In Place (XIP)
  • exit
  • FAT File System Support
  • fclose
  • @@ -7015,6 +7301,7 @@ notify a task when a message is available on a queue.
  • fgetc
  • fgetpos
  • fgets
  • +
  • FIOC_MMAP
  • fopen
  • fprintf
  • fputc
  • @@ -7051,13 +7338,14 @@ notify a task when a message is available on a queue.
  • mq_timedreceive
  • mq_timedsend
  • mq_unlink
  • +
  • mmap
  • Network Interfaces
  • open
  • opendir
  • OS Interfaces
  • -
  • pipe
  • +
  • pipe
  • printf
  • Pthread Interfaces
  • pthread_attr_destroy
  • @@ -7116,6 +7404,7 @@ notify a task when a message is available on a queue.
  • pthread_testcancelstate
  • pthread_yield
  • puts
  • +
  • RAM disk driver
  • read
  • readdir
  • readdir_r
  • @@ -7124,10 +7413,12 @@ notify a task when a message is available on a queue.
  • rename
  • rmdir
  • rewinddir
  • +
  • ROM disk driver
  • +
  • ROMFS
  • sched_getparam
  • -
  • sched_get_priority_max
  • +
  • sched_get_priority_max
  • sched_get_priority_min
  • sched_get_rr_interval
  • sched_lockcount
  • @@ -7196,6 +7487,7 @@ notify a task when a message is available on a queue.
  • wd_gettime
  • wd_start
  • write
  • +
  • XIP