2008-01-01 00:52:53 +01:00
|
|
|
z80sim README
|
|
|
|
^^^^^^^^^^^^^
|
2007-12-29 02:05:26 +01:00
|
|
|
|
2008-01-01 00:52:53 +01:00
|
|
|
This port uses a primitive, emulated Z80 and the SDCC toolchain.
|
2015-08-16 18:59:35 +02:00
|
|
|
This port uses an instruction set simulator called z80sim.
|
2007-12-29 02:05:26 +01:00
|
|
|
|
|
|
|
The SDCC toolchain is available from http://sdcc.sourceforge.net/. All
|
2008-02-07 15:41:11 +01:00
|
|
|
testing has been performed using version 2.6.0 of the SDCC toolchain.
|
2007-12-29 02:05:26 +01:00
|
|
|
|
2012-01-06 20:29:37 +01:00
|
|
|
Contents
|
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
o Configuring NuttX
|
2012-12-07 23:02:51 +01:00
|
|
|
o Reconfiguring NuttX
|
2018-06-01 21:25:50 +02:00
|
|
|
o Reconfiguring for Windows Native, Cygwin, or macOS
|
2012-12-03 15:13:23 +01:00
|
|
|
o SDCC
|
2012-01-06 20:29:37 +01:00
|
|
|
o Building the SDCC toolchain
|
|
|
|
|
2008-01-01 00:52:53 +01:00
|
|
|
Configuring NuttX
|
|
|
|
^^^^^^^^^^^^^^^^^
|
|
|
|
|
2008-02-07 02:39:20 +01:00
|
|
|
ostest
|
2012-12-03 15:13:23 +01:00
|
|
|
|
2008-02-07 02:39:20 +01:00
|
|
|
This configuration performs a simple, minimal OS test using
|
2017-04-26 18:12:13 +02:00
|
|
|
examples/ostest. This can be configured as follows:
|
2008-01-01 00:52:53 +01:00
|
|
|
|
2012-12-08 22:31:43 +01:00
|
|
|
1) From a POSIX window:
|
2017-10-01 22:56:54 +02:00
|
|
|
|
|
|
|
tools/configure.sh [OPTIONS] z80sim/ostest
|
|
|
|
|
|
|
|
where you need to select the right [OPTIONS] for your build
|
|
|
|
environment. Do:
|
|
|
|
|
|
|
|
tools/configure.sh -h
|
|
|
|
|
|
|
|
to see the options.
|
|
|
|
|
2017-04-26 18:12:13 +02:00
|
|
|
2) Make sure that your PATH environment variable includes the path
|
|
|
|
to the SDCC toolchain.
|
2008-01-01 00:52:53 +01:00
|
|
|
|
2017-10-01 22:56:54 +02:00
|
|
|
|
|
|
|
3) Then build the binaries:
|
|
|
|
|
|
|
|
make
|
|
|
|
|
2012-12-03 16:33:24 +01:00
|
|
|
NOTES:
|
|
|
|
|
2012-12-07 23:02:51 +01:00
|
|
|
1. This configuration uses the mconf-based configuration tool. See the
|
|
|
|
"Reconfiguring" section below for information about changing this
|
|
|
|
configuration.
|
2012-12-03 16:33:24 +01:00
|
|
|
|
2017-10-01 22:24:57 +02:00
|
|
|
2. The default setup for this configuration builds under Linux.
|
|
|
|
See the section entitled "Reconfiguring for Windows Native, Cygwin,
|
2018-06-01 21:25:50 +02:00
|
|
|
or macOS" which will give you the steps you would need to do to convert
|
2017-10-01 22:24:57 +02:00
|
|
|
this configuration to build in other environments.
|
2012-12-03 21:12:59 +01:00
|
|
|
|
2012-12-07 23:02:51 +01:00
|
|
|
3. This configuration was last verified sucessfully prior to the
|
2012-12-03 21:12:59 +01:00
|
|
|
the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run
|
2012-12-08 22:31:43 +01:00
|
|
|
natively under Cygwin. The current build requires ca. 3.2.1 SDCC.
|
2012-12-03 21:12:59 +01:00
|
|
|
|
2008-02-07 02:39:20 +01:00
|
|
|
nsh
|
2012-12-03 15:13:23 +01:00
|
|
|
|
2008-01-02 15:17:02 +01:00
|
|
|
This configuration file builds NSH (examples/nsh). This
|
|
|
|
configuration is not functional due to issues with use of the
|
|
|
|
simulated serial driver (see the TODO list).
|
2008-01-01 00:52:53 +01:00
|
|
|
|
2008-02-07 02:39:20 +01:00
|
|
|
This configuration can be selected by:
|
2008-01-01 00:52:53 +01:00
|
|
|
|
2012-12-08 22:31:43 +01:00
|
|
|
1) From a POSIX window:
|
2017-10-01 22:56:54 +02:00
|
|
|
|
|
|
|
tools/configure.sh [OPTIONS] z80sim/nsh
|
|
|
|
|
|
|
|
where you need to select the right [OPTIONS] for your build
|
|
|
|
environment. Do:
|
|
|
|
|
|
|
|
tools/configure.sh -h
|
|
|
|
|
|
|
|
to see the options.
|
|
|
|
|
2017-04-26 18:12:13 +02:00
|
|
|
2) Set the PATH environment variable to include the path to the SDCC
|
|
|
|
toolchain.
|
2008-02-07 02:39:20 +01:00
|
|
|
|
2017-10-01 22:56:54 +02:00
|
|
|
|
|
|
|
3) Then build the binaries:
|
|
|
|
|
|
|
|
make
|
|
|
|
|
2012-12-07 23:02:51 +01:00
|
|
|
NOTES:
|
|
|
|
|
|
|
|
1. This configuration uses the mconf-based configuration tool. See the
|
|
|
|
"Reconfiguring" section below for information about changing this
|
|
|
|
configuration.
|
|
|
|
|
|
|
|
2. The default setup for this configuration uses a windows native build.
|
2017-10-01 22:24:57 +02:00
|
|
|
See the section entitled "Reconfiguring for Windows Native, Cygwin,
|
2018-06-01 21:25:50 +02:00
|
|
|
or macOS" which will give you the steps you would need to do to convert
|
2017-10-01 22:24:57 +02:00
|
|
|
this configuration to build in other environments.
|
2012-12-07 23:02:51 +01:00
|
|
|
|
|
|
|
3. This configuration was last verified sucessfully prior to the
|
|
|
|
the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run
|
2012-12-08 22:31:43 +01:00
|
|
|
natively under Cygwin.nsh/defconfig:CONFIG_BOARD_LOOPSPERMSEC
|
2012-12-07 23:02:51 +01:00
|
|
|
|
|
|
|
pashello
|
2012-12-03 15:13:23 +01:00
|
|
|
|
2008-02-07 02:39:20 +01:00
|
|
|
Configures to use examples/pashello for execution from FLASH
|
|
|
|
See examples/README.txt for information about pashello.
|
|
|
|
|
|
|
|
This configuration is not usable because the resulting binary
|
|
|
|
is too large for the z80 address space.
|
2008-01-01 00:52:53 +01:00
|
|
|
|
2008-02-07 02:39:20 +01:00
|
|
|
This configuration can be selected by:
|
|
|
|
|
2012-12-08 22:31:43 +01:00
|
|
|
1) From a POSIX window:
|
2017-10-01 22:56:54 +02:00
|
|
|
|
|
|
|
tools/configure.sh [OPTIONS] z80sim/pashello
|
|
|
|
|
|
|
|
where you need to select the right [OPTIONS] for your build
|
|
|
|
environment. Do:
|
|
|
|
|
|
|
|
tools/configure.sh -h
|
|
|
|
|
|
|
|
to see the options.
|
|
|
|
|
2017-04-26 18:12:13 +02:00
|
|
|
2) Set the PATH environment variable to include the path to the SDCC
|
2017-09-30 23:28:04 +02:00
|
|
|
toolchain binaries.
|
2008-01-01 00:52:53 +01:00
|
|
|
|
2017-10-01 22:56:54 +02:00
|
|
|
3) Then build the binaries:
|
|
|
|
|
|
|
|
make
|
|
|
|
|
2012-12-07 23:02:51 +01:00
|
|
|
NOTES:
|
|
|
|
|
|
|
|
1. This configuration uses the mconf-based configuration tool. See the
|
|
|
|
"Reconfiguring" section below for information about changing this
|
|
|
|
configuration.
|
|
|
|
|
|
|
|
2. The default setup for this configuration uses a windows native build.
|
2017-10-01 22:24:57 +02:00
|
|
|
See the section entitled "Reconfiguring for Windows Native, Cygwin,
|
2018-06-01 21:25:50 +02:00
|
|
|
or macOS" which will give you the steps you would need to do to convert
|
2017-10-01 22:24:57 +02:00
|
|
|
this configuration to build in other environments.
|
2012-12-07 23:02:51 +01:00
|
|
|
|
|
|
|
3. This configuration was last verified sucessfully prior to the
|
|
|
|
the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run
|
2012-12-08 22:31:43 +01:00
|
|
|
natively under Cygwin.nsh/defconfig:CONFIG_BOARD_LOOPSPERMSEC
|
2012-12-07 23:02:51 +01:00
|
|
|
|
|
|
|
Reconfiguring NuttX
|
|
|
|
^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
These configurations all use the kconfig-frontends, mconf-based configuration
|
|
|
|
tool. To change this configuration using that tool, you should:
|
|
|
|
|
2013-01-09 13:55:13 +01:00
|
|
|
a. Build and install the kconfig-mconf tool. See nuttx/README.txt and
|
2015-06-28 16:08:57 +02:00
|
|
|
additional README.txt files in the NuttX tools repository.
|
2012-12-07 23:02:51 +01:00
|
|
|
|
|
|
|
b. Execute 'make menuconfig' in nuttx/ in order to start the reconfiguration
|
|
|
|
process.
|
|
|
|
|
2018-06-01 21:25:50 +02:00
|
|
|
Reconfiguring for Windows Native, Cygwin, or macOS
|
2017-10-01 22:24:57 +02:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2012-12-07 23:02:51 +01:00
|
|
|
|
2017-10-01 22:24:57 +02:00
|
|
|
All of the z80 configurations in this this directory are set up to build
|
|
|
|
under Linux. That configuration can be converted to run natively in a
|
|
|
|
Windows CMD.exe shell. That configuration requires the MinGW host compiler
|
|
|
|
and several GNUWin32 tools (see discussion in the top-level NuttX/README.txt
|
|
|
|
file) and the following changes to the configuation file:
|
2012-12-07 23:02:51 +01:00
|
|
|
|
2017-10-01 22:24:57 +02:00
|
|
|
-CONFIG_HOST_LINUX=y
|
|
|
|
+CONFIG_HOST_WINDOWS=y
|
|
|
|
+CONFIG_WINDOWS_NATIVE=y
|
2014-04-14 00:22:22 +02:00
|
|
|
|
2017-10-01 22:24:57 +02:00
|
|
|
-CONFIG_Z80_TOOLCHAIN_SDCCL=y
|
|
|
|
+CONFIG_Z80_TOOLCHAIN_SDCCW=y
|
2012-12-07 23:02:51 +01:00
|
|
|
|
2017-10-01 22:24:57 +02:00
|
|
|
You may need to first manually change the CONFIG_APPS_DIR="../apps"
|
|
|
|
definition in the .config file because the forward slash may upset some
|
|
|
|
Windows-based tools.
|
2012-12-07 23:02:51 +01:00
|
|
|
|
2012-12-09 00:21:34 +01:00
|
|
|
This configuration will require a recent version of SDCC (ca. 3.2.1) for Linux
|
|
|
|
or custom built for Cygwin (see below).
|
|
|
|
|
2012-12-03 15:13:23 +01:00
|
|
|
SDCC
|
|
|
|
^^^^
|
|
|
|
|
|
|
|
These z80 configurations all use the SDCC toolchain (http://sdcc.sourceforge.net/).
|
|
|
|
Source and pre-built SDCC binaries can be downloaded from the SDCC SourceForge
|
|
|
|
site: http://sourceforge.net/projects/sdcc/files/ . Pre-built binaries are
|
2018-06-01 21:25:50 +02:00
|
|
|
available for Linux, macOS, and for Win32. Various SDCC options can be
|
2012-12-03 15:13:23 +01:00
|
|
|
selected with:
|
|
|
|
|
2018-06-01 21:25:50 +02:00
|
|
|
CONFIG_Z80_TOOLCHAIN_SDCCL=y : SDCC for Linux, macOS or Cygwin (see below)
|
2012-12-03 16:33:24 +01:00
|
|
|
CONFIG_Z80_TOOLCHAIN_SDCCW=y : SDCC for Win32
|
2012-12-03 15:13:23 +01:00
|
|
|
|
2012-12-07 20:02:57 +01:00
|
|
|
SDCC versions 3.2.0 or higher are recommended.
|
|
|
|
|
2007-12-29 02:05:26 +01:00
|
|
|
Building the SDCC toolchain
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2012-12-03 15:13:23 +01:00
|
|
|
You may also want to build your own SDCC toolchain. You might want to do this,
|
|
|
|
for example, if you are running under Cygwin and want a Cygwin compatible
|
|
|
|
SDCC toolchain.
|
|
|
|
|
2007-12-29 02:05:26 +01:00
|
|
|
The SDCC toolchain is built with the standard configure/make/make install
|
|
|
|
sequence. However, some special actions are required to generate libraries
|
|
|
|
compatible with this build. First start with the usual steps
|
|
|
|
|
|
|
|
download
|
|
|
|
unpack
|
|
|
|
cd sdcc
|
|
|
|
./configure
|
2007-12-31 00:34:20 +01:00
|
|
|
|
2017-09-30 23:28:04 +02:00
|
|
|
Note if you do not have the gputils packet installed, newer version of the
|
|
|
|
SDCC configure will fail. You will have to either install the gputils
|
|
|
|
package or if you don't need PIC14 or PIC16 support:
|
|
|
|
|
|
|
|
./configure --disable-pic14-port --disable-pic16-port
|
|
|
|
|
2007-12-31 00:34:20 +01:00
|
|
|
Then make the SDCC binaries
|
|
|
|
|
2007-12-29 02:05:26 +01:00
|
|
|
make
|
2007-12-31 00:34:20 +01:00
|
|
|
|
|
|
|
and install SDCC:
|
|
|
|
|
|
|
|
sudo make install
|
2009-11-07 01:03:22 +01:00
|
|
|
|