diff --git a/ChangeLog b/ChangeLog
index aca800c8cf..289460c7ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -341,5 +341,8 @@
* Fix broken 'clean' target on z80sim configurations
* Re-structure arch/z80 to provide support for all ZiLOG 8-bit microcontrollers (ez8
in particular for now).
+ * Add support for TRS80-Model 3 based on the xtrs emulation (http://www.tim-mann.org/xtrs.html)
+ Per patch from Jacques Pelletier.
+
diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html
index 90d8dd1a0c..a2a4803a38 100644
--- a/Documentation/NuttX.html
+++ b/Documentation/NuttX.html
@@ -995,6 +995,8 @@ nuttx-0.3.9 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
* Fix broken 'clean' target on z80sim configurations
* Re-structure arch/z80 to provide support for all ZiLOG 8-bit microcontrollers (ez8
in particular for now).
+ * Add support for TRS80-Model 3 based on the xtrs emulation (http://www.tim-mann.org/xtrs.html)
+ Per patch from Jacques Pelletier.
pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html
index fcf74416c5..c84fa4fe10 100644
--- a/Documentation/NuttxPortingGuide.html
+++ b/Documentation/NuttxPortingGuide.html
@@ -16,7 +16,7 @@
All of the specific boards supported by NuttX are identified below.
- These the the specific <board-name>'s that may be used to configure NuttX
+ These are the specific <board-name>'s that may be used to configure NuttX
as described below.
@@ -637,15 +637,21 @@
This port is not quite ready for prime time.
+ configs/xtrs
+ TRS80 Model 3. This port uses a vintage computer based on the Z80.
+ An emulator for this computer is available to run TRS80 programs on a
+ linux platform (http://www.tim-mann.org/xtrs.html).
+
+
configs/z16f2800100zcog
- z16f Microncontroller.
+ z16f Microcontroller.
This port use the Zilog z16f2800100zcog development kit and the
Zilog ZDS-II Windows command line tools.
The development environment is Cygwin under WinXP.
configs/z8encore000zco
- z8Encore! Microncontroller. This port use the Zilog z8encore000zco
+ z8Encore! Microcontroller. This port use the Zilog z8encore000zco
development kit, Z8F6403 part, and the Zilog ZDS-II Windows command line
tools. The development environment is Cygwin under WinXP.
@@ -994,7 +1000,7 @@ The system can be re-made subsequently by just typing make
.
Inputs:
tcb
: Refers to a task in the ready-to-run list (normally
- the task at the the head of the list). It most be
+ the task at the head of the list). It most be
stopped, its context saved and moved into one of the
waiting task lists. It it was the task at the head
of the ready-to-run list, then a context to the new
@@ -1293,7 +1299,7 @@ The system can be re-made subsequently by just typing make
.
- Some architectures require a description of the the RAM configuration:
+ Some architectures require a description of the RAM configuration:
CONFIG_DRAM_SIZE
:
@@ -1301,7 +1307,7 @@ The system can be re-made subsequently by just typing make
.
CONFIG_DRAM_START
:
The start address of DRAM (physical)
CONFIG_DRAM_VSTART
:
- The startaddress of DRAM (virtual)
+ The start address of DRAM (virtual)
diff --git a/arch/z80/include/io.h b/arch/z80/include/io.h
new file mode 100644
index 0000000000..ce6a90ab5b
--- /dev/null
+++ b/arch/z80/include/io.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+ * arch/z80/include/io.h
+ * arch/chip/io.h
+ *
+ * Copyright (C) 2008 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.
+ *
+ ****************************************************************************/
+
+#ifndef __ARCH_IO_H
+#define __ARCH_IO_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include
+
+/****************************************************************************
+ * Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Variables
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+#ifndef __ASSEMBLY__
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+#endif /* __ARCH_IO_H */
diff --git a/arch/z80/include/z80/io.h b/arch/z80/include/z80/io.h
new file mode 100644
index 0000000000..dc74d047e9
--- /dev/null
+++ b/arch/z80/include/z80/io.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+ * arch/z80/include/z80/io.h
+ * arch/chip/io.h
+ *
+ * Copyright (C) 2008 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.
+ *
+ ****************************************************************************/
+
+/* This file should never be included directed but, rather, only indirectly
+ * through arch/io.h
+ */
+
+#ifndef __ARCH_Z80_IO_H
+#define __ARCH_Z80_IO_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+/****************************************************************************
+ * Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/****************************************************************************
+ * Inline functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Variables
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+#ifndef __ASSEMBLY__
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
+EXTERN void outp(char p, char c);
+EXTERN char inp(char p);
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+#endif /* __ARCH_Z80_IO_H */
diff --git a/arch/z80/src/Makefile.sdcc b/arch/z80/src/Makefile.sdcc
index 89278d894a..51751be851 100644
--- a/arch/z80/src/Makefile.sdcc
+++ b/arch/z80/src/Makefile.sdcc
@@ -153,8 +153,16 @@ pass1.ihx: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_AOBJ) board/libboar
echo "-l $(TOPDIR)/$$LIB" >> pass1.lnk ;\
done
@echo "-l myz80.lib" >>pass1.lnk # Name of SDCC z80 library
+ifneq ($(CONFIG_LINKER_START_AREA),)
+ @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>pass1.lnk # Start of START area
+else
@echo "-b START=0" >>pass1.lnk # Start of START area
+endif
+ifneq ($(CONFIG_LINKER_CODE_AREA),)
+ @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>pass1.lnk # Start of _CODE area
+else
@echo "-b _CODE=256" >>pass1.lnk # Start of _CODE area
+endif
@echo "-i" >>pass1.lnk # Intel hex format
@echo "-x" >>pass1.lnk # Hexadecimal
@echo "-m" >>pass1.lnk # Generate a map file
@@ -178,8 +186,16 @@ nuttx.ihx: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_AOBJ) board/libboar
echo "-l $(TOPDIR)/$$LIB" >> nuttx.lnk ;\
done
@echo "-l myz80.lib" >>nuttx.lnk # Name of SDCC z80 library
+ifneq ($(CONFIG_LINKER_START_AREA),)
+ @echo "-b START=$(CONFIG_LINKER_START_AREA)" >>nuttx.lnk # Start of START area
+else
@echo "-b START=0" >>nuttx.lnk # Start of START area
+endif
+ifneq ($(CONFIG_LINKER_CODE_AREA),)
+ @echo "-b _CODE=$(CONFIG_LINKER_CODE_AREA)" >>nuttx.lnk # Start of _CODE area
+else
@echo "-b _CODE=256" >>nuttx.lnk # Start of _CODE area
+endif
@echo "-i" >>nuttx.lnk # Intel hex format
@echo "-x" >>nuttx.lnk # Hexadecimal
@echo "-m" >>nuttx.lnk # Generate a map file
diff --git a/arch/z80/src/z80/Make.defs b/arch/z80/src/z80/Make.defs
index fb1be00e20..b48a4660ff 100644
--- a/arch/z80/src/z80/Make.defs
+++ b/arch/z80/src/z80/Make.defs
@@ -43,7 +43,7 @@ CMN_CSRCS = up_initialize.c up_allocateheap.c up_createstack.c \
up_mdelay.c up_udelay.c up_usestack.c
CHIP_ASRCS = z80_saveusercontext.asm z80_restoreusercontext.asm
-CHIP_CSRCS = z80_initialstate.c z80_irq.c z80_copystate.c \
+CHIP_CSRCS = z80_initialstate.c z80_io.c z80_irq.c z80_copystate.c \
z80_schedulesigaction.c z80_sigdeliver.c \
z80_registerdump.c
diff --git a/arch/z80/src/z80/z80_io.c b/arch/z80/src/z80/z80_io.c
new file mode 100644
index 0000000000..fdd72f1255
--- /dev/null
+++ b/arch/z80/src/z80/z80_io.c
@@ -0,0 +1,97 @@
+/****************************************************************************
+ * arch/z80/src/z80/z80_io.c
+ *
+ * Copyright (C) 2008 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
+/* #include */
+
+#include "up_internal.h"
+
+/****************************************************************************
+ * Private Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: outb
+ *
+ * Description:
+ * Output byte c on port p
+ *
+ ****************************************************************************/
+
+void outp(char p, char c)
+{
+ _asm
+ ld c, 4(ix) ; port
+ ld a, 5(ix) ; value
+ out (c), a
+ _endasm;
+}
+
+
+/****************************************************************************
+ * Name: inpb
+ *
+ * Description:
+ * Input byte from port p
+ *
+ ****************************************************************************/
+
+char inp(char p)
+{
+ _asm
+ ld c, 4(ix) ;port
+ in l, (c)
+ _endasm;
+}
diff --git a/configs/README.txt b/configs/README.txt
index ea9dedaf8d..c5ce860f0f 100644
--- a/configs/README.txt
+++ b/configs/README.txt
@@ -127,11 +127,11 @@ defconfig -- This is a configuration file similar to the Linux
CONFIG_ENDIAN_BIG - define if big endian (default is little
endian)
- Some architectures require a description of the the RAM configuration:
+ Some architectures require a description of the RAM configuration:
CONFIG_DRAM_SIZE - Describes the installed DRAM.
CONFIG_DRAM_START - The start address of DRAM (physical)
- CONFIG_DRAM_VSTART - The startaddress of DRAM (virtual)
+ CONFIG_DRAM_VSTART - The start address of DRAM (virtual)
General build options
@@ -305,12 +305,12 @@ configs/c5471evm
This is a port to the Spectrum Digital C5471 evaluation board. The
TMS320C5471 is a dual core processor from TI with an ARM7TDMI general
purpose processor and a c54 DSP. It is also known as TMS320DA180 or just DA180.
- NuttX runs on the ARM core and is built with with a GNU arm-elf toolchain*.
+ NuttX runs on the ARM core and is built with a GNU arm-elf toolchain*.
This port is complete, verified, and included in the NuttX release.
configs/mcu123-lpc214x
This is a port to the mcu123.com lpc214x development board.
- This OS is also built with the the arm-elf toolchain*
+ This OS is also built with the arm-elf toolchain*
configs/ntosd-dm320
This port uses the Neuros OSD with a GNU arm-elf toolchain*:
@@ -327,27 +327,32 @@ configs/mcu123-lpc214x
configs/m68322evb
This is a work in progress for the venerable m68322evb board from
- Motorola. This OS is also built with the the arm-elf toolchain*.
+ Motorola. This OS is also built with the arm-elf toolchain*.
configs/pjrc-8051
8051 Microcontroller. This port uses the PJRC 87C52 development system
and the SDCC toolchain. This port is not quite ready for prime time.
+configs/xtrs
+ TRS80 Model 3. This port uses a vintage computer based on the Z80.
+ An emulator for this computer is available to run TRS80 programs on a
+ linux platform (http://www.tim-mann.org/xtrs.html).
+
configs/z16f2800100zcog
- z16f Microncontroller. This port use the Zilog z16f2800100zcog
+ z16f Microcontroller. This port use the Zilog z16f2800100zcog
development kit and the Zilog ZDS-II Windows command line tools. The
development environment is Cygwin under WinXP.
configs/z8encore000zco
- z8Encore! Microncontroller. This port use the Zilog z8encore000zco
+ z8Encore! Microcontroller. This port use the Zilog z8encore000zco
development kit, Z8F6403 part, and the Zilog ZDS-II Windows command line
tools. The development environment is Cygwin under WinXP.
-configs/z80zim
+configs/z80sim
z80 Microcontroller. This port uses a Z80 instruction set simulator.
That simulator can be found in the NuttX CVS at
http://nuttx.cvs.sourceforge.net/nuttx/misc/sims/z80sim.
- This port also the SDCC toolchain (http://sdcc.sourceforge.net/")
+ This port also uses the SDCC toolchain (http://sdcc.sourceforge.net/")
(verified with version 2.6.0).
Other ports for the for the TI TMS320DM270, M683222 and for MIPS are in various
@@ -368,5 +373,3 @@ tools/configure.sh
cd tools
./configure.sh /
-
-
diff --git a/configs/z80sim/src/z80_serial.c b/configs/z80sim/src/z80_serial.c
index 8bc1b02b48..b5a0c68632 100644
--- a/configs/z80sim/src/z80_serial.c
+++ b/configs/z80sim/src/z80_serial.c
@@ -346,7 +346,7 @@ void up_serialinit(void)
{
#if defined(CONFIG_DEV_LOWCONSOLE)
(void)lowconsole_init();
-#elif defiened(CONFIG_DEV_CONSOLE)
+#elif defined(CONFIG_DEV_CONSOLE)
(void)uart_register("/dev/console", &g_uartport);
(void)uart_register("/dev/ttyS0", &g_uartport);
#endif
@@ -368,6 +368,3 @@ int up_putc(int ch)
return 0;
}
-
-
-