diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000000..823a1c832c --- /dev/null +++ b/ChangeLog @@ -0,0 +1,5 @@ +0.1.0 2007-03-09 Gregory Nutt + + * Initial Release + * Support for Linux user mode simulation and TI + TMS320C5471 (Arm7) provided diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index 4eb5658420..f19360a883 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -28,8 +28,8 @@ NuttX operates on the ARM7 of this dual core processor. This port uses the Spectrum Digital evaluation board with a GNU arm-elf toolchain*. - This port is in progress and partially functional (However, - my board is dead at the moment so it will be awhile before I fix it) + This port is complete, verified, and included in the initial NuttX + release.
  • 8051 Microcontroller. This port uses the PJRC 87C52 development system and the SDCC toolchain. @@ -43,17 +43,18 @@ is available that be used to build a NuttX-compatible arm-elf toolchain.Memory Footprint -

    Details to be provided

    - -

    - I have a complete build for an ARM7 target that includes most of the OS - features and a broad range of OS tests. - That builds to an executable that requires about 85Kb for .text, .data., and .bss. +

    C5471 (Arm7) + The build for this ARM7 target that includes most of the OS features and + a broad range of OS tests. The size of this executable as given by the + Linux size command is:

    -

    - I have a stripped down OS test for the 8051 target that requires only - 18Kb. A substantial effort was required to get to this size - (see spreadsheet for details). +

    +   text    data     bss     dec     hex filename
    +  53272     428    3568   57268    dfb4 nuttx
    +
    +

    87C52 + A reduced functionality OS test for the 8051 target requires only + about 18Kb (see spreadsheet for details).

    Licensing

    diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index 6894d84608..b7055adbcf 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -27,7 +27,7 @@ Gregory Nutt

    1.0 Introduction

    -This user's manual is divided into five sections: +This user's manual is divided into three sections:


    @@ -4113,28 +4111,5 @@ notify a task when a message is available on a queue. have to do some redesign.

    -
    - -

    4.0 Known Problems

    - -

    -This section documents know problems with Nuttx at the time -of this writing. -

    -


    -Problem: -There is a problem with the unblock logic in os_signal.c when message queue -becomes not-empty -- sig_mqnotempty() calls sig_received(). -sig_received() relies on task_state == TSTATE_WAIT_SIG and will ignore -tasks that are waiting on a message queue to become non-empty. -

    -Priority: LOW. If a task is blocked a waiting for a message -queue to become non-empty, it will be re-started anyway. -


    - -Problem: task_restart won't restart a running task -

    -Priority: LOW. - diff --git a/ReleaseNotes b/ReleaseNotes new file mode 100644 index 0000000000..9dec8b03ed --- /dev/null +++ b/ReleaseNotes @@ -0,0 +1,12 @@ +Nuttx-0.1.0 +^^^^^^^^^^^ + +This is the initial. This initial includes the complete NuttX RTOS +with support for the Linux user mode simulation and the TI TMS320C5471 +(Arm7) processor. Partial support for the 87C52 is included. + +This release has been verified on both the Linux user-mode and C5471 +platforms using the test program under examples/ostest. Test results +for the C5471 can be found in arch/c5471/doc/test-results.txt. + +This tarball contains a complete CVS snapshot from March 9,2007. diff --git a/arch/c5471/src/up_internal.h b/arch/c5471/src/up_internal.h index 6f6f82c835..390a914546 100644 --- a/arch/c5471/src/up_internal.h +++ b/arch/c5471/src/up_internal.h @@ -51,7 +51,7 @@ #undef CONFIG_SUPPRESS_INTERRUPTS /* Do not enable interrupts */ #undef CONFIG_SUPPRESS_TIMER_INTS /* No timer */ -#define CONFIG_SUPPRESS_SERIAL_INTS 1 /* Console will poll */ +#undef CONFIG_SUPPRESS_SERIAL_INTS /* Console will poll */ #undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */ #undef CONFIG_DUMP_ON_EXIT /* Dumpt task state on exit */ diff --git a/arch/c5471/src/up_serial.c b/arch/c5471/src/up_serial.c index 8ab1d6954b..c6d6dc58ef 100644 --- a/arch/c5471/src/up_serial.c +++ b/arch/c5471/src/up_serial.c @@ -79,10 +79,11 @@ struct uart_regs_s struct uart_buffer_s { - int head; - int tail; - int size; - char *buffer; + sem_t sem; /* Used to control exclusive access to the buffer */ + sint16 head; /* Index to the head [IN] index in the buffer */ + sint16 tail; /* Index to the tail [OUT] index in the buffer */ + sint16 size; /* The allocated size of the buffer */ + char *buffer; /* Pointer to the allocated buffer memory */ }; struct up_dev_s @@ -608,6 +609,7 @@ static void up_putxmitchar(up_dev_t *dev, int ch) } else { +#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_SERIAL_INTS) /* Transfer some characters with interrupts disabled */ up_xmitchars(dev); @@ -621,20 +623,23 @@ static void up_putxmitchar(up_dev_t *dev, int ch) { /* Still no space */ -#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_SERIAL_INTS) up_waittxfifonotfull(dev); -#else - dev->xmitwaiting = TRUE; - - /* Wait for some characters to be sent from the buffer - * with the TX interrupt disabled. - */ - - up_enabletxint(dev); - up_takesem(&dev->xmitsem); - up_disabletxint(dev); -#endif } +#else + /* Inform the interrupt level logic that we are waiting */ + + dev->xmitwaiting = TRUE; + + /* Wait for some characters to be sent from the buffer + * with the TX interrupt enabled. When the TX interrupt + * is enabled, up_xmitchars should execute and remove + * some of the data from the TX buffer. + */ + + up_enabletxint(dev); + up_takesem(&dev->xmitsem); + up_disabletxint(dev); +#endif } } } @@ -805,6 +810,10 @@ static ssize_t up_write(struct file *filep, const char *buffer, size_t buflen) up_dev_t *dev = inode->i_private; ssize_t ret = buflen; + /* Only one user can be accessing dev->xmit.head at once */ + + up_takesem(&dev->xmit.sem); + /* Loop while we still have data to copy to the transmit buffer. * we add data to the head of the buffer; up_xmitchars takes the * data from the end of the buffer. @@ -829,13 +838,14 @@ static ssize_t up_write(struct file *filep, const char *buffer, size_t buflen) if (dev->xmit.head != dev->xmit.tail) { +#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_SERIAL_INTS) up_xmitchars(dev); - if (dev->xmit.head != dev->xmit.tail) - { - up_enabletxint(dev); - } +#else + up_enabletxint(dev); +#endif } + up_givesem(&dev->xmit.sem); return ret; } @@ -849,6 +859,10 @@ static ssize_t up_read(struct file *filep, char *buffer, size_t buflen) up_dev_t *dev = inode->i_private; ssize_t ret = buflen; + /* Only one user can be accessing dev->recv.tail at once */ + + up_takesem(&dev->recv.sem); + /* Loop while we still have data to copy to the receive buffer. * we add data to the head of the buffer; up_xmitchars takes the * data from the end of the buffer. @@ -862,7 +876,7 @@ static ssize_t up_read(struct file *filep, char *buffer, size_t buflen) *buffer++ = dev->recv.buffer[dev->recv.tail]; buflen--; - if (++dev->recv.tail >= dev->recv.size) + if (++(dev->recv.tail) >= dev->recv.size) { dev->recv.tail = 0; } @@ -881,7 +895,7 @@ static ssize_t up_read(struct file *filep, char *buffer, size_t buflen) } up_enablerxint(dev); - + up_takesem(&dev->recv.sem); return ret; } @@ -1068,8 +1082,11 @@ static void up_devinit(up_dev_t *dev, * statically initialized. */ + sem_init(&dev->xmit.sem, 0, 1); dev->xmit.size = txbufsize; dev->xmit.buffer = txbuffer; + + sem_init(&dev->recv.sem, 0, 1); dev->recv.size = rxbufsize; dev->recv.buffer = rxbuffer; diff --git a/examples/ostest/sighand.c b/examples/ostest/sighand.c index f6970deb05..b5b1ad806c 100644 --- a/examples/ostest/sighand.c +++ b/examples/ostest/sighand.c @@ -216,16 +216,19 @@ void sighand_test(void) } else { - printf("sighand_test: Started waiter_main pid=%d\n" , waiterpid); + printf("sighand_test: Started waiter_main pid=%d\n", waiterpid); } /* Wait a bit */ fflush(stdout); - usleep(500*1000); + sleep(2); /* Then signal the waiter thread. */ + printf("sighand_test: Signaling pid=%d with signo=%d sigvalue=%d\n", + waiterpid, WAKEUP_SIGNAL, SIGVALUE_INT); + sigvalue.sival_int = SIGVALUE_INT; #ifdef CONFIG_CAN_PASS_STRUCTS status = sigqueue(waiterpid, WAKEUP_SIGNAL, sigvalue); @@ -241,7 +244,7 @@ void sighand_test(void) /* Wait a bit */ fflush(stdout); - usleep(500*1000); + sleep(2); /* Then check the result */ diff --git a/examples/ostest/timedwait.c b/examples/ostest/timedwait.c index 81e7c4a61a..0bc47c6937 100644 --- a/examples/ostest/timedwait.c +++ b/examples/ostest/timedwait.c @@ -161,6 +161,7 @@ void timedwait_test(void) } printf("timedwait_test: Joining\n"); + fflush(stdout); status = pthread_join(waiter, &result); if (status != 0) {