Add support for the TRS-80 Model 3

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@690 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2008-02-15 22:14:00 +00:00
parent c90fc3b5e6
commit c558d34600
10 changed files with 309 additions and 24 deletions

View File

@ -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.

View File

@ -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>

View File

@ -16,7 +16,7 @@
</b></big></h1>
<p><small>by</small></p>
<p>Gregory Nutt</p>
<p><small>Last Update: February 11, 2008</small></p>
<p><small>Last Update: February 15, 2008</small></p>
</center>
<center><h1>Table of Contents</h1></center>
@ -442,7 +442,7 @@
z80 instruction simulator.
The set 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 and 2.7.0).
</li>
@ -590,7 +590,7 @@
<h3><a name="supportedboards">2.3.3 Supported Boards</a></h3>
<p>
All of the specific boards supported by NuttX are identified below.
These the the specific <i>&lt;board-name&gt;</i>'s that may be used to configure NuttX
These are the specific <i>&lt;board-name&gt;</i>'s that may be used to configure NuttX
as described <a href="#configuringnuttx">below</a>.
</p>
<ul>
@ -637,15 +637,21 @@
This port is not quite ready for prime time.
</li>
<li><code>configs/xtrs</code>
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).
</li>
<li><code>configs/z16f2800100zcog</code>
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.
</li>
<li><code>configs/z8encore000zco</code>
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.
</li>
@ -994,7 +1000,7 @@ The system can be re-made subsequently by just typing <code>make</code>.
<p><b>Inputs:</b></p>
<ul>
<li><code>tcb</code>: 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 <code>make</code>.
</ul>
<p>
Some architectures require a description of the the RAM configuration:
Some architectures require a description of the RAM configuration:
</p>
<ul>
<li><code>CONFIG_DRAM_SIZE</code>:
@ -1301,7 +1307,7 @@ The system can be re-made subsequently by just typing <code>make</code>.
<li><code>CONFIG_DRAM_START</code>:
The start address of DRAM (physical)</li>
<li><code>CONFIG_DRAM_VSTART</code>:
The startaddress of DRAM (virtual)</li>
The start address of DRAM (virtual)</li>
</ul>
<p>

76
arch/z80/include/io.h Normal file
View File

@ -0,0 +1,76 @@
/****************************************************************************
* arch/z80/include/io.h
* arch/chip/io.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* 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 <arch/chip/io.h>
/****************************************************************************
* 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 */

85
arch/z80/include/z80/io.h Normal file
View File

@ -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 <spudmonkey@racsa.co.cr>
*
* 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 */

View File

@ -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

View File

@ -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

97
arch/z80/src/z80/z80_io.c Normal file
View File

@ -0,0 +1,97 @@
/****************************************************************************
* arch/z80/src/z80/z80_io.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* 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 <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/arch.h>
/* #include <nuttx/irq.h> */
#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;
}

View File

@ -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 <board-name>/<config-dir>

View File

@ -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;
}