diff --git a/ChangeLog b/ChangeLog index 5cc86cc551..fcfc8ff698 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1519,4 +1519,10 @@ advantage that it runs in the actual NuttX tasking environment (the mm/mm_test.c only runs in a PC simulation environment). * drivers/mmcsd_sdio.c/h -- Several corrections submitted by Uros Platise. + * arch/x86 - Provide support for x86 architectures. Support for the i486 + architecture under QEMU is provided under arch/x86/include/i486, + arch/x86/include/qemu, arch/x86/src/i486, and arch/x86/src/qemu. + * configs/qemu-i486 - "Board" support configurations for verifying the QEME + i486 port. + diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index 3e46d58e8d..4cdadd2761 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -8,7 +8,7 @@

NuttX RTOS

-

Last Updated: March 2, 2011

+

Last Updated: March 5, 2011

@@ -2115,12 +2115,17 @@ nuttx-5.19 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> occurs. * configs/olimex-lpc1766stk -- Added an LED encoded to indicate if the LPC1766 is in sleeping. - * examples/mm -- This is a simplified version of the "built-in" memory manager - test of mm/mm_test.c. It is simplified because it does not have access to - the internals of the memory manager as does mm/mm_test.c, but it has the - advantage that it runs in the actual NuttX tasking environment (the - mm/mm_test.c only runs in a PC simulation environment). + * examples/mm -- This is a simplified version of the "built-in" memory manager + test of mm/mm_test.c. It is simplified because it does not have access to + the internals of the memory manager as does mm/mm_test.c, but it has the + advantage that it runs in the actual NuttX tasking environment (the + mm/mm_test.c only runs in a PC simulation environment). * drivers/mmcsd_sdio.c/h -- Several corrections submitted by Uros Platise. + * arch/x86 - Provide support for x86 architectures. Support for the i486 + architecture under QEMU is provided under arch/x86/include/i486, + arch/x86/include/qemu, arch/x86/src/i486, and arch/x86/src/qemu. + * configs/qemu-i486 - "Board" support configurations for verifying the QEME + i486 port. pascal-2.1 2011-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/Documentation/README.html b/Documentation/README.html index 0338330fae..c9238cc8d1 100755 --- a/Documentation/README.html +++ b/Documentation/README.html @@ -9,7 +9,7 @@

NuttX README Files

-

Last Updated: February 27, 2010

+

Last Updated: March 5, 2010

@@ -38,6 +38,11 @@ | | | |-m16c/README.txt | | | |-sh1/README.txt | | | `-README.txt + | |- x86/ + | | |- include/ + | | | `-README.txt + | | `- src/ + | | `-README.txt | `- z80/ | | `- src/ | | `- z80/README.txt @@ -111,6 +116,10 @@ | | |- include/README.txt | | |- src/README.txt | | `- README.txt + | |- qemu-i486/ + | | |- include/README.txt + | | |- src/README.txt + | | `- README.txt | |- sam3u-ek/ | | `- README.txt | |- sim/ diff --git a/README.txt b/README.txt index 4ae870ee6f..af6af5fa13 100755 --- a/README.txt +++ b/README.txt @@ -251,6 +251,11 @@ Below is a guide to the available README files in the NuttX source tree: | | | |-m16c/README.txt | | | |-sh1/README.txt | | | `-README.txt + | |- x86/ + | | |- include/ + | | | `-README.txt + | | `- src/ + | | `-README.txt | `- z80/ | | `- src/ | | `- z80/README.txt @@ -324,6 +329,10 @@ Below is a guide to the available README files in the NuttX source tree: | | |- include/README.txt | | |- src/README.txt | | `- README.txt + | |- qemu-i486/ + | | |- include/README.txt + | | |- src/README.txt + | | `- README.txt | |- sam3u-ek/ | | `- README.txt | |- sim/ diff --git a/arch/x86/src/qemu/Make.defs b/arch/x86/src/qemu/Make.defs index e44028699e..6bcf102f92 100755 --- a/arch/x86/src/qemu/Make.defs +++ b/arch/x86/src/qemu/Make.defs @@ -52,6 +52,6 @@ CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \ CHIP_ASRCS = qemu_saveusercontext.S qemu_fullcontextrestore.S qemu_vectors.S CHIP_CSRCS = qemu_handlers.c qemu_idle.c qemu_irq.c qemu_lowputc.c \ - qemu_lowsetup.c qemu_timerisr.c + qemu_lowsetup.c qemu_serial.c qemu_timerisr.c # Configuration-dependent QEMU files diff --git a/arch/x86/src/qemu/qemu_serial.c b/arch/x86/src/qemu/qemu_serial.c new file mode 100644 index 0000000000..743ccb6915 --- /dev/null +++ b/arch/x86/src/qemu/qemu_serial.c @@ -0,0 +1,89 @@ +/**************************************************************************** + * arch/x86/src/qemu/qemu_serial.c + * + * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include "up_internal.h" + +#ifdef CONFIG_USE_SERIALDRIVER +#error "Serial driver support not initialized" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +#else /* CONFIG_USE_SERIALDRIVER */ + +/**************************************************************************** + * Name: up_putc + * + * Description: + * Provide priority, low-level access to support OS debug writes + * + ****************************************************************************/ + +int up_putc(int ch) +{ + /* Check for LF */ + + if (ch == '\n') + { + /* Add CR */ + + up_lowputc('\r'); + } + + up_lowputc(ch); + return ch; +} + +#endif /* CONFIG_USE_SERIALDRIVER */ diff --git a/configs/qemu-i486/ostest/defconfig b/configs/qemu-i486/ostest/defconfig index f352930f51..44cb27a03b 100644 --- a/configs/qemu-i486/ostest/defconfig +++ b/configs/qemu-i486/ostest/defconfig @@ -86,67 +86,61 @@ CONFIG_ARCH_DMA=n # # General OS setup # -# CONFIG_APP_DIR - Identifies the relative path to the directory -# that builds the application to link with NuttX. +# CONFIG_APP_DIR - Identifies the relative path to the directory that builds +# the application to link with NuttX. # CONFIG_DEBUG - enables built-in debug options # CONFIG_DEBUG_VERBOSE - enables verbose debug output -# CONFIG_DEBUG_SYMBOLS - build without optimization and with -# debug symbols (needed for use with a debugger). -# CONFIG_MM_REGIONS - If the architecture includes multiple -# regions of memory to allocate from, this specifies the -# number of memory regions that the memory manager must -# handle and enables the API mm_addregion(start, end); -# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot -# time console output -# CONFIG_TICKS_PER_MSEC - The default system timer is 100Hz -# or TICKS_PER_MSEC=10. This setting may be defined to -# inform NuttX that the processor hardware is providing -# system timer interrupts at some interrupt interval other -# than 10 msec. -# CONFIG_RR_INTERVAL - The round robin timeslice will be set -# this number of milliseconds; Round robin scheduling can -# be disabled by setting this value to zero. -# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in -# scheduler to monitor system performance -# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a -# task name to save in the TCB. Useful if scheduler -# instrumentation is selected. Set to zero to disable. +# CONFIG_DEBUG_SYMBOLS - build without optimization and with debug symbols +# (needed for use with a debugger). +# CONFIG_MM_REGIONS - If the architecture includes multiple regions of memory +# to allocate from, this specifies the number of memory regions that the +# memory manager must handle and enables the API mm_addregion(start, end); +# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot time console +# output. +# CONFIG_TICKS_PER_MSEC - The default system timer is 100Hz or TICKS_PER_MSEC=10. +# This setting may be defined to inform NuttX that the processor hardware is +# providing system timer interrupts at some interrupt interval other than 10 +# msec. +# CONFIG_RR_INTERVAL - The round robin timeslice will be set this number of +# milliseconds; Round robin scheduling can be disabled by setting this +# value to zero. +# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in scheduler to +# monitor system performance +# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a task name to save in +# the TCB. Useful if scheduler instrumentation is selected. Set to zero to +# disable. # CONFIG_JULIAN_TIME - Enables Julian time conversions -# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY - -# Used to initialize the internal time logic. -# CONFIG_DEV_CONSOLE - Set if architecture-specific logic -# provides /dev/console. Enables stdout, stderr, stdin. -# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console -# driver (minimul support) -# CONFIG_MUTEX_TYPES: Set to enable support for recursive and -# errorcheck mutexes. Enables pthread_mutexattr_settype(). -# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority -# inheritance on mutexes and semaphores. -# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority -# inheritance is enabled. It defines the maximum number of -# different threads (minus one) that can take counts on a -# semaphore with priority inheritance support. This may be -# set to zero if priority inheritance is disabled OR if you -# are only using semaphores as mutexes (only one holder) OR -# if no more than two threads participate using a counting +# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY - Used to initialize +# the internal time logic. +# CONFIG_DEV_CONSOLE - Set if architecture-specific logic provides /dev/console. +# Enables stdout, stderr, stdin. +# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console driver +# (minimal support) +# CONFIG_MUTEX_TYPES: Set to enable support for recursive and errorcheck +# mutexes. Enables pthread_mutexattr_settype(). +# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority inheritance +# on mutexes and semaphores. +# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority inheritance +# is enabled. It defines the maximum number of different threads (minus one) +# that can take counts on a semaphore with priority inheritance support. +# This may be set to zero if priority inheritance is disabled OR if you are +# only using semaphores as mutexes (only one holder) OR if no more than two +# threads participate using a counting semaphore. +# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled, then this setting +# is the maximum number of higher priority threads (minus 1) than can be +# waiting for another thread to release a count on a semaphore. This value +# may be set to zero if no more than one thread is expected to wait for a # semaphore. -# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled, -# then this setting is the maximum number of higher priority -# threads (minus 1) than can be waiting for another thread -# to release a count on a semaphore. This value may be set -# to zero if no more than one thread is expected to wait for -# a semaphore. -# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors -# by task_create() when a new task is started. If set, all -# files/drivers will appear to be closed in the new task. -# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first -# three file descriptors (stdin, stdout, stderr) by task_create() -# when a new task is started. If set, all files/drivers will -# appear to be closed in the new task except for stdin, stdout, -# and stderr. -# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket -# desciptors by task_create() when a new task is started. If -# set, all sockets will appear to be closed in the new task. +# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors by task_create() +# when a new task is started. If set, all files/drivers will appear to be +# closed in the new task. +# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first three file +# descriptors (stdin, stdout, stderr) by task_create() when a new task is +# started. If set, all files/drivers will appear to be closed in the new +# task except for stdin, stdout, and stderr. +# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket desciptors by +# task_create() when a new task is started. If set, all sockets will appear +# to be closed in the new task. # CONFIG_APP_DIR=examples/ostest CONFIG_DEBUG=y @@ -162,7 +156,7 @@ CONFIG_START_MONTH=3 CONFIG_START_DAY=3 CONFIG_JULIAN_TIME=n CONFIG_DEV_CONSOLE=y -CONFIG_DEV_LOWCONSOLE=n +CONFIG_DEV_LOWCONSOLE=y CONFIG_MUTEX_TYPES=y CONFIG_PRIORITY_INHERITANCE=n CONFIG_SEM_PREALLOCHOLDERS=0 @@ -172,19 +166,15 @@ CONFIG_FDCLONE_STDIO=n CONFIG_SDCLONE_DISABLE=y # -# The following can be used to disable categories of -# APIs supported by the OS. If the compiler supports -# weak functions, then it should not be necessary to -# disable functions unless you want to restrict usage -# of those APIs. +# The following can be used to disable categories ofAPIs supported by the OS. +# If the compiler supports weak functions, then it should not be necessary to +# disable functions unless you want to restrict usage of those APIs. # -# There are certain dependency relationships in these -# features. +# There are certain dependency relationships in these features. # -# o mq_notify logic depends on signals to awaken tasks -# waiting for queues to become full or empty. -# o pthread_condtimedwait() depends on signals to wake -# up waiting tasks. +# o mq_notify logic depends on signals to awaken tasks waiting for queues to +# become full or empty. +# o pthread_condtimedwait() depends on signals to wake up waiting tasks. # CONFIG_DISABLE_CLOCK=n CONFIG_DISABLE_POSIX_TIMERS=n @@ -198,16 +188,16 @@ CONFIG_DISABLE_POLL=y # # Misc libc settings # -# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a -# little smaller if we do not support fieldwidthes +# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a little smaller if we +# do not support fieldwidthes # CONFIG_NOPRINTF_FIELDWIDTH=n # # Allow for architecture optimized implementations # -# The architecture can provide optimized versions of the -# following to improve sysem performance +# The architecture can provide optimized versions of the following to improve +# system performance # CONFIG_ARCH_MEMCPY=n CONFIG_ARCH_MEMCMP=n @@ -226,14 +216,14 @@ CONFIG_ARCH_KFREE=n ## # General build options # -# CONFIG_RRLOAD_BINARY - make the rrload binary format used with -# BSPs from www.ridgerun.com using the tools/mkimage.sh script -# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format -# used with many different loaders using the GNU objcopy program -# Should not be selected if you are not using the GNU toolchain. -# CONFIG_RAW_BINARY - make a raw binary format file used with many -# different loaders using the GNU objcopy program. This option -# should not be selected if you are not using the GNU toolchain. +# CONFIG_RRLOAD_BINARY - make the rrload binary format used with BSPs from +# www.ridgerun.com using the tools/mkimage.sh script +# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format used with many +# different loaders using the GNU objcopy program Should not be selected if +# you are not using the GNU toolchain. +# CONFIG_RAW_BINARY - make a raw binary format file used with many different +# loaders using the GNU objcopy program. This option should not be selected +# if you are not using the GNU toolchain. # CONFIG_HAVE_LIBM - toolchain supports libm.a # CONFIG_RRLOAD_BINARY=n @@ -244,37 +234,33 @@ CONFIG_HAVE_LIBM=y # # Sizes of configurable things (0 disables) # -# CONFIG_MAX_TASKS - The maximum number of simultaneously -# active tasks. This value must be a power of two. -# CONFIG_MAX_TASK_ARGS - This controls the maximum number of -# of parameters that a task may receive (i.e., maxmum value -# of 'argc') -# CONFIG_NPTHREAD_KEYS - The number of items of thread- -# specific data that can be retained -# CONFIG_NFILE_DESCRIPTORS - The maximum number of file -# descriptors (one for each open) -# CONFIG_NFILE_STREAMS - The maximum number of streams that -# can be fopen'ed +# CONFIG_MAX_TASKS - The maximum number of simultaneously active tasks. This +# value must be a power of two. +# CONFIG_MAX_TASK_ARGS - This controls the maximum number of of parameters +# that a task may receive (i.e., maxmum value of 'argc') +# CONFIG_NPTHREAD_KEYS - The number of items of thread-specific data that can +# be retained +# CONFIG_NFILE_DESCRIPTORS - The maximum number of file descriptors (one for +# each open) +# CONFIG_NFILE_STREAMS - The maximum number of streams that can be fopen'ed # CONFIG_NAME_MAX - The maximum size of a file name. -# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate -# on fopen. (Only if CONFIG_NFILE_STREAMS > 0) -# CONFIG_NUNGET_CHARS - Number of characters that can be -# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0) -# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message -# structures. The system manages a pool of preallocated -# message structures to minimize dynamic allocations -# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with -# a fixed payload size given by this settin (does not include -# other message structure overhead. -# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that -# can be passed to a watchdog handler -# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog -# structures. The system manages a pool of preallocated -# watchdog structures to minimize dynamic allocations -# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX -# timer structures. The system manages a pool of preallocated -# timer structures to minimize dynamic allocations. Set to -# zero for all dynamic allocations. +# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate on fopen. (Only if +# CONFIG_NFILE_STREAMS > 0) +# CONFIG_NUNGET_CHARS - Number of characters that can be buffered by ungetc() +# (Only if CONFIG_NFILE_STREAMS > 0) +# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message structures. +# The system manages a pool of preallocated message structures to minimize +# dynamic allocations +# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with a fixed payload +# size given by this settin (does not include other message structure overhead. +# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that can be passed to a +# watchdog handler +# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog structures. The +# system manages a pool of preallocated watchdog structures to minimize +# dynamic allocations +# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX timer structures. +# The system manages a pool of preallocated timer structures to minimize +# dynamic allocations. Set to zero for all dynamic allocations. # CONFIG_MAX_TASKS=64 CONFIG_MAX_TASK_ARGS=4