The rabbitDev project aims at providing a complete freeware development environment
for the Z-World rabbit core modules. This will include a cross compiler based on sdcc
and the asxxxx assembler and linker package.
For both packages a Z80 port existed which has to be adapted to the rabbit. Most
assembly instructions are identical between the rabbit and the Z80 but the rabbit
implements a number of extensions and also omits some of the less often used Z80
instructions. In particular the rabbit has an MMU on chip which requires particular
attention when porting the compiler/assmbler/linker chain.
On the rabbit itself a BIOS (Basic I/O System) is needed, giving access to
the core module's functionalities. These include the rabbit's I/O capabilities but
also the external flash memory and network controller.
On top of the BIOS a realtime kernel and a TCP/IP stack will all the relevant network
protocols is needed.
BIOS and the monitor
In order to run any program on the rabbit core module it must be loaded at least once
in either RAM or the flash memory. This can be done through the rabbits serial port
during bootload of the system. After reset the rabbit starts reading address/data pairs
(2 byte address, 1 byte data) that can be used to program the internal rabbit I/O
registers (highest significant address bit = 1) or 32 kBytes of RAM memory.
We use this feature in order to download a simple assembly language
debug monitor containing the necessary BIOS routines as well. The monitor must be sent
in a binary format compatible with the bootload protocol. First a hand written file
containg I/O register initialisation called "rabbit_boot.bin" is downloaded, followed
by the monitor itself which must be transformed into the binary format before download.
Bringing the system up
In order to execute a program on the rabbit, the minimum you need is
Let's start with the downloader and the S-record to rabbit binary converter. Go to the subdirectory
pc_src compile these 2 programs typing "make". You should get
- the assembler and linker
- a program to convert Motorola S-records to a format compatible with the rabbit bootload
- the bootloader
- the program to be downloaded
Put those 2 programs into a directory which is part of your execution path.
In pc_src you will also find a file named "rabbit_boot.bin" which contains the rabbits initial
I/O register settings:
- load_rabbit: the boot loader
- and s19_2_bin: the converter program.
8014 05 ; MB0CR = 5 to select RAM
8009 51 ; WTDCR Prime watchdog
8009 54 ; WTDCR disable watchdog
800f 07 ; GCDR Clock doubler
8000 08 ; processor and peripheral clocks undivided
8075 7d ; PEFR bit 1 and 7 are normal I/O
8077 82 ; PEDDR bit 1 and 7 output
8070 ff ; turn all LEDs off
8024 04 ; port a output
The downloader must be able to find this program which is accomplished by setting the environment
variable RABBIT_BINARIES to the name of the directory where the file can be found. In order to ease the usage of those two programs they must be
integrated into seyon, a telecommunication program. You may use a minicom or any other such
program but you will have to do the integration of load_rabbit into
these programs yourself.
used to talk to the rabbit.
Now we need at least the assembler and linker in order to produce a rabbit binary:
Go to the subdirectory pc_src/cross-software/asrab where you will find the assembler and linker
sources. Make them and install asrab and aslink into a directory seen by your execution path.
Now we have the basic tools needed to produce rabbit programs.
The first program that will be downloaded to the rabbit is the BIOS and
debug monitor. Go to the subdirectory rabbit_src/monitor and make
the program in there. You will end up with a file called monitor.bin
containing the (readable with an ascii editor) binary code, ready for download.
should do the trick. It is however easier to simply push the bootload
button in seyon. Once the download is finished (takes a few minutes) you
should see the monitor prompt in seyon. Now you are in business.