Updates to handle the tranZPUter SW v2.2 on the MZ800
This commit is contained in:
1000
APPS_README.md
Normal file
1000
APPS_README.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,3 @@
|
||||
<br>
|
||||
### Using IOCP
|
||||
|
||||
The I/O Control Program (IOCP) is basically a bootloader, it can operate standalone or as the first stage in booting an application. Depending on the configuration it can provide a low level monitor via the serail
|
||||
@@ -70,21 +69,22 @@ really should be coded in Python or Java, but it works for now in building this
|
||||
|
||||
For ease of reading, the following shortnames refer to the corresponding path in this chapter.
|
||||
|
||||
| Short Name | |
|
||||
|------------------|----------------------------------------------------------------------------|
|
||||
| \[\<ABS PATH>\] | The path where this repository was extracted on your system. |
|
||||
| \<apps\> | \[\<ABS PATH>\]/zsoft/apps |
|
||||
| \<common\> | \[\<ABS PATH>\]/zsoft/common |
|
||||
| \<libraries\> | \[\<ABS PATH>\]/zsoft/libraries |
|
||||
| \<teensy3\> | \[\<ABS PATH>\]/zsoft/teensy3 |
|
||||
| \<include\> | \[\<ABS PATH>\]/zsoft/include |
|
||||
| \<startup\> | \[\<ABS PATH>\]/zsoft/startup |
|
||||
| \<iocp\> | \[\<ABS PATH>\]/zsoft/iocp |
|
||||
| \<zOS\> | \[\<ABS PATH>\]/zsoft/zOS |
|
||||
| \<zputa\> | \[\<ABS PATH>\]/zsoft/zputa |
|
||||
| \<rtl\> | \[\<ABS PATH>\]/zsoft/rtl |
|
||||
| \<docs\> | \[\<ABS PATH>\]/zsoft/docs |
|
||||
| \<tools\> | \[\<ABS PATH>\]/zsoft/tools |
|
||||
| Short Name | Path | Description |
|
||||
|------------------|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
|
||||
| \[\<ABS PATH>\] | The path where this repository was extracted on your system. | |
|
||||
| \<apps\> | \[\<ABS PATH>\]/zsoft/apps | Application directory. All zOS/ZPUTA applications are located here along with their makefiles. |
|
||||
| \<build\> | \[\<ABS PATH>\]/zsoft/build | A target output directory for the compiled software, ie. \<z-build\>/SD contains all files to be written to an SD card. |
|
||||
| \<common\> | \[\<ABS PATH>\]/zsoft/common | Common C/C++ methods which are not assembled into a library. |
|
||||
| \<libraries\> | \[\<ABS PATH>\]/zsoft/libraries | C/C++ libraries, usually part of a C/C++ installation but for embedded work, especially on the ZPU need to be created seperately. | |
|
||||
| \<teensy3\> | \[\<ABS PATH>\]/zsoft/teensy3 | The K64F based Teensy 3.5 software, some of which is used in the K64F version of zOS. Very rich libraries and can be easily added into a K64F programs. | |
|
||||
| \<include\> | \[\<ABS PATH>\]/zsoft/include | Common include header files. | |
|
||||
| \<startup\> | \[\<ABS PATH>\]/zsoft/startup | Embedded processor startup files, generally in Assembler. Templates and macros are used to create the correct targets memory model startup code. | |
|
||||
| \<iocp\> | \[\<ABS PATH>\]/zsoft/iocp | The IO Control Program, my initial bootloader for bootstrapping an application on the ZPU. | |
|
||||
| \<zOS\> | \[\<ABS PATH>\]/zsoft/zOS | The zOS source code, parameterised for the different target CPU's. | |
|
||||
| \<zputa\> | \[\<ABS PATH>\]/zsoft/zputa | The ZPUTA source code, parameterised for the different target CPU's. | |
|
||||
| \<rtl\> | \[\<ABS PATH>\]/zsoft/rtl | Register Transfer Level files. These are generated memory definition and initialisation files required when building for a ZPU target project. | |
|
||||
| \<docs\> | \[\<ABS PATH>\]/zsoft/docs | Any relevant documentation for the software. | |
|
||||
| \<tools\> | \[\<ABS PATH>\]/zsoft/tools | Tools to aid in the compilation and creation of target files. |
|
||||
|
||||
|
||||
## Tools
|
||||
@@ -128,15 +128,15 @@ The software is organised into the following tree/folders:
|
||||
IOCP is built using the 'build.sh' script. This script encapsulates the Makefile system with it's plethora of flags and options. The synopsis of the script is below:
|
||||
```bash
|
||||
NAME
|
||||
build.sh - Shell script to build a ZPU program or OS.
|
||||
build.sh - Shell script to build a ZPU/K64F program or OS.
|
||||
|
||||
SYNOPSIS
|
||||
build.sh [-CIOoMBAsdxh]
|
||||
build.sh [-CIOoMBAsTZdxh]
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
OPTIONS
|
||||
-C <CPU> = Small, Medium, Flex, Evo, K64F - defaults to Evo.
|
||||
-C <CPU> = Small, Medium, Flex, Evo, EvoMin, K64F - defaults to Evo.
|
||||
-I <iocp ver> = 0 - Full, 1 - Medium, 2 - Minimum, 3 - Tiny (bootstrap only)
|
||||
-O <os> = zputa, zos
|
||||
-o <os ver> = 0 - Standalone, 1 - As app with IOCP Bootloader,
|
||||
@@ -150,6 +150,8 @@ OPTIONS
|
||||
-s <size> = Required size of application stack
|
||||
-a <size> = Maximum size of an app, defaults to (BRAM SIZE - App Start Address - Stack Size)
|
||||
if the App Start is located within BRAM otherwise defaults to 0x10000.
|
||||
-T = TranZPUter specific build, adds initialisation and setup code.
|
||||
-Z = Sharp MZ series ZPU build, zOS runs as an OS host on Sharp MZ hardware.
|
||||
-d = Debug mode.
|
||||
-x = Shell trace mode.
|
||||
-h = This help screen.
|
||||
@@ -179,6 +181,8 @@ Sensible defaults are configured into the script, the overriding flags are descr
|
||||
| -S \<size\> | Required size of stack. Normally the \<os\> manages the stack which is also used by an application. If the application is considered dangerous then it should be allocated a local stack. |
|
||||
| -s \<size\> | Required size of application stack. Normally this should not be required as the application shares the \<os\> stack. If the application is dangerous then set this value to allocate a local stack. |
|
||||
| -a \<size\> | Maximum size of an application.<br>*defaults to (BRAM SIZE - App Start Address - Stack Size) for the ZPU if the App Start is located within BRAM otherwise defaults to 0x10000, or 0x20030000 - Stack Size - Heap Size - 0x4000 for the K64F. If the App Start is located within BRAM otherwise defaults to 0x10000.* |
|
||||
| -T | TranZPUter specific build, adds initialisation and setup code. Build as an embedded OS for the tranZPUter board. |
|
||||
| -Z | Sharp MZ series ZPU build, zOS runs as an OS host on Sharp MZ hardware. Build as a host OS for the Sharp MZ series computer running a ZPU/NIOSII as the host processor. |
|
||||
| -d | Debug mode. Enable more verbose output on state and decisions made by the script. |
|
||||
| -x | Shell trace mode. A very low level, line by line trace of shell execution. Only used during debugging. |
|
||||
| -h | This help screen. |
|
||||
|
||||
373
ZOS_README.md
373
ZOS_README.md
@@ -1,46 +1,71 @@
|
||||
<br>
|
||||
|
||||
### zOS
|
||||
|
||||
<div style="text-align: justify">
|
||||
zOS is a spin-off from the ZPUTA test application which was created to verify ZPU Evo and SoC operations. ZPUTA evolved as different FPGA's were included in the ZPU Evo scope and it became
|
||||
clear that it had to be more advanced due to limited resources. Once ZPUTA had evolved into something of a level of sophistication akin to an OS, it was split and zOS was born.
|
||||
<br><br>
|
||||
|
||||
Originally the ZPUTA/zOS developments only targetted the ZPU architecture and they had two primary methods of execution:
|
||||
</div>
|
||||
|
||||
* as an application booted by IOCP,
|
||||
* standalone booted as the ZPU Evo startup firmware.
|
||||
|
||||
The mode is chosen in the configuration and functionality is identical. When booted as an application by IOCP, zOS is stored on an SD card and loaded at boot time. When 'standalone'
|
||||
zOS is stored in the onboard Flash (or preconfigure BRAM acting as ROM).
|
||||
<div style="text-align: justify">
|
||||
The startup mode is chosen in the configuration and functionality is identical. When booted as an application by IOCP, zOS is stored on an SD card and loaded at boot time. When 'standalone'
|
||||
zOS is stored in the onboard Flash (or preconfigured BRAM acting as a ROM).
|
||||
<br><br>
|
||||
|
||||
More recently, zOS was ported to the ARM Cortex-M4 architecture for use with the Freescale K64F on the tranZPUterSW project. As the K64F is a fixed architecture CPU / SoC only one
|
||||
method of execution exists, 'standalone', it is stored in the onboard Flash and started when the CPU powers up.
|
||||
<br><br>
|
||||
|
||||
In zOS, all non-OS functionality is stored as applications on an SD Card. If an SD Card isnt present then it is better to use ZPUTA as it has the ability to cater for limited FPGA BRAM
|
||||
resources as all functionality of ZPUTA can be enabled/disabled within the primary loaded image.
|
||||
<br><br>
|
||||
|
||||
To operate, zOS requires a serial connection (physical or usb-virtual) with preferably an ANSI/VT100 terminal emulator package connected to it. The requirement for an ANSI/VT100 terminal
|
||||
Originally zOS only operated with a Terminal Emulator via a serial line, but with the advent of the tranZPUter SW-700, zOS now To operate,
|
||||
|
||||
zOS requires a serial connection (physical or usb-virtual) with preferably an ANSI/VT100 terminal emulator package connected to it. The requirement for an ANSI/VT100 terminal
|
||||
emulation package is to allow commands such as the editor or readline to function correctly. A dumb serial terminal will work fine but at reduced application functionality. If no serial
|
||||
connection is available or an interactive OS is not needed, just the ability to boot an application on power up, then the IOCP would be the better choice (albeit not yet ported to the K64F).
|
||||
<br><br>
|
||||
|
||||
A recent hardware development, the tranZPUter SW-700 v1.3 sees zOS operating as a host OS where the keyboard and display are under its direct control. In order to maintain backward compatibility
|
||||
with the serial based applications, an ANSI terminal emulator has been developed and embedded.
|
||||
</div>
|
||||
|
||||
## Using the OS
|
||||
|
||||
<div style="text-align: justify">
|
||||
Throughout my career I have used or designed systems where you had live interaction with the end product to either monitor, change the logic flow according to market changes or fix problems
|
||||
real-time. This has normally been through an embedded command processor using the TCP client-server interconnect. The benefits of this approach are enormous and done correctly mitigate
|
||||
security risks. Companies such as Reuters and TibCO use this technique (ie. their 'Hawk' product) and I have crafted it into my own developments such as the trade execution and pricing module
|
||||
I wrote at Morgan Stanley and the Options trading system at Chase Manhattan with great effect.
|
||||
<br><br>
|
||||
|
||||
When working on some of my projects in this repository it has always been at the forefront of my thoughts that I wanted a similar environment, even on an embedded system with limited
|
||||
resources, where I could monitor, change or fix on the fly. This thought started off with the IOCP which has basic monitoring, uploading and execution functionality and was further
|
||||
enhanced when I started writing ZPUTA with its enhanced functionality and external applications. Time scheduling, at least a basic level will soon be implemented which will allow an embedded
|
||||
application driving the hardware to run as required yet still leave processing resource to run the OS and provide services to a connected user/developer. The projects dont have a network
|
||||
stack as most dev boards I've used dont have ethernet which limites connectivity to the serial line. The advantage of asynchronous serial communications is it is simple and can be connected
|
||||
to a terminal on nearly every PC, either direct via a USB adapter or via RS-232. I could implement SLIP but keeping it simple at this level is my preferred alternative. So long as you can
|
||||
connect a serial line between the dev board hosting zOS and a PC you can use it's functionality.
|
||||
resources, where I could monitor, change or fix on the fly. This requirement started off with the IOCP which has basic monitoring, uploading and execution functionality and was further enhanced
|
||||
when I started writing ZPUTA with its enhanced functionality and external applications.
|
||||
<br><br>
|
||||
|
||||
Time scheduling, at least a basic level will soon be implemented which will allow an embedded application driving the hardware to run as required yet still leave processing resource to run the OS
|
||||
and provide services to a connected user/developer. The K64F version of zOS uses threads for tranZPUter board control but this needs to be encapsulated in defined API's and made available on the
|
||||
ZPU and NIOS II architectures.
|
||||
<br><br>
|
||||
|
||||
The projects dont have a network stack as most dev boards I've used dont have ethernet which limits connectivity to the serial line. I'm considering adding an ESP32 module onto future tranZPUter
|
||||
cards and so networking will remain under consideration until this addition is realised.
|
||||
<br><br>
|
||||
|
||||
The advantage of asynchronous serial communications is it is simple and can be connected to a terminal on nearly every PC, either direct via a USB adapter or via RS-232. I could implement SLIP
|
||||
but keeping it simple at this level is my preferred alternative. So long as you can connect a serial line between the dev board hosting zOS and a PC you can use it's functionality.
|
||||
<br><br>
|
||||
|
||||
The OS interface has been written keeping in mind that only a serial text based terminal is available. Some components such as the Editor need more advanced capabilities and to this end
|
||||
the venerable VT100 emulation was chosen as a suitable candidate (which means you need a VT100 emulator sat in front of the serial line in order to use the Editor). Interaction is keyboard
|
||||
the venerable VT100/ANSI emulation was chosen as a suitable candidate (which means you need a VT100/ANSI emulator sat in front of the serial line in order to use the Editor). Interaction is keyboard
|
||||
and text based, (no nice GUI interfaces!) with the sections below providing information needed to use the interface.
|
||||
</div>
|
||||
|
||||
|
||||
### Command Line
|
||||
@@ -49,10 +74,15 @@ The first introduction to the OS is a sign-on message which details the CPU, ver
|
||||
|
||||

|
||||
|
||||
Interaction with the OS is no different than say MSDOS, you enter a command and get a response. The only difference is that it is within an embedded system not a full blown PC.
|
||||
<div style="text-align: justify">
|
||||
Interaction with the OS is no different than MSDOS, you enter a command and get a response. The only difference is that it was originally within an embedded system not a full blown PC. This is now
|
||||
changing as zOS is evolving to work as a User OS on the Sharp MZ-700 under the ZPU/NIOSII processor.
|
||||
<br><br>
|
||||
|
||||
The zOS command line is not a shell interpreter just a basic text interface provided for the issuing of built-in commands or commands stored on the SD card. It does include a cutdown readline
|
||||
capability with history to aid in command entering and retrieval and generally follows the GNU readline functionality, the recognised keys at the command line are:
|
||||
</div>
|
||||
<br>
|
||||
|
||||
| Key | Action |
|
||||
| --- | ------- |
|
||||
@@ -87,8 +117,10 @@ The readline mechanism also recognises a few internal commands, namely:
|
||||
|
||||
### Applications
|
||||
|
||||
<div style="text-align: justify">
|
||||
The applications currently provided by zOS reside on an SD card and are summarised below. For more detailed information
|
||||
please refer to the Application section (on the left navigation bar) or the Application README file.
|
||||
</div>
|
||||
|
||||
- #### Disk IO Commands
|
||||
|
||||
@@ -199,19 +231,35 @@ please refer to the Application section (on the left navigation bar) or the Appl
|
||||
| mbasic | \[\<file\>\] | Interactive Mini-Basic Interpreter. |
|
||||
| tbasic | | Interactive tiny Basic Interpreter. |
|
||||
|
||||
- #### tranZPUter Commands
|
||||
|
||||
| Command | Parameters | Description |
|
||||
| ------- | ---------- | ----------------------------------------------- |
|
||||
| tzload | See apps section for full list. | Upload and Download files to the tranZPUter memory, grab a video frame or set a new frame. |
|
||||
| tzdump | See apps section for full list. | Dump tranZPUter memory to screen. |
|
||||
| tzclear | See apps section for full list. | Clear tranZPUter memory. |
|
||||
| tzclk | See apps section for full list. | Set the Z80 alternative CPU frequency. |
|
||||
| tzreset | See apps section for full list. | Reset the tranZPUter. |
|
||||
| tzio | See apps section for full list. | Z80 I/O Port read/write tool. |
|
||||
| tzflupd | See apps section for full list. | K64F FlashRAM update tool. Update the running zOS/ZPUTA kernel with a later version. |
|
||||
|
||||
|
||||
All commands with a (*) are built in to zOS.
|
||||
|
||||
*autoexec.bat*
|
||||
--------------
|
||||
|
||||
<div style="text-align: justify">
|
||||
As per MSDOS, if a file of name 'AUTOEXEC.BAT' is created in the root directory (top level) of the SD filesystem the contents will be executed on zOS at boot/reset. Use this file to automate
|
||||
setup and startup of your intended application. It currently has no in-built language, just issuing of commands.
|
||||
</div>
|
||||
|
||||
|
||||
## Technical Detail
|
||||
|
||||
<div style="text-align: justify">
|
||||
This section aims to provide some of the inner detail of the operating system to date. A lot of this information is the same in ZPUTA but as zOS matures it will start to have significant differences.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
### Memory Organisation
|
||||
@@ -219,19 +267,25 @@ This section aims to provide some of the inner detail of the operating system to
|
||||
|
||||
##### IOCP Memory Map
|
||||
|
||||
<div style="text-align: justify">
|
||||
zOS is generally used in it's 'standalone' guise, ie the OS boots up as the primary firmware. For backward compatibility or to aid in more rapid development of zOS on the ZPU, IOCP
|
||||
can be used as the bootloaded. Depending upon the memory model of IOCP used, the currently defined memory maps for IOCP are as follows:-
|
||||
can be used as the bootloader to bootstrap a zOS image from SD card. Depending upon the memory model required, IOCP can be used with the following defined memory maps:-
|
||||
</div>
|
||||
|
||||

|
||||
|
||||
zOS is loaded from the SD card by IOCP and resides typically 0x1000 bytes further in memory as opposed to when zOS is the boot firmware. At time of writing, IOCP can only be used
|
||||
with the ZPU as it has not been ported to the K64F architecture.
|
||||
<div style="text-align: justify">
|
||||
In all of these models, zOS is loaded from the SD card by IOCP and typically resides 0x1000-0x3000 bytes further in memory as opposed to when zOS is the boot firmware. At time of writing,
|
||||
IOCP can only be used with the ZPU as it has not been ported to the K64F architecture.
|
||||
</div>
|
||||
|
||||
|
||||
##### zOS Memory Map
|
||||
|
||||
<div style="text-align: justify">
|
||||
zOS running on the ZPU has the memory usage map as per the diagram below. zOS resides in lower BRAM as the boot firmware with Stack/Heap at the top of useable BRAM (or RAM/SDRAM). An
|
||||
application is loaded at the defined load point in the build script which would typically be the start of RAM/SDRAM or BRAM if the FPGA is sufficiently large.
|
||||
application is loaded at the address defined in the build script which would typically be the start of RAM/SDRAM or BRAM if the FPGA is sufficiently large.
|
||||
</div>
|
||||
|
||||

|
||||
|
||||
@@ -247,96 +301,137 @@ The memory usage map for the K64F processor is similar but Flash RAM and RAM are
|
||||
As per most operating systems, zOS provides an API which a suitably compiled application can use to decrease it's size and complexity and reuse features within the OS such as the serial line
|
||||
connectivity.
|
||||
|
||||
Rather than designing a custom API set of methods, it made more sense to expose methods within zOS to the application, ie. xprintf. An application calling xprintf to display output on the
|
||||
terminal will actually be calling xprintf within zOS. This is made possible by creating a jump table at a fixed vector within zOS. An application is then compiled with a set of macros to
|
||||
convert calls to xprintf to jumps into the zOS vector table.
|
||||
Rather than designing a custom API set of methods, it made more sense to expose methods within zOS to the application, ie. printf. An application calling printf to display output on the
|
||||
terminal will actually be calling printf within zOS. This is made possible by creating a jump table at a fixed vector within zOS. An application is then compiled with a set of macros to
|
||||
convert calls to printf to jumps into the zOS vector table.
|
||||
|
||||
At the moment, these API methods are exposed:
|
||||
|
||||
| Vector No | Method | Prototype | Description |
|
||||
| --------- | ------ | --------- | ----------- |
|
||||
| 000 | _break | Break handler. | When a breakpoint instruction is encountered, method to handle it. |
|
||||
| 001 | _putchar | void putchar(char c) | Send a single character at the lowest level to serial output device. |
|
||||
| 002 | xputc | void xputc (char c) | Normal method to write a single character to the output stream. |
|
||||
| 003 | xfputc | void xfputc (void (*func)(unsigned char), char c) | Write a character to the specified output device or stream. |
|
||||
| 004 | xputs | void xputs (const char* str) | Put a string onto the output stream. |
|
||||
| 005 | xgets | int xgets (char* buff, int len) | Get a string from the input stream. |
|
||||
| 006 | xfgets | int xfgets (unsigned char (*func)(void), char* buff, int len) | Get a string from the specified input device or stream. |
|
||||
| 007 | xfputs | void xfputs (void (*func)(unsigned char), const char* str) | Put a string onto the specified output device or stream. |
|
||||
| 008 | xatoi | int xatoi (char** str, long* res) | Convert a string into a long. String can be any format or base. |
|
||||
| 009 | uxatoi | int uxatoi(char **, uint32_t *) | Convert a string into an unsigned 32bit. String can be any format or base. |
|
||||
| 010 | xprintf | void xprintf (const char* fmt, ...) | Print a formatted string onto the output stream. Floating point is not supported. |
|
||||
| 011 | xvprintf | void xvprintf (const char*, va_list ) | Print a varargs formatted string onto the output stream. Floating point is not supported. |
|
||||
| 012 | xsprintf | void xsprintf (char* buff, const char* fmt, ...) | Print a formatted string into a string. Floating point is not supported. |
|
||||
| 013 | xfprintf | void xfprintf (void (*func)(unsigned char), const char* fmt, ...) | Print a formatted string onto the specified output device or stream. |
|
||||
| 014 | getserial | char getserial(void) | Wait and Get a single character at the lowest level from the serial input device. |
|
||||
| 015 | getserial_nonblocking | int8_t getserial_nonblocking(void) | Get a single character at the lowest level from the serial input device, return -1 if no character available. |
|
||||
| 016 | crc32_init | unsigned int crc32_init(void) | Initialise a CRC32 generator. |
|
||||
| 017 | crc32_addword | unsigned int crc32_addword(unsigned int crc_in, unsigned int word) | Add a word into the generated CRC32, returns the current CRC32 value after adding the word. |
|
||||
| 018 | get_dword | unsigned int get_dword(void) | Get an unsigned 32bit word (binary format, big endian) from the serial input device. |
|
||||
| 019 | rtcSet | uint8_t rtcSet(RTC *time) | Set the onboard Real Time Clock to the given date and time. |
|
||||
| 020 | rtcGet | void rtcGet(RTC *time) | Get the current date and time from the onboard Real Time Clock. |
|
||||
| 021 | f_open | f_open (FIL* fp, const TCHAR* path, BYTE mode) | Open or create a file |
|
||||
| 022 | f_close | f_close (FIL* fp) | Close an open file object |
|
||||
| 023 | f_read | f_read (FIL* fp, void* buff, UINT btr, UINT* br) | Read data from the file |
|
||||
| 024 | f_write | f_write (FIL* fp, const void* buff, UINT btw, UINT* bw) | Write data to the file |
|
||||
| 025 | f_lseek | f_lseek (FIL* fp, FSIZE_t ofs) | Move file pointer of the file object |
|
||||
| 026 | f_truncate | f_truncate (FIL* fp) | Truncate the file |
|
||||
| 027 | f_sync | f_sync (FIL* fp) | Flush cached data of the writing file |
|
||||
| 028 | f_opendir | f_opendir (DIR* dp, const TCHAR* path) | Open a directory |
|
||||
| 029 | f_closedir | f_closedir (DIR* dp) | Close an open directory |
|
||||
| 030 | f_readdir | f_readdir (DIR* dp, FILINFO* fno) | Read a directory item |
|
||||
| 031 | f_findfirst | f_findfirst (DIR* dp, FILINFO* fno, const TCHAR* path, const TCHAR* pattern) | Find first file |
|
||||
| 032 | f_findnext | f_findnext (DIR* dp, FILINFO* fno) | Find next file |
|
||||
| 033 | f_mkdir | f_mkdir (const TCHAR* path) | Create a sub directory |
|
||||
| 034 | f_unlink | f_unlink (const TCHAR* path) | Delete an existing file or directory |
|
||||
| 035 | f_rename | f_rename (const TCHAR* path_old, const TCHAR* path_new) | Rename/Move a file or directory |
|
||||
| 036 | f_stat | f_stat (const TCHAR* path, FILINFO* fno) | Get file status |
|
||||
| 037 | f_chmod | f_chmod (const TCHAR* path, BYTE attr, BYTE mask) | Change attribute of a file/dir |
|
||||
| 038 | f_utime | f_utime (const TCHAR* path, const FILINFO* fno) | Change timestamp of a file/dir |
|
||||
| 039 | f_chdir | f_chdir (const TCHAR* path) | Change current directory |
|
||||
| 040 | f_chdrive | f_chdrive (const TCHAR* path) | Change current drive |
|
||||
| 041 | f_getcwd | f_getcwd (TCHAR* buff, UINT len) | Get current directory |
|
||||
| 042 | f_getfree | f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs) | Get number of free clusters on the drive |
|
||||
| 043 | f_getlabel | f_getlabel (const TCHAR* path, TCHAR* label, DWORD* vsn) | Get volume label |
|
||||
| 044 | f_setlabel | f_setlabel (const TCHAR* label) | Set volume label |
|
||||
| 045 | f_forward | f_forward (FIL* fp, UINT(*func)(const BYTE*,UINT), UINT btf, UINT* bf) | Forward data to the stream |
|
||||
| 046 | f_expand | f_expand (FIL* fp, FSIZE_t szf, BYTE opt) | Allocate a contiguous block to the file |
|
||||
| 004 | f_mount | f_mount (FATFS* fs, const TCHAR* path, BYTE opt) | Mount/Unmount a logical drive |
|
||||
| 007 | f_mkfs | f_mkfs (const TCHAR* path, BYTE opt, DWORD au, void* work, UINT len) | Create a FAT volume |
|
||||
| 048 | f_fdisk | f_fdisk (BYTE pdrv, const DWORD* szt, void* work) | Divide a physical drive into some partitions |
|
||||
| 049 | f_setcp | f_setcp (WORD cp) | Set current code page |
|
||||
| 050 | f_putc | f_putc (TCHAR c, FIL* fp) | Put a character to the file |
|
||||
| 051 | f_puts | f_puts (const TCHAR* str, FIL* cp) | Put a string to the file |
|
||||
| 052 | f_printf | f_printf (FIL* fp, const TCHAR* str, ...) | Put a formatted string to the file |
|
||||
| 053 | f_gets | f_gets (TCHAR* buff, int len, FIL* fp) | Get a string from the file |
|
||||
| 054 | disk_read | DRESULT disk_read ( BYTE drv, BYTE *buff, DWORD sector, UINT count ) | Read full or partial sectors directly from the SD card |
|
||||
| 055 | disk_write | DRESULT disk_write ( BYTE drv, const BYTE *buff, DWORD sector, UINT count ) | Write full or partial sectors directly to the SD card |
|
||||
| 056 | disk_ioctl | DRESULT disk_ioctl ( BYTE drv, BYTE ctrl, void *buff ) | Issue direct control commands to the SD card. |
|
||||
| 057 | getStrParam | char *getStrParam(char **ptr) | Get a pointer within a string parameter list of the next string parameter. The pointer to the string parameter list is updated to point to the next+1 parameter. within a passed parameter string. |
|
||||
| 058 | getUintParam | uint32_t getUintParam(char **ptr) | Get the next 32bit unsigned integer from a string parameter list. The pointer to the string parameter list is updated to point to the next+1 parameter. |
|
||||
| 059 | set_serial_output | __inline void set_serial_output(uint8_t c) | For boards with more than 1 serial port, assign the given device as the primary output stream device. |
|
||||
| 060 | printBytesPerSec | void printBytesPerSec(uint32_t bytes, uint32_t mSec, const char *action) | Calculate and print the performance of an SD card transaction. |
|
||||
| 061 | printFSCode | void printFSCode(FRESULT result) | Print as text the result code from the Fat FS calls. |
|
||||
| Vector No | Method | Prototype | Description |
|
||||
| --------- | ------ | --------- | ----------- |
|
||||
| 000 | _break | Break handler. | When a breakpoint instruction is encountered, method to handle it. |
|
||||
| 001 | _putchar | void putchar(char c) | Send a single character at the lowest level to serial output device. |
|
||||
| 002 | putc | void putc (char c) | Normal method to write a single character to the output stream. |
|
||||
| 003 | fputc | void fputc (void (*func)(unsigned char), char c) | Write a character to the specified output device or stream. |
|
||||
| 004 | puts | void puts (const char* str) | Put a string onto the output stream. |
|
||||
| 005 | gets | int gets (char* buff, int len) | Get a string from the input stream. |
|
||||
| 006 | fgets | int fgets (unsigned char (*func)(void), char* buff, int len) | Get a string from the specified input device or stream. |
|
||||
| 007 | fputs | void fputs (void (*func)(unsigned char), const char* str) | Put a string onto the specified output device or stream. |
|
||||
| 008 | xatoi | int xatoi (char** str, long* res) | Convert a string into a long. String can be any format or base. |
|
||||
| 009 | uxatoi | int uxatoi(char **, uint32_t *) | Convert a string into an unsigned 32bit. String can be any format or base. |
|
||||
| 010 | printf | void printf (const char* fmt, ...) | Print a formatted string onto the output stream. Floating point is not supported. |
|
||||
| 011 | vprintf | void vprintf (const char*, va_list ) | Print a varargs formatted string onto the output stream. Floating point is not supported. |
|
||||
| 012 | sprintf | void sprintf (char* buff, const char* fmt, ...) | Print a formatted string into a string. Floating point is not supported. |
|
||||
| 013 | fprintf | void fprintf (void (*func)(unsigned char), const char* fmt, ...) | Print a formatted string onto the specified output device or stream. |
|
||||
| 014 | getScreenWidth | uint8_t getScreenWidth(void) | Return the current screen width. Primarily used when zOS acts as a User OS as the screen width is dynamic, for embedded use it returns a fixed constant. |
|
||||
| 015 | getKey | int8_t getKey(uint8_t mode) | Get a single character at the lowest level from the keyboard, serial or physical. mode = 0 - host unmapped keyboard non-blocking, 1 - host unmapped keyboard blocking, 2 - ansi non-blocking, 3 - ansi blocking. Unmapped returns ANSI on a serial keyboard or the host hardware value, ie. Sharp MZ-700 keyscan code. |
|
||||
| 016 | crc32_init | unsigned int crc32_init(void) | Initialise a CRC32 generator. |
|
||||
| 017 | crc32_addword | unsigned int crc32_addword(unsigned int crc_in, unsigned int word) | Add a word into the generated CRC32, returns the current CRC32 value after adding the word. |
|
||||
| 018 | get_dword | unsigned int get_dword(void) | Get an unsigned 32bit word (binary format, big endian) from the serial input device. |
|
||||
| 019 | rtcSet | uint8_t rtcSet(RTC *time) | Set the onboard Real Time Clock to the given date and time. |
|
||||
| 020 | rtcGet | void rtcGet(RTC *time) | Get the current date and time from the onboard Real Time Clock. |
|
||||
| 021 | f_open | FRESULT f_open (FIL* fp, const TCHAR* path, BYTE mode) | Open or create a file |
|
||||
| 022 | f_close | FRESULT f_close (FIL* fp) | Close an open file object |
|
||||
| 023 | f_read | FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br) | Read data from the file |
|
||||
| 024 | f_write | FRESULT f_write (FIL* fp, const void* buff, UINT btw, UINT* bw) | Write data to the file |
|
||||
| 025 | f_lseek | FRESULT f_lseek (FIL* fp, FSIZE_t ofs) | Move file pointer of the file object |
|
||||
| 026 | f_truncate | FRESULT f_truncate (FIL* fp) | Truncate the file |
|
||||
| 027 | f_sync | FRESULT f_sync (FIL* fp) | Flush cached data of the writing file |
|
||||
| 028 | f_opendir | FRESULT f_opendir (DIR* dp, const TCHAR* path) | Open a directory |
|
||||
| 029 | f_closedir | FRESULT f_closedir (DIR* dp) | Close an open directory |
|
||||
| 030 | f_readdir | FRESULT f_readdir (DIR* dp, FILINFO* fno) | Read a directory item |
|
||||
| 031 | f_mkdir | FRESULT f_mkdir (const TCHAR* path) | Create a sub directory |
|
||||
| 032 | f_unlink | FRESULT f_unlink (const TCHAR* path) | Delete an existing file or directory |
|
||||
| 033 | f_rename | FRESULT f_rename (const TCHAR* path_old, const TCHAR* path_new) | Rename/Move a file or directory |
|
||||
| 034 | f_stat | FRESULT f_stat (const TCHAR* path, FILINFO* fno) | Get file status |
|
||||
| 035 | f_chmod | FRESULT f_chmod (const TCHAR* path, BYTE attr, BYTE mask) | Change attribute of a file/dir |
|
||||
| 036 | f_utime | FRESULT f_utime (const TCHAR* path, const FILINFO* fno) | Change timestamp of a file/dir |
|
||||
| 037 | f_chdir | FRESULT f_chdir (const TCHAR* path) | Change current directory |
|
||||
| 038 | f_chdrive | FRESULT f_chdrive (const TCHAR* path) | Change current drive |
|
||||
| 039 | f_getcwd | FRESULT f_getcwd (TCHAR* buff, UINT len) | Get current directory |
|
||||
| 040 | f_getfree | FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs) | Get number of free clusters on the drive |
|
||||
| 041 | f_getlabel | FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* vsn) | Get volume label |
|
||||
| 042 | f_setlabel | FRESULT f_setlabel (const TCHAR* label) | Set volume label |
|
||||
| 043 | f_expand | FRESULT f_expand (FIL* fp, FSIZE_t szf, BYTE opt) | Allocate a contiguous block to the file |
|
||||
| 044 | f_mount | FRESULT f_mount (FATFS* fs, const TCHAR* path, BYTE opt) | Mount/Unmount a logical drive |
|
||||
| 045 | f_mkfs | FRESULT f_mkfs (const TCHAR* path, BYTE opt, DWORD au, void* work, UINT len) | Create a FAT volume |
|
||||
| 046 | f_putc | FRESULT f_putc (TCHAR c, FIL* fp) | Put a character to the file |
|
||||
| 047 | f_gets | FRESULT f_gets (TCHAR* buff, int len, FIL* fp) | Get a string from the file |
|
||||
| 048 | disk_read | DRESULT disk_read ( BYTE drv, BYTE *buff, DWORD sector, UINT count ) | Read full or partial sectors directly from the SD card |
|
||||
| 049 | disk_write | DRESULT disk_write ( BYTE drv, const BYTE *buff, DWORD sector, UINT count ) | Write full or partial sectors directly to the SD card |
|
||||
| 050 | disk_ioctl | DRESULT disk_ioctl ( BYTE drv, BYTE ctrl, void *buff ) | Issue direct control commands to the SD card. |
|
||||
| 051 | getStrParam | char *getStrParam(char **ptr) | Get a pointer within a string parameter list of the next string parameter. The pointer to the string parameter list is updated to point to the next+1 parameter. within a passed parameter string. |
|
||||
| 052 | getUintParam | uint32_t getUintParam(char **ptr) | Get the next 32bit unsigned integer from a string parameter list. The pointer to the string parameter list is updated to point to the next+1 parameter. |
|
||||
| 053 | set_serial_output | void set_serial_output(uint8_t c) | For boards with more than 1 serial port, assign the given device as the primary output stream device. |
|
||||
| 054 | printFSCode | void printFSCode(FRESULT result) | Print as text the result code from the Fat FS calls. |
|
||||
| 055 | malloc | void \*malloc(size_t __size) | Allocate a block of memory on the heap. |
|
||||
| 056 | realloc | void *realloc(void \*__ptr, size_t __size) | Resize a block of memory, copying data if a new block is required. |
|
||||
| 057 | calloc | void \*calloc(size_t __size) | Allocate a zeroed block of memory on the heap. |
|
||||
| 058 | free | void free(void \*__ptr) | Release a block of memory back to the heap. |
|
||||
| 059 | setupZ80Pins | void setupZ80Pins(uint8_t, volatile uint32_t *) | Initialise all pins according to their Z80 function. Setup hardware to logical mapping table. |
|
||||
| 060 | resetZ80 | void resetZ80(uint8_t) | Perform a physical RESET of the Z80. |
|
||||
| 061 | reqZ80Bus | uint8_t reqZ80Bus(uint32_t) | Request control of the Z80 Bus. |
|
||||
| 062 | reqMainboardBus | uint8_t reqMainboardBus(uint32_t) | Request control of the Z80 Bus in order to access the host mainboard resources. |
|
||||
| 063 | reqTranZPUterBus | uint8_t reqTranZPUterBus(uint32_t, enum TARGETS) | Request control of the Z80 Bus in order to access the tranZPUter resources. |
|
||||
| 064 | setupSignalsForZ80Access | void setupSignalsForZ80Access(enum BUS_DIRECTION) | Setup direction of Z80 Access, Read or Write. |
|
||||
| 065 | releaseZ80 | void releaseZ80(void) | Release previously granted Z80 Bus. |
|
||||
| 066 | writeZ80Memory | uint8_t writeZ80Memory(uint32_t, uint8_t, enum TARGETS) | Write a byte to the Z80 host memory. |
|
||||
| 067 | readZ80Memory | uint8_t readZ80Memory(uint32_t) | Read a byte from the Z80 host memory. |
|
||||
| 068 | writeZ80IO | uint8_t writeZ80IO(uint32_t, uint8_t, enum TARGETS) | Write a byte to the Z80 I/O region. |
|
||||
| 069 | readZ80IO | uint8_t readZ80IO(uint32_t, enum TARGETS) | Read a byte from the Z80 I/O region. |
|
||||
| 070 | refreshZ80 | void refreshZ80(void) | Perform the next RAS refresh (for refreshing host DRAM). |
|
||||
| 071 | refreshZ80AllRows | void refreshZ80AllRows(void) | Perform a full refresh (all rows) of the host DRAM. |
|
||||
| 072 | setCtrlLatch | void setCtrlLatch(uint8_t) | Set the Memory Mode Latch to affect a different memory profile. |
|
||||
| 073 | setZ80CPUFrequency | uint32_t setZ80CPUFrequency(float, uint8_t) | Set the frequency, 1Hz to 24MHz of the Z80 CPU. |
|
||||
| 074 | copyFromZ80 | uint8_t copyFromZ80(uint8_t *, uint32_t, uint32_t, enum TARGETS) | Copy a block of memory from the Z80 host into the K64F RAM. |
|
||||
| 075 | copyToZ80 | int8_t copyToZ80(uint32_t, uint8_t *, uint32_t, enum TARGETS) | Copy a block of memory from the K64F RAM/FlashRAM to the Z80 host memory. |
|
||||
| 076 | fillZ80Memory | void fillZ80Memory(uint32_t, uint32_t, uint8_t, enum TARGETS) | Fill a block of memory hosted on the host to a set value. |
|
||||
| 077 | captureVideoFrame | void captureVideoFrame(enum VIDEO_FRAMES, uint8_t) | Capture the contents of the screen video buffer and store in local RAM. |
|
||||
| 078 | refreshVideoFrame | void refreshVideoFrame(enum VIDEO_FRAMES, uint8_t, uint8_t) | Refresh or write from the local RAM based video buffer to the host video buffer. |
|
||||
| 079 | loadVideoFrameBuffer | FRESULT loadVideoFrameBuffer(char *, enum VIDEO_FRAMES) | Load the local RAM based video buffer with the contents of a file. |
|
||||
| 080 | saveVideoFrameBuffer | FRESULT saveVideoFrameBuffer(char *, enum VIDEO_FRAMES) | Save the local RAM based video buffer to a file. |
|
||||
| 081 | getVideoFrame | char *getVideoFrame(enum VIDEO_FRAMES) | Get the address of the local RAM based video frame. |
|
||||
| 082 | getAttributeFrame | char *getAttributeFrame(enum VIDEO_FRAMES) | Get the address of the local RAM based video attribute frame. |
|
||||
| 083 | loadZ80Memory | FRESULT loadZ80Memory(const char *, uint32_t, uint32_t, uint32_t, uint32_t *, enum TARGETS, uint8_t) | Load the Z80 host memory from the contents of a file. |
|
||||
| 084 | loadMZFZ80Memory | FRESULT loadMZFZ80Memory(const char *, uint32_t, uint32_t *, enum TARGETS, uint8_t) | Load a Sharp MZF format file contents into Z80 memory. |
|
||||
| 085 | saveZ80Memory | FRESULT saveZ80Memory(const char *, uint32_t, uint32_t, t_svcDirEnt *, enum TARGETS) | Save Z80 host memory contents to a file. |
|
||||
| 086 | memoryDumpZ80 | int memoryDumpZ80(uint32_t, uint32_t, uint32_t, uint8_t, enum TARGETS) | Dump the contents of Z80 host memory to the current output device in a formatted hex format. |
|
||||
| 087 | isZ80Reset | uint8_t isZ80Reset(void) | Test to see if an external Host RESET has occurred. |
|
||||
| 088 | isZ80MemorySwapped | uint8_t isZ80MemorySwapped(void) | Sharp MZ-80A test to see if the memory from 0000 has been swapped to C000. |
|
||||
| 089 | getZ80IO | uint8_t getZ80IO(uint8_t *) | Method to get a Z80 I/O event should one have occurred since the last poll. Later versions of the tranZPUter SW board v2.x no longer need to trap Z80 I/O events so this is deprecated. |
|
||||
| 090 | clearZ80Reset | void clearZ80Reset(void) | Method to clear an external RESET event. |
|
||||
| 091 | hardResetTranZPUter | void hardResetTranZPUter(void) | Method to force a hard reset of the tranZPUter board. |
|
||||
| 092 | convertSharpFilenameToAscii | void convertSharpFilenameToAscii(char *, char *, uint8_t) | Method to convert a Sharp MZF filename into ASCII format. |
|
||||
|
||||
<div style="text-align: justify">
|
||||
The Vector No is only for reference, applications use the actual method in their code and a macro will set the correct vector call.
|
||||
<br><br>
|
||||
|
||||
As well as the above methods, two global parameter blocks are exposed and passed to the application which it can freely use. These are:
|
||||
</div>
|
||||
|
||||
The global parameter block, accessed by the variable *G*:
|
||||
|
||||
````c
|
||||
// Global parameters accessible in applications.
|
||||
typedef struct {
|
||||
uint8_t fileInUse; /* Flag to indicate if file[0] is in use. */
|
||||
FIL File[MAX_FILE_HANDLE]; /* Maximum open file objects */
|
||||
FATFS FatFs[FF_VOLUMES]; /* Filesystem object for each logical drive */
|
||||
BYTE Buff[512]; /* Working disk buffer */
|
||||
DWORD Sector; /* Sector to read */
|
||||
uint8_t fileInUse; // Flag to indicate if file[0] is in use.
|
||||
FIL File[MAX_FILE_HANDLE]; // Maximum open file objects
|
||||
FATFS FatFs[FF_VOLUMES]; // Filesystem object for each logical drive
|
||||
BYTE Buff[512]; // Working disk buffer
|
||||
DWORD Sector; // Sector to read
|
||||
#if defined __K64F__
|
||||
uint32_t volatile *millis; /* Pointer to the K64F millisecond tick */
|
||||
uint32_t volatile *millis; // Pointer to the K64F millisecond tick
|
||||
#endif
|
||||
#if defined __TRANZPUTER__
|
||||
int ctrlThreadId; // Id of tranZPUter control thread.
|
||||
uint8_t ctrlThreadBusy; // Flag to indicate when the control thread cannot be disturbed.
|
||||
#endif
|
||||
} GLOBALS;
|
||||
````
|
||||
An example of use within a program would be: xprintf("Sector:%d\n", G->Sector);
|
||||
An example of use within a program would be: <br>
|
||||
|
||||
printf("Sector:%d\n", G->Sector);
|
||||
|
||||
The configuration block, accessed by the variable *cfgSoC*:
|
||||
|
||||
@@ -380,19 +475,30 @@ typedef struct
|
||||
uint8_t timer1No;
|
||||
} SOC_CONFIG;
|
||||
````
|
||||
An example of use in a program would be: if(cfgSoC->implSDRAM) { ... }
|
||||
|
||||
An example of use in a program would be: <br>
|
||||
|
||||
if(cfgSoC->implSDRAM) { ... }
|
||||
|
||||
|
||||
<div style="text-align: justify">
|
||||
To build an application, it is the same as creating a normal C program (C++ to follow) but instead of using the standard 'main' entry point with argument list a new method has been
|
||||
provided, namely 'app'. This has the prototype:
|
||||
provided, namely 'app'.
|
||||
</div>
|
||||
|
||||
uint32_t app(uint32_t param1, uint32_t param2)
|
||||
This has the prototype:
|
||||
|
||||
uint32_t app(uint32_t param1, uint32_t param2)
|
||||
|
||||
<div style="text-align: justify">
|
||||
param1 and param2 can be any 32bit value passed when fileExec is called within zOS. Under standard operating conditions, zOS calls an application with one parameter only, param1 which is
|
||||
a (char *) pointer to the command line parameters which invoked the application.
|
||||
<br><br>
|
||||
|
||||
The return code from the application to zOS is a 32bit unsigned integer. 0 means the application executed successfully, 0xFFFFFFFF indicates a failure and anything inbetween is for reference or to be used
|
||||
by future commands for conditional processing.
|
||||
The return code from the application to zOS is a 32bit unsigned integer. 0 means the application executed successfully, 0xFFFFFFFF indicates a failure and anything inbetween is for a more detailed failure,
|
||||
reference or to be used by future commands for conditional processing.
|
||||
<br><br>
|
||||
</div>
|
||||
|
||||
The standard template for an app() is as follows:
|
||||
|
||||
@@ -419,11 +525,11 @@ uint32_t app(uint32_t param1, uint32_t param2)
|
||||
|
||||
if (!xatoi(&ptr, &startAddr))
|
||||
{
|
||||
xprintf("Illegal <start addr> value.\n");
|
||||
printf("Illegal <start addr> value.\n");
|
||||
retCode = 0xFFFFFFFF;
|
||||
} else if (!xatoi(&ptr, &endAddr))
|
||||
{
|
||||
xprintf("Illegal <end addr> value.\n");
|
||||
printf("Illegal <end addr> value.\n");
|
||||
retCode = 0xFFFFFFFF;
|
||||
} else
|
||||
{
|
||||
@@ -447,26 +553,30 @@ uint32_t app(uint32_t param1, uint32_t param2)
|
||||
|
||||
## Software Build
|
||||
|
||||
This section shows how to make a basic zOS kernel. The start point for building zOS is the 'build.sh' script which contains all the logic required. This program started off as knowledge dumps and enhanced as the software progressed.
|
||||
It would be nice, eventually, to redesign this script as it is pushing into BASH shell language what really should be coded in Python or Java, but it works for now in building this software.
|
||||
|
||||
|
||||
### Paths
|
||||
|
||||
For ease of reading, the following shortnames refer to the corresponding path in this chapter.
|
||||
|
||||
| Short Name | |
|
||||
|------------------|----------------------------------------------------------------------------|
|
||||
| \[\<ABS PATH>\] | The path where this repository was extracted on your system. |
|
||||
| \<apps\> | \[\<ABS PATH>\]/zsoft/apps |
|
||||
| \<build\> | \[\<ABS PATH>\]/zsoft/build |
|
||||
| \<common\> | \[\<ABS PATH>\]/zsoft/common |
|
||||
| \<libraries\> | \[\<ABS PATH>\]/zsoft/libraries |
|
||||
| \<teensy3\> | \[\<ABS PATH>\]/zsoft/teensy3 |
|
||||
| \<include\> | \[\<ABS PATH>\]/zsoft/include |
|
||||
| \<startup\> | \[\<ABS PATH>\]/zsoft/startup |
|
||||
| \<iocp\> | \[\<ABS PATH>\]/zsoft/iocp |
|
||||
| \<zOS\> | \[\<ABS PATH>\]/zsoft/zOS |
|
||||
| \<zputa\> | \[\<ABS PATH>\]/zsoft/zputa |
|
||||
| \<rtl\> | \[\<ABS PATH>\]/zsoft/rtl |
|
||||
| \<docs\> | \[\<ABS PATH>\]/zsoft/docs |
|
||||
| \<tools\> | \[\<ABS PATH>\]/zsoft/tools |
|
||||
| Short Name | Path | Description |
|
||||
|------------------|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
|
||||
| \[\<ABS PATH>\] | The path where this repository was extracted on your system. | |
|
||||
| \<apps\> | \[\<ABS PATH>\]/zsoft/apps | Application directory. All zOS/ZPUTA applications are located here along with their makefiles. |
|
||||
| \<build\> | \[\<ABS PATH>\]/zsoft/build | A target output directory for the compiled software, ie. \<z-build\>/SD contains all files to be written to an SD card. |
|
||||
| \<common\> | \[\<ABS PATH>\]/zsoft/common | Common C/C++ methods which are not assembled into a library. |
|
||||
| \<libraries\> | \[\<ABS PATH>\]/zsoft/libraries | C/C++ libraries, usually part of a C/C++ installation but for embedded work, especially on the ZPU need to be created seperately. | |
|
||||
| \<teensy3\> | \[\<ABS PATH>\]/zsoft/teensy3 | The K64F based Teensy 3.5 software, some of which is used in the K64F version of zOS. Very rich libraries and can be easily added into a K64F programs. | |
|
||||
| \<include\> | \[\<ABS PATH>\]/zsoft/include | Common include header files. | |
|
||||
| \<startup\> | \[\<ABS PATH>\]/zsoft/startup | Embedded processor startup files, generally in Assembler. Templates and macros are used to create the correct targets memory model startup code. | |
|
||||
| \<iocp\> | \[\<ABS PATH>\]/zsoft/iocp | The IO Control Program, my initial bootloader for bootstrapping an application on the ZPU. | |
|
||||
| \<zOS\> | \[\<ABS PATH>\]/zsoft/zOS | The zOS source code, parameterised for the different target CPU's. | |
|
||||
| \<zputa\> | \[\<ABS PATH>\]/zsoft/zputa | The ZPUTA source code, parameterised for the different target CPU's. | |
|
||||
| \<rtl\> | \[\<ABS PATH>\]/zsoft/rtl | Register Transfer Level files. These are generated memory definition and initialisation files required when building for a ZPU target project. | |
|
||||
| \<docs\> | \[\<ABS PATH>\]/zsoft/docs | Any relevant documentation for the software. | |
|
||||
| \<tools\> | \[\<ABS PATH>\]/zsoft/tools | Tools to aid in the compilation and creation of target files. | |
|
||||
|
||||
|
||||
### Tools
|
||||
@@ -502,6 +612,7 @@ The software is organised into the following tree/folders:
|
||||
| zputa | | The ZPU Test Application. This is an application for testing the ZPU and the SoC components. It can either be built as a single image for pre-loading into a BRAM via VHDL or as a standalone application loaded by the IOCP bootloader from an SD card. The services it provides can either be embedded or available on the SD card as applets depending on memory restrictions. |
|
||||
| zOS | | The z-Operating System. This is a light OS derived from ZPUTA with the aim of providing a framework, both for application building and runtime control, within a ZPU or K64F project. The OS provides disk based services, common hardware access API and additional features to run and service any application built for this enviroment. Applications can be started autonomously or interactively via the serial based VT100 console. |
|
||||
| | build.sh | Unix shell script to build IOCP, zOS, ZPUTA and Apps for a given design.<br>  |
|
||||
| | buildall | Unix shell script to build all dependencies for a tranZPUter SW-700 v1.3 board including embedded zOS+applications for the K64F and host zOS+applications for the ZPU running as the host OS. |
|
||||
|
||||
|
||||
### Build.sh
|
||||
@@ -512,12 +623,12 @@ NAME
|
||||
build.sh - Shell script to build a ZPU/K64F program or OS.
|
||||
|
||||
SYNOPSIS
|
||||
build.sh [-CIOoMBAsdxh]
|
||||
build.sh [-CIOoMBAsTZdxh]
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
OPTIONS
|
||||
-C <CPU> = Small, Medium, Flex, Evo, K64F - defaults to Evo.
|
||||
-C <CPU> = Small, Medium, Flex, Evo, EvoMin, K64F - defaults to Evo.
|
||||
-I <iocp ver> = 0 - Full, 1 - Medium, 2 - Minimum, 3 - Tiny (bootstrap only)
|
||||
-O <os> = zputa, zos
|
||||
-o <os ver> = 0 - Standalone, 1 - As app with IOCP Bootloader,
|
||||
@@ -531,6 +642,8 @@ OPTIONS
|
||||
-s <size> = Required size of application stack
|
||||
-a <size> = Maximum size of an app, defaults to (BRAM SIZE - App Start Address - Stack Size)
|
||||
if the App Start is located within BRAM otherwise defaults to 0x10000.
|
||||
-T = TranZPUter specific build, adds initialisation and setup code.
|
||||
-Z = Sharp MZ series ZPU build, zOS runs as an OS host on Sharp MZ hardware.
|
||||
-d = Debug mode.
|
||||
-x = Shell trace mode.
|
||||
-h = This help screen.
|
||||
@@ -560,6 +673,8 @@ Sensible defaults are configured into the script, the overriding flags are descr
|
||||
| -S \<size\> | Required size of stack. Normally the \<os\> manages the stack which is also used by an application. If the application is considered dangerous then it should be allocated a local stack. |
|
||||
| -s \<size\> | Required size of application stack. Normally this should not be required as the application shares the \<os\> stack. If the application is dangerous then set this value to allocate a local stack. |
|
||||
| -a \<size\> | Maximum size of an application.<br>*defaults to (BRAM SIZE - App Start Address - Stack Size) for the ZPU if the App Start is located within BRAM otherwise defaults to 0x10000, or 0x20030000 - Stack Size - Heap Size - 0x4000 for the K64F. If the App Start is located within BRAM otherwise defaults to 0x10000.* |
|
||||
| -T | TranZPUter specific build, adds initialisation and setup code. Build as an embedded OS for the tranZPUter board. |
|
||||
| -Z | Sharp MZ series ZPU build, zOS runs as an OS host on Sharp MZ hardware. Build as a host OS for the Sharp MZ series computer running a ZPU/NIOSII as the host processor. |
|
||||
| -d | Debug mode. Enable more verbose output on state and decisions made by the script. |
|
||||
| -x | Shell trace mode. A very low level, line by line trace of shell execution. Only used during debugging. |
|
||||
| -h | This help screen. |
|
||||
@@ -571,23 +686,31 @@ To build the standard zOS to be run on a Freescale K64F processor, you would iss
|
||||
<ABS PATH>/build.sh -C K64F -O zos -B 0x00000000 -N 0x00002000 -S 0x00001000 -A 0x1FFF0000 -n 0x00020000 -s 0x00000000
|
||||
```
|
||||
|
||||
This specifies that the target CPU is the K64F processor (-C K64F), the target OS is zOS (-O zos), the base or starting address of the generated firmware is 0x00000000 (-B 0x00000000), the heap for zOS is 0x00002000 bytes in size (-N 0x00002000),
|
||||
the stack for zOS is 0x000010000 bytes in size (-S 0x000010000), the starting address for applications is base of RAM at 0x1FFF0000 (-A 0x1FFF0000), the application heap size is 0x00020000 (-n 0x00020000), the application doesnt have a local
|
||||
stack (-s 0x00000000).
|
||||
This specifies that the:
|
||||
|
||||
* target CPU is the K64F processor (-C K64F),
|
||||
* target OS is zOS (-O zos),
|
||||
* base or starting address of the generated firmware is 0x00000000 (-B 0x00000000),
|
||||
* heap for zOS is 0x00002000 bytes in size (-N 0x00002000),
|
||||
* the stack for zOS is 0x000010000 bytes in size (-S 0x000010000),
|
||||
* starting address for applications is base of RAM at 0x1FFF0000 (-A 0x1FFF0000),
|
||||
* application heap size is 0x00020000 (-n 0x00020000),
|
||||
* application doesnt have a local stack (-s 0x00000000).
|
||||
|
||||
When complete, the output will be stored in two locations:<br>
|
||||
\<zOS>/main.(hex | bin | srec) - The main zOS firmware in 3 standard formats which can be flashed directly into the K64F FlashRAM at 0x00000000.<br>
|
||||
\<build>/SD - Applications (and kernels if using the ZPU processor with IOCP) which can be copied directly to a FAT32 formatted SD card.<br>
|
||||
|
||||
````bash
|
||||
<zOS>/main.(hex | bin | srec) - The main zOS firmware in 3 standard formats which can be flashed directly into the K64F FlashRAM at 0x00000000.<br>
|
||||
<build>/SD - Applications (and kernels if using the ZPU processor with IOCP) which can be copied directly to a FAT32 formatted SD card.<br>
|
||||
````
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
## Credits
|
||||
|
||||
Where I have used or based any component on a 3rd parties design I have included the original authors copyright notice within the headers or given due credit. All 3rd party software, to my knowledge and research, is open source and freely useable, if there is found to be any component with licensing restrictions, it will be removed from this repository and a suitable link/config provided.
|
||||
|
||||
|
||||
<br>
|
||||
## Licenses
|
||||
|
||||
The original ZPU uses the Free BSD license and such the Evo is also released under FreeBSD. SoC components and other developments written by me are currently licensed using the GPL. 3rd party components maintain their original copyright notices.
|
||||
|
||||
320
ZPUTA_README.md
320
ZPUTA_README.md
@@ -1,37 +1,45 @@
|
||||
<br>
|
||||
|
||||
### ZPUTA
|
||||
|
||||
<div style="text-align: justify">
|
||||
ZPUTA started life as a simple test application to verify ZPU Evo and SoC hardware designs as they were being developed. It's name is derived from ZPU Test Application and it has evolved
|
||||
over time from a simple program to something of a level of sophistication akin to an OS. It can be built as a single firmware image with all functionality within it or split with most
|
||||
functionality on a connected storage device such as an SD card. zOS was split from ZPUTA and had much of the internal functionality removed, relying on the external storage making it
|
||||
more suited to place into end projects.
|
||||
<br><br>
|
||||
|
||||
Originally the ZPUTA/zOS developments only targetted the ZPU architecture and they had two primary methods of execution:
|
||||
</div>
|
||||
|
||||
* as an application booted by IOCP,
|
||||
* standalone booted as the ZPU Evo startup firmware.
|
||||
|
||||
<div style="text-align: justify">
|
||||
The mode is chosen in the configuration and functionality is identical. When booted as an application by IOCP, zOS is stored on an SD card and loaded at boot time. When 'standalone'
|
||||
zOS is stored in the onboard Flash (or preconfigure BRAM acting as ROM).
|
||||
<br><br>
|
||||
|
||||
More recently, zOS/ZPUTA was ported to the ARM Cortex-M4 architecture for use with the Freescale K64F on the tranZPUterSW project. As the K64F is a fixed architecture CPU / SoC only one
|
||||
method of execution exists, 'standalone', it is stored in the onboard Flash and started when the CPU powers up.
|
||||
<br><br>
|
||||
|
||||
The idea behind ZPUTA is mainly that of testing, getting internal access to an embedded hardware system and running codelets to test or try hardware features. Each test would be built
|
||||
as an internal function and an external app, this was paramount due to the development boards being used. The Cyclone V based DE10-Nano FPGA board used to develop the ZPU Evo has more than 600KB
|
||||
of RAM memory wherease a Cyclone 10LP on the tranZPUter has only 120K of which a chunk is used as cache in the Evo design, thus the latter needs an SD card and external applications to
|
||||
test thoroughly. All functionality of ZPUTA can be enabled/disabled within the primary loaded image.
|
||||
<br><br>
|
||||
|
||||
To operate, ZPUTA requires at least one serial connection (physical or usb-virtual), preferably two for debug output. On the primary serial connection it is preferable to have an ANSI/VT100
|
||||
terminal emulator package connected. The requirement for an ANSI/VT100 terminal emulation package is to allow commands such as the editor or readline to function correctly. A dumb serial
|
||||
terminal will work fine but at reduced application functionality.
|
||||
</div>
|
||||
|
||||
## Using ZPUTA
|
||||
|
||||
<div style="text-align: justify">
|
||||
The ZPUTA interface has been written keeping in mind that only a serial text based terminal is available. Some components such as the Editor need more advanced capabilities and to this end
|
||||
the venerable VT100 emulation was chosen as a suitable candidate (which means you need a VT100 emulator sat in front of the serial line in order to use the Editor). Interaction is keyboard
|
||||
and text based, (no nice GUI interfaces!) with the sections below providing information needed to use the interface.
|
||||
</div>
|
||||
|
||||
Prior to ZPUTA, I created a bootstrap program called the IOCP (I/O Control Program) which operated at the lowest hardware levels and was able to boot more sophisticated programs, ie. ZPUTA.
|
||||
The IOCP is size sensitive and was designed to bootstrap from any memory device and by including an SD card and the [Petit FatFS](http://elm-chan.org/fsw/ff/00index_p.html) it is able to
|
||||
@@ -39,7 +47,9 @@ bootstrap off an SD card. IOCP was originally used to bootstrap ZPUTA, aiding de
|
||||
the low level code into ZPUTA and it was able to boot as the primary software without needing IOCP. IOCP still remains within the project to boot any application not needing ZPUTA or zOS
|
||||
level of sophistication.
|
||||
|
||||
<div style="text-align: justify">
|
||||
ZPUTA will remain with its original purpose, to aid in testing, whilst zOS will over time become more a refined OS for my own projects.
|
||||
</div>
|
||||
|
||||
A few months ago the tranZPUterSW project was born as an offshoot from the tranZPUter in order to more rapidly forward the design in softwareapid development. This came in the shape of the
|
||||
Teensy 3.5 development board by [PJRC.com](https://www.pjrc.com/store/teensy35.html) or more importantly the Freescale K64F processor, an ARM Cortex-M4 CPU. This required quite a few changes
|
||||
@@ -52,10 +62,14 @@ The first introduction to the OS is a sign-on message which details the CPU, ver
|
||||
|
||||

|
||||
|
||||
<div style="text-align: justify">
|
||||
Interaction with the OS is no different than say MSDOS, you enter a command and get a response. The only difference is that it is within an embedded system not a full blown PC.
|
||||
<br><br>
|
||||
|
||||
The ZPUTA command line is not a shell interpreter just a basic text interface provided for the issuing of built-in commands or commands stored on the SD card. It does include a cutdown readline
|
||||
capability with history to aid in command entering and retrieval and generally follows the GNU readline functionality, the recognised keys at the command line are:
|
||||
</div>
|
||||
</br>
|
||||
|
||||
| Key | Action |
|
||||
| --- | ------- |
|
||||
@@ -206,20 +220,34 @@ please refer to the Application section (on the left navigation bar) or the Appl
|
||||
| mbasic | \[\<file\>\] | Interactive Mini-Basic Interpreter. |
|
||||
| tbasic | | Interactive tiny Basic Interpreter. |
|
||||
|
||||
- #### tranZPUter Commands
|
||||
|
||||
| Command | Parameters | Description |
|
||||
| ------- | ---------- | ----------------------------------------------- |
|
||||
| tzload | See apps section for full list. | Upload and Download files to the tranZPUter memory, grab a video frame or set a new frame. |
|
||||
| tzdump | See apps section for full list. | Dump tranZPUter memory to screen. |
|
||||
| tzclear | See apps section for full list. | Clear tranZPUter memory. |
|
||||
| tzclk | See apps section for full list. | Set the Z80 alternative CPU frequency. |
|
||||
| tzreset | See apps section for full list. | Reset the tranZPUter. |
|
||||
| tzio | See apps section for full list. | Z80 I/O Port read/write tool. |
|
||||
| tzflupd | See apps section for full list. | K64F FlashRAM update tool. Update the running zOS/ZPUTA kernel with a later version. |
|
||||
|
||||
|
||||
All commands with a (*) are built in to ZPUTA.
|
||||
|
||||
*autoexec.bat*
|
||||
--------------
|
||||
|
||||
<div style="text-align: justify">
|
||||
As per MSDOS, if a file of name 'AUTOEXEC.BAT' is created in the root directory (top level) of the SD filesystem the contents will be executed on ZPUTA at boot/reset. Use this file to automate
|
||||
setup and startup of your intended application. It currently has no in-built language, just issuing of commands.
|
||||
|
||||
</div>
|
||||
|
||||
## Technical Detail
|
||||
|
||||
<div style="text-align: justify">
|
||||
This section aims to provide some of the inner detail of the operating system to date. A lot of this information is the same in ZPUTA but as ZPUTA matures it will start to have significant differences.
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
### Memory Organisation
|
||||
|
||||
@@ -262,90 +290,132 @@ convert calls to xprintf to jumps into the ZPUTA vector table.
|
||||
|
||||
At the moment, these API methods are exposed:
|
||||
|
||||
| Vector No | Method | Prototype | Description |
|
||||
| --------- | ------ | --------- | ----------- |
|
||||
| 000 | _break | Break handler. | When a breakpoint instruction is encountered, method to handle it. |
|
||||
| 001 | _putchar | void putchar(char c) | Send a single character at the lowest level to serial output device. |
|
||||
| 002 | xputc | void xputc (char c) | Normal method to write a single character to the output stream. |
|
||||
| 003 | xfputc | void xfputc (void (*func)(unsigned char), char c) | Write a character to the specified output device or stream. |
|
||||
| 004 | xputs | void xputs (const char* str) | Put a string onto the output stream. |
|
||||
| 005 | xgets | int xgets (char* buff, int len) | Get a string from the input stream. |
|
||||
| 006 | xfgets | int xfgets (unsigned char (*func)(void), char* buff, int len) | Get a string from the specified input device or stream. |
|
||||
| 007 | xfputs | void xfputs (void (*func)(unsigned char), const char* str) | Put a string onto the specified output device or stream. |
|
||||
| 008 | xatoi | int xatoi (char** str, long* res) | Convert a string into a long. String can be any format or base. |
|
||||
| 009 | uxatoi | int uxatoi(char **, uint32_t *) | Convert a string into an unsigned 32bit. String can be any format or base. |
|
||||
| 010 | xprintf | void xprintf (const char* fmt, ...) | Print a formatted string onto the output stream. Floating point is not supported. |
|
||||
| 011 | xvprintf | void xvprintf (const char*, va_list ) | Print a varargs formatted string onto the output stream. Floating point is not supported. |
|
||||
| 012 | xsprintf | void xsprintf (char* buff, const char* fmt, ...) | Print a formatted string into a string. Floating point is not supported. |
|
||||
| 013 | xfprintf | void xfprintf (void (*func)(unsigned char), const char* fmt, ...) | Print a formatted string onto the specified output device or stream. |
|
||||
| 014 | getserial | char getserial(void) | Wait and Get a single character at the lowest level from the serial input device. |
|
||||
| 015 | getserial_nonblocking | int8_t getserial_nonblocking(void) | Get a single character at the lowest level from the serial input device, return -1 if no character available. |
|
||||
| 016 | crc32_init | unsigned int crc32_init(void) | Initialise a CRC32 generator. |
|
||||
| 017 | crc32_addword | unsigned int crc32_addword(unsigned int crc_in, unsigned int word) | Add a word into the generated CRC32, returns the current CRC32 value after adding the word. |
|
||||
| 018 | get_dword | unsigned int get_dword(void) | Get an unsigned 32bit word (binary format, big endian) from the serial input device. |
|
||||
| 019 | rtcSet | uint8_t rtcSet(RTC *time) | Set the onboard Real Time Clock to the given date and time. |
|
||||
| 020 | rtcGet | void rtcGet(RTC *time) | Get the current date and time from the onboard Real Time Clock. |
|
||||
| 021 | f_open | f_open (FIL* fp, const TCHAR* path, BYTE mode) | Open or create a file |
|
||||
| 022 | f_close | f_close (FIL* fp) | Close an open file object |
|
||||
| 023 | f_read | f_read (FIL* fp, void* buff, UINT btr, UINT* br) | Read data from the file |
|
||||
| 024 | f_write | f_write (FIL* fp, const void* buff, UINT btw, UINT* bw) | Write data to the file |
|
||||
| 025 | f_lseek | f_lseek (FIL* fp, FSIZE_t ofs) | Move file pointer of the file object |
|
||||
| 026 | f_truncate | f_truncate (FIL* fp) | Truncate the file |
|
||||
| 027 | f_sync | f_sync (FIL* fp) | Flush cached data of the writing file |
|
||||
| 028 | f_opendir | f_opendir (DIR* dp, const TCHAR* path) | Open a directory |
|
||||
| 029 | f_closedir | f_closedir (DIR* dp) | Close an open directory |
|
||||
| 030 | f_readdir | f_readdir (DIR* dp, FILINFO* fno) | Read a directory item |
|
||||
| 031 | f_findfirst | f_findfirst (DIR* dp, FILINFO* fno, const TCHAR* path, const TCHAR* pattern) | Find first file |
|
||||
| 032 | f_findnext | f_findnext (DIR* dp, FILINFO* fno) | Find next file |
|
||||
| 033 | f_mkdir | f_mkdir (const TCHAR* path) | Create a sub directory |
|
||||
| 034 | f_unlink | f_unlink (const TCHAR* path) | Delete an existing file or directory |
|
||||
| 035 | f_rename | f_rename (const TCHAR* path_old, const TCHAR* path_new) | Rename/Move a file or directory |
|
||||
| 036 | f_stat | f_stat (const TCHAR* path, FILINFO* fno) | Get file status |
|
||||
| 037 | f_chmod | f_chmod (const TCHAR* path, BYTE attr, BYTE mask) | Change attribute of a file/dir |
|
||||
| 038 | f_utime | f_utime (const TCHAR* path, const FILINFO* fno) | Change timestamp of a file/dir |
|
||||
| 039 | f_chdir | f_chdir (const TCHAR* path) | Change current directory |
|
||||
| 040 | f_chdrive | f_chdrive (const TCHAR* path) | Change current drive |
|
||||
| 041 | f_getcwd | f_getcwd (TCHAR* buff, UINT len) | Get current directory |
|
||||
| 042 | f_getfree | f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs) | Get number of free clusters on the drive |
|
||||
| 043 | f_getlabel | f_getlabel (const TCHAR* path, TCHAR* label, DWORD* vsn) | Get volume label |
|
||||
| 044 | f_setlabel | f_setlabel (const TCHAR* label) | Set volume label |
|
||||
| 045 | f_forward | f_forward (FIL* fp, UINT(*func)(const BYTE*,UINT), UINT btf, UINT* bf) | Forward data to the stream |
|
||||
| 046 | f_expand | f_expand (FIL* fp, FSIZE_t szf, BYTE opt) | Allocate a contiguous block to the file |
|
||||
| 004 | f_mount | f_mount (FATFS* fs, const TCHAR* path, BYTE opt) | Mount/Unmount a logical drive |
|
||||
| 007 | f_mkfs | f_mkfs (const TCHAR* path, BYTE opt, DWORD au, void* work, UINT len) | Create a FAT volume |
|
||||
| 048 | f_fdisk | f_fdisk (BYTE pdrv, const DWORD* szt, void* work) | Divide a physical drive into some partitions |
|
||||
| 049 | f_setcp | f_setcp (WORD cp) | Set current code page |
|
||||
| 050 | f_putc | f_putc (TCHAR c, FIL* fp) | Put a character to the file |
|
||||
| 051 | f_puts | f_puts (const TCHAR* str, FIL* cp) | Put a string to the file |
|
||||
| 052 | f_printf | f_printf (FIL* fp, const TCHAR* str, ...) | Put a formatted string to the file |
|
||||
| 053 | f_gets | f_gets (TCHAR* buff, int len, FIL* fp) | Get a string from the file |
|
||||
| 054 | disk_read | DRESULT disk_read ( BYTE drv, BYTE *buff, DWORD sector, UINT count ) | Read full or partial sectors directly from the SD card |
|
||||
| 055 | disk_write | DRESULT disk_write ( BYTE drv, const BYTE *buff, DWORD sector, UINT count ) | Write full or partial sectors directly to the SD card |
|
||||
| 056 | disk_ioctl | DRESULT disk_ioctl ( BYTE drv, BYTE ctrl, void *buff ) | Issue direct control commands to the SD card. |
|
||||
| 057 | getStrParam | char *getStrParam(char **ptr) | Get a pointer within a string parameter list of the next string parameter. The pointer to the string parameter list is updated to point to the next+1 parameter. within a passed parameter string. |
|
||||
| 058 | getUintParam | uint32_t getUintParam(char **ptr) | Get the next 32bit unsigned integer from a string parameter list. The pointer to the string parameter list is updated to point to the next+1 parameter. |
|
||||
| 059 | set_serial_output | __inline void set_serial_output(uint8_t c) | For boards with more than 1 serial port, assign the given device as the primary output stream device. |
|
||||
| 060 | printBytesPerSec | void printBytesPerSec(uint32_t bytes, uint32_t mSec, const char *action) | Calculate and print the performance of an SD card transaction. |
|
||||
| 061 | printFSCode | void printFSCode(FRESULT result) | Print as text the result code from the Fat FS calls. |
|
||||
| Vector No | Method | Prototype | Description |
|
||||
| --------- | ------ | --------- | ----------- |
|
||||
| 000 | _break | Break handler. | When a breakpoint instruction is encountered, method to handle it. |
|
||||
| 001 | _putchar | void putchar(char c) | Send a single character at the lowest level to serial output device. |
|
||||
| 002 | putc | void putc (char c) | Normal method to write a single character to the output stream. |
|
||||
| 003 | fputc | void fputc (void (*func)(unsigned char), char c) | Write a character to the specified output device or stream. |
|
||||
| 004 | puts | void puts (const char* str) | Put a string onto the output stream. |
|
||||
| 005 | gets | int gets (char* buff, int len) | Get a string from the input stream. |
|
||||
| 006 | fgets | int fgets (unsigned char (*func)(void), char* buff, int len) | Get a string from the specified input device or stream. |
|
||||
| 007 | fputs | void fputs (void (*func)(unsigned char), const char* str) | Put a string onto the specified output device or stream. |
|
||||
| 008 | xatoi | int xatoi (char** str, long* res) | Convert a string into a long. String can be any format or base. |
|
||||
| 009 | uxatoi | int uxatoi(char **, uint32_t *) | Convert a string into an unsigned 32bit. String can be any format or base. |
|
||||
| 010 | printf | void printf (const char* fmt, ...) | Print a formatted string onto the output stream. Floating point is not supported. |
|
||||
| 011 | vprintf | void vprintf (const char*, va_list ) | Print a varargs formatted string onto the output stream. Floating point is not supported. |
|
||||
| 012 | sprintf | void sprintf (char* buff, const char* fmt, ...) | Print a formatted string into a string. Floating point is not supported. |
|
||||
| 013 | fprintf | void fprintf (void (*func)(unsigned char), const char* fmt, ...) | Print a formatted string onto the specified output device or stream. |
|
||||
| 014 | getScreenWidth | uint8_t getScreenWidth(void) | Return the current screen width. Primarily used when zOS acts as a User OS as the screen width is dynamic, for embedded use it returns a fixed constant. |
|
||||
| 015 | getKey | int8_t getKey(uint8_t mode) | Get a single character at the lowest level from the keyboard, serial or physical. mode = 0 - host unmapped keyboard non-blocking, 1 - host unmapped keyboard blocking, 2 - ansi non-blocking, 3 - ansi blocking. Unmapped returns ANSI on a serial keyboard or the host hardware value, ie. Sharp MZ-700 keyscan code. |
|
||||
| 016 | crc32_init | unsigned int crc32_init(void) | Initialise a CRC32 generator. |
|
||||
| 017 | crc32_addword | unsigned int crc32_addword(unsigned int crc_in, unsigned int word) | Add a word into the generated CRC32, returns the current CRC32 value after adding the word. |
|
||||
| 018 | get_dword | unsigned int get_dword(void) | Get an unsigned 32bit word (binary format, big endian) from the serial input device. |
|
||||
| 019 | rtcSet | uint8_t rtcSet(RTC *time) | Set the onboard Real Time Clock to the given date and time. |
|
||||
| 020 | rtcGet | void rtcGet(RTC *time) | Get the current date and time from the onboard Real Time Clock. |
|
||||
| 021 | f_open | FRESULT f_open (FIL* fp, const TCHAR* path, BYTE mode) | Open or create a file |
|
||||
| 022 | f_close | FRESULT f_close (FIL* fp) | Close an open file object |
|
||||
| 023 | f_read | FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br) | Read data from the file |
|
||||
| 024 | f_write | FRESULT f_write (FIL* fp, const void* buff, UINT btw, UINT* bw) | Write data to the file |
|
||||
| 025 | f_lseek | FRESULT f_lseek (FIL* fp, FSIZE_t ofs) | Move file pointer of the file object |
|
||||
| 026 | f_truncate | FRESULT f_truncate (FIL* fp) | Truncate the file |
|
||||
| 027 | f_sync | FRESULT f_sync (FIL* fp) | Flush cached data of the writing file |
|
||||
| 028 | f_opendir | FRESULT f_opendir (DIR* dp, const TCHAR* path) | Open a directory |
|
||||
| 029 | f_closedir | FRESULT f_closedir (DIR* dp) | Close an open directory |
|
||||
| 030 | f_readdir | FRESULT f_readdir (DIR* dp, FILINFO* fno) | Read a directory item |
|
||||
| 031 | f_mkdir | FRESULT f_mkdir (const TCHAR* path) | Create a sub directory |
|
||||
| 032 | f_unlink | FRESULT f_unlink (const TCHAR* path) | Delete an existing file or directory |
|
||||
| 033 | f_rename | FRESULT f_rename (const TCHAR* path_old, const TCHAR* path_new) | Rename/Move a file or directory |
|
||||
| 034 | f_stat | FRESULT f_stat (const TCHAR* path, FILINFO* fno) | Get file status |
|
||||
| 035 | f_chmod | FRESULT f_chmod (const TCHAR* path, BYTE attr, BYTE mask) | Change attribute of a file/dir |
|
||||
| 036 | f_utime | FRESULT f_utime (const TCHAR* path, const FILINFO* fno) | Change timestamp of a file/dir |
|
||||
| 037 | f_chdir | FRESULT f_chdir (const TCHAR* path) | Change current directory |
|
||||
| 038 | f_chdrive | FRESULT f_chdrive (const TCHAR* path) | Change current drive |
|
||||
| 039 | f_getcwd | FRESULT f_getcwd (TCHAR* buff, UINT len) | Get current directory |
|
||||
| 040 | f_getfree | FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs) | Get number of free clusters on the drive |
|
||||
| 041 | f_getlabel | FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* vsn) | Get volume label |
|
||||
| 042 | f_setlabel | FRESULT f_setlabel (const TCHAR* label) | Set volume label |
|
||||
| 043 | f_expand | FRESULT f_expand (FIL* fp, FSIZE_t szf, BYTE opt) | Allocate a contiguous block to the file |
|
||||
| 044 | f_mount | FRESULT f_mount (FATFS* fs, const TCHAR* path, BYTE opt) | Mount/Unmount a logical drive |
|
||||
| 045 | f_mkfs | FRESULT f_mkfs (const TCHAR* path, BYTE opt, DWORD au, void* work, UINT len) | Create a FAT volume |
|
||||
| 046 | f_putc | FRESULT f_putc (TCHAR c, FIL* fp) | Put a character to the file |
|
||||
| 047 | f_gets | FRESULT f_gets (TCHAR* buff, int len, FIL* fp) | Get a string from the file |
|
||||
| 048 | disk_read | DRESULT disk_read ( BYTE drv, BYTE *buff, DWORD sector, UINT count ) | Read full or partial sectors directly from the SD card |
|
||||
| 049 | disk_write | DRESULT disk_write ( BYTE drv, const BYTE *buff, DWORD sector, UINT count ) | Write full or partial sectors directly to the SD card |
|
||||
| 050 | disk_ioctl | DRESULT disk_ioctl ( BYTE drv, BYTE ctrl, void *buff ) | Issue direct control commands to the SD card. |
|
||||
| 051 | getStrParam | char *getStrParam(char **ptr) | Get a pointer within a string parameter list of the next string parameter. The pointer to the string parameter list is updated to point to the next+1 parameter. within a passed parameter string. |
|
||||
| 052 | getUintParam | uint32_t getUintParam(char **ptr) | Get the next 32bit unsigned integer from a string parameter list. The pointer to the string parameter list is updated to point to the next+1 parameter. |
|
||||
| 053 | set_serial_output | void set_serial_output(uint8_t c) | For boards with more than 1 serial port, assign the given device as the primary output stream device. |
|
||||
| 054 | printFSCode | void printFSCode(FRESULT result) | Print as text the result code from the Fat FS calls. |
|
||||
| 055 | malloc | void \*malloc(size_t __size) | Allocate a block of memory on the heap. |
|
||||
| 056 | realloc | void *realloc(void \*__ptr, size_t __size) | Resize a block of memory, copying data if a new block is required. |
|
||||
| 057 | calloc | void \*calloc(size_t __size) | Allocate a zeroed block of memory on the heap. |
|
||||
| 058 | free | void free(void \*__ptr) | Release a block of memory back to the heap. |
|
||||
| 059 | setupZ80Pins | void setupZ80Pins(uint8_t, volatile uint32_t *) | Initialise all pins according to their Z80 function. Setup hardware to logical mapping table. |
|
||||
| 060 | resetZ80 | void resetZ80(uint8_t) | Perform a physical RESET of the Z80. |
|
||||
| 061 | reqZ80Bus | uint8_t reqZ80Bus(uint32_t) | Request control of the Z80 Bus. |
|
||||
| 062 | reqMainboardBus | uint8_t reqMainboardBus(uint32_t) | Request control of the Z80 Bus in order to access the host mainboard resources. |
|
||||
| 063 | reqTranZPUterBus | uint8_t reqTranZPUterBus(uint32_t, enum TARGETS) | Request control of the Z80 Bus in order to access the tranZPUter resources. |
|
||||
| 064 | setupSignalsForZ80Access | void setupSignalsForZ80Access(enum BUS_DIRECTION) | Setup direction of Z80 Access, Read or Write. |
|
||||
| 065 | releaseZ80 | void releaseZ80(void) | Release previously granted Z80 Bus. |
|
||||
| 066 | writeZ80Memory | uint8_t writeZ80Memory(uint32_t, uint8_t, enum TARGETS) | Write a byte to the Z80 host memory. |
|
||||
| 067 | readZ80Memory | uint8_t readZ80Memory(uint32_t) | Read a byte from the Z80 host memory. |
|
||||
| 068 | writeZ80IO | uint8_t writeZ80IO(uint32_t, uint8_t, enum TARGETS) | Write a byte to the Z80 I/O region. |
|
||||
| 069 | readZ80IO | uint8_t readZ80IO(uint32_t, enum TARGETS) | Read a byte from the Z80 I/O region. |
|
||||
| 070 | refreshZ80 | void refreshZ80(void) | Perform the next RAS refresh (for refreshing host DRAM). |
|
||||
| 071 | refreshZ80AllRows | void refreshZ80AllRows(void) | Perform a full refresh (all rows) of the host DRAM. |
|
||||
| 072 | setCtrlLatch | void setCtrlLatch(uint8_t) | Set the Memory Mode Latch to affect a different memory profile. |
|
||||
| 073 | setZ80CPUFrequency | uint32_t setZ80CPUFrequency(float, uint8_t) | Set the frequency, 1Hz to 24MHz of the Z80 CPU. |
|
||||
| 074 | copyFromZ80 | uint8_t copyFromZ80(uint8_t *, uint32_t, uint32_t, enum TARGETS) | Copy a block of memory from the Z80 host into the K64F RAM. |
|
||||
| 075 | copyToZ80 | int8_t copyToZ80(uint32_t, uint8_t *, uint32_t, enum TARGETS) | Copy a block of memory from the K64F RAM/FlashRAM to the Z80 host memory. |
|
||||
| 076 | fillZ80Memory | void fillZ80Memory(uint32_t, uint32_t, uint8_t, enum TARGETS) | Fill a block of memory hosted on the host to a set value. |
|
||||
| 077 | captureVideoFrame | void captureVideoFrame(enum VIDEO_FRAMES, uint8_t) | Capture the contents of the screen video buffer and store in local RAM. |
|
||||
| 078 | refreshVideoFrame | void refreshVideoFrame(enum VIDEO_FRAMES, uint8_t, uint8_t) | Refresh or write from the local RAM based video buffer to the host video buffer. |
|
||||
| 079 | loadVideoFrameBuffer | FRESULT loadVideoFrameBuffer(char *, enum VIDEO_FRAMES) | Load the local RAM based video buffer with the contents of a file. |
|
||||
| 080 | saveVideoFrameBuffer | FRESULT saveVideoFrameBuffer(char *, enum VIDEO_FRAMES) | Save the local RAM based video buffer to a file. |
|
||||
| 081 | getVideoFrame | char *getVideoFrame(enum VIDEO_FRAMES) | Get the address of the local RAM based video frame. |
|
||||
| 082 | getAttributeFrame | char *getAttributeFrame(enum VIDEO_FRAMES) | Get the address of the local RAM based video attribute frame. |
|
||||
| 083 | loadZ80Memory | FRESULT loadZ80Memory(const char *, uint32_t, uint32_t, uint32_t, uint32_t *, enum TARGETS, uint8_t) | Load the Z80 host memory from the contents of a file. |
|
||||
| 084 | loadMZFZ80Memory | FRESULT loadMZFZ80Memory(const char *, uint32_t, uint32_t *, enum TARGETS, uint8_t) | Load a Sharp MZF format file contents into Z80 memory. |
|
||||
| 085 | saveZ80Memory | FRESULT saveZ80Memory(const char *, uint32_t, uint32_t, t_svcDirEnt *, enum TARGETS) | Save Z80 host memory contents to a file. |
|
||||
| 086 | memoryDumpZ80 | int memoryDumpZ80(uint32_t, uint32_t, uint32_t, uint8_t, enum TARGETS) | Dump the contents of Z80 host memory to the current output device in a formatted hex format. |
|
||||
| 087 | isZ80Reset | uint8_t isZ80Reset(void) | Test to see if an external Host RESET has occurred. |
|
||||
| 088 | isZ80MemorySwapped | uint8_t isZ80MemorySwapped(void) | Sharp MZ-80A test to see if the memory from 0000 has been swapped to C000. |
|
||||
| 089 | getZ80IO | uint8_t getZ80IO(uint8_t *) | Method to get a Z80 I/O event should one have occurred since the last poll. Later versions of the tranZPUter SW board v2.x no longer need to trap Z80 I/O events so this is deprecated. |
|
||||
| 090 | clearZ80Reset | void clearZ80Reset(void) | Method to clear an external RESET event. |
|
||||
| 091 | hardResetTranZPUter | void hardResetTranZPUter(void) | Method to force a hard reset of the tranZPUter board. |
|
||||
| 092 | convertSharpFilenameToAscii | void convertSharpFilenameToAscii(char *, char *, uint8_t) | Method to convert a Sharp MZF filename into ASCII format. |
|
||||
|
||||
<div style="text-align: justify">
|
||||
The Vector No is only for reference, applications use the actual method in their code and a macro will set the correct vector call.
|
||||
<br><br>
|
||||
|
||||
As well as the above methods, two global parameter blocks are exposed and passed to the application which it can freely use. These are:
|
||||
</div>
|
||||
|
||||
The global parameter block, accessed by the variable *G*:
|
||||
|
||||
|
||||
````c
|
||||
// Global parameters accessible in applications.
|
||||
typedef struct {
|
||||
uint8_t fileInUse; /* Flag to indicate if file[0] is in use. */
|
||||
FIL File[MAX_FILE_HANDLE]; /* Maximum open file objects */
|
||||
FATFS FatFs[FF_VOLUMES]; /* Filesystem object for each logical drive */
|
||||
BYTE Buff[512]; /* Working disk buffer */
|
||||
DWORD Sector; /* Sector to read */
|
||||
uint8_t fileInUse; // Flag to indicate if file[0] is in use.
|
||||
FIL File[MAX_FILE_HANDLE]; // Maximum open file objects
|
||||
FATFS FatFs[FF_VOLUMES]; // Filesystem object for each logical drive
|
||||
BYTE Buff[512]; // Working disk buffer
|
||||
DWORD Sector; // Sector to read
|
||||
#if defined __K64F__
|
||||
uint32_t volatile *millis; /* Pointer to the K64F millisecond tick */
|
||||
uint32_t volatile *millis; // Pointer to the K64F millisecond tick
|
||||
#endif
|
||||
#if defined __TRANZPUTER__
|
||||
int ctrlThreadId; // Id of tranZPUter control thread.
|
||||
uint8_t ctrlThreadBusy; // Flag to indicate when the control thread cannot be disturbed.
|
||||
#endif
|
||||
} GLOBALS;
|
||||
````
|
||||
An example of use within a program would be: xprintf("Sector:%d\n", G->Sector);
|
||||
An example of use within a program would be: <br>
|
||||
|
||||
printf("Sector:%d\n", G->Sector);
|
||||
|
||||
The configuration block, accessed by the variable *cfgSoC*:
|
||||
|
||||
@@ -389,19 +459,30 @@ typedef struct
|
||||
uint8_t timer1No;
|
||||
} SOC_CONFIG;
|
||||
````
|
||||
An example of use in a program would be: if(cfgSoC->implSDRAM) { ... }
|
||||
|
||||
An example of use in a program would be: <br>
|
||||
|
||||
if(cfgSoC->implSDRAM) { ... }
|
||||
|
||||
|
||||
<div style="text-align: justify">
|
||||
To build an application, it is the same as creating a normal C program (C++ to follow) but instead of using the standard 'main' entry point with argument list a new method has been
|
||||
provided, namely 'app'. This has the prototype:
|
||||
provided, namely 'app'.
|
||||
</div>
|
||||
|
||||
uint32_t app(uint32_t param1, uint32_t param2)
|
||||
This has the prototype:
|
||||
|
||||
param1 and param2 can be any 32bit value passed when fileExec is called within ZPUTA. Under standard operating conditions, ZPUTA calls an application with one parameter only, param1 which is
|
||||
uint32_t app(uint32_t param1, uint32_t param2)
|
||||
|
||||
<div style="text-align: justify">
|
||||
param1 and param2 can be any 32bit value passed when fileExec is called within zOS. Under standard operating conditions, zOS calls an application with one parameter only, param1 which is
|
||||
a (char *) pointer to the command line parameters which invoked the application.
|
||||
<br><br>
|
||||
|
||||
The return code from the application to ZPUTA is a 32bit unsigned integer. 0 means the application executed successfully, 0xFFFFFFFF indicates a failure and anything inbetween is for reference or to be used
|
||||
by future commands for conditional processing.
|
||||
The return code from the application to zOS is a 32bit unsigned integer. 0 means the application executed successfully, 0xFFFFFFFF indicates a failure and anything inbetween is for a more detailed failure,
|
||||
reference or to be used by future commands for conditional processing.
|
||||
<br><br>
|
||||
</div>
|
||||
|
||||
The standard template for an app() is as follows:
|
||||
|
||||
@@ -428,11 +509,11 @@ uint32_t app(uint32_t param1, uint32_t param2)
|
||||
|
||||
if (!xatoi(&ptr, &startAddr))
|
||||
{
|
||||
xprintf("Illegal <start addr> value.\n");
|
||||
printf("Illegal <start addr> value.\n");
|
||||
retCode = 0xFFFFFFFF;
|
||||
} else if (!xatoi(&ptr, &endAddr))
|
||||
{
|
||||
xprintf("Illegal <end addr> value.\n");
|
||||
printf("Illegal <end addr> value.\n");
|
||||
retCode = 0xFFFFFFFF;
|
||||
} else
|
||||
{
|
||||
@@ -453,29 +534,29 @@ uint32_t app(uint32_t param1, uint32_t param2)
|
||||
}
|
||||
````
|
||||
|
||||
|
||||
## Software Build
|
||||
|
||||
### Paths
|
||||
|
||||
For ease of reading, the following shortnames refer to the corresponding path in this chapter.
|
||||
|
||||
| Short Name | |
|
||||
|------------------|----------------------------------------------------------------------------|
|
||||
| \[\<ABS PATH>\] | The path where this repository was extracted on your system. |
|
||||
| \<apps\> | \[\<ABS PATH>\]/zsoft/apps |
|
||||
| \<build\> | \[\<ABS PATH>\]/zsoft/build |
|
||||
| \<common\> | \[\<ABS PATH>\]/zsoft/common |
|
||||
| \<libraries\> | \[\<ABS PATH>\]/zsoft/libraries |
|
||||
| \<teensy3\> | \[\<ABS PATH>\]/zsoft/teensy3 |
|
||||
| \<include\> | \[\<ABS PATH>\]/zsoft/include |
|
||||
| \<startup\> | \[\<ABS PATH>\]/zsoft/startup |
|
||||
| \<iocp\> | \[\<ABS PATH>\]/zsoft/iocp |
|
||||
| \<zOS\> | \[\<ABS PATH>\]/zsoft/zOS |
|
||||
| \<zputa\> | \[\<ABS PATH>\]/zsoft/zputa |
|
||||
| \<rtl\> | \[\<ABS PATH>\]/zsoft/rtl |
|
||||
| \<docs\> | \[\<ABS PATH>\]/zsoft/docs |
|
||||
| \<tools\> | \[\<ABS PATH>\]/zsoft/tools |
|
||||
|
||||
| Short Name | Path | Description |
|
||||
|------------------|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
|
||||
| \[\<ABS PATH>\] | The path where this repository was extracted on your system. | |
|
||||
| \<apps\> | \[\<ABS PATH>\]/zsoft/apps | Application directory. All zOS/ZPUTA applications are located here along with their makefiles. |
|
||||
| \<build\> | \[\<ABS PATH>\]/zsoft/build | A target output directory for the compiled software, ie. \<z-build\>/SD contains all files to be written to an SD card. |
|
||||
| \<common\> | \[\<ABS PATH>\]/zsoft/common | Common C/C++ methods which are not assembled into a library. |
|
||||
| \<libraries\> | \[\<ABS PATH>\]/zsoft/libraries | C/C++ libraries, usually part of a C/C++ installation but for embedded work, especially on the ZPU need to be created seperately. | |
|
||||
| \<teensy3\> | \[\<ABS PATH>\]/zsoft/teensy3 | The K64F based Teensy 3.5 software, some of which is used in the K64F version of zOS. Very rich libraries and can be easily added into a K64F programs. | |
|
||||
| \<include\> | \[\<ABS PATH>\]/zsoft/include | Common include header files. | |
|
||||
| \<startup\> | \[\<ABS PATH>\]/zsoft/startup | Embedded processor startup files, generally in Assembler. Templates and macros are used to create the correct targets memory model startup code. | |
|
||||
| \<iocp\> | \[\<ABS PATH>\]/zsoft/iocp | The IO Control Program, my initial bootloader for bootstrapping an application on the ZPU. | |
|
||||
| \<zOS\> | \[\<ABS PATH>\]/zsoft/zOS | The zOS source code, parameterised for the different target CPU's. | |
|
||||
| \<zputa\> | \[\<ABS PATH>\]/zsoft/zputa | The ZPUTA source code, parameterised for the different target CPU's. | |
|
||||
| \<rtl\> | \[\<ABS PATH>\]/zsoft/rtl | Register Transfer Level files. These are generated memory definition and initialisation files required when building for a ZPU target project. | |
|
||||
| \<docs\> | \[\<ABS PATH>\]/zsoft/docs | Any relevant documentation for the software. | |
|
||||
| \<tools\> | \[\<ABS PATH>\]/zsoft/tools | Tools to aid in the compilation and creation of target files. | |
|
||||
|
||||
|
||||
### Tools
|
||||
@@ -521,12 +602,12 @@ NAME
|
||||
build.sh - Shell script to build a ZPU/K64F program or OS.
|
||||
|
||||
SYNOPSIS
|
||||
build.sh [-CIOoMBAsdxh]
|
||||
build.sh [-CIOoMBAsTZdxh]
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
OPTIONS
|
||||
-C <CPU> = Small, Medium, Flex, Evo, K64F - defaults to Evo.
|
||||
-C <CPU> = Small, Medium, Flex, Evo, EvoMin, K64F - defaults to Evo.
|
||||
-I <iocp ver> = 0 - Full, 1 - Medium, 2 - Minimum, 3 - Tiny (bootstrap only)
|
||||
-O <os> = zputa, zos
|
||||
-o <os ver> = 0 - Standalone, 1 - As app with IOCP Bootloader,
|
||||
@@ -540,6 +621,8 @@ OPTIONS
|
||||
-s <size> = Required size of application stack
|
||||
-a <size> = Maximum size of an app, defaults to (BRAM SIZE - App Start Address - Stack Size)
|
||||
if the App Start is located within BRAM otherwise defaults to 0x10000.
|
||||
-T = TranZPUter specific build, adds initialisation and setup code.
|
||||
-Z = Sharp MZ series ZPU build, zOS runs as an OS host on Sharp MZ hardware.
|
||||
-d = Debug mode.
|
||||
-x = Shell trace mode.
|
||||
-h = This help screen.
|
||||
@@ -569,10 +652,38 @@ Sensible defaults are configured into the script, the overriding flags are descr
|
||||
| -S \<size\> | Required size of stack. Normally the \<os\> manages the stack which is also used by an application. If the application is considered dangerous then it should be allocated a local stack. |
|
||||
| -s \<size\> | Required size of application stack. Normally this should not be required as the application shares the \<os\> stack. If the application is dangerous then set this value to allocate a local stack. |
|
||||
| -a \<size\> | Maximum size of an application.<br>*defaults to (BRAM SIZE - App Start Address - Stack Size) for the ZPU if the App Start is located within BRAM otherwise defaults to 0x10000, or 0x20030000 - Stack Size - Heap Size - 0x4000 for the K64F. If the App Start is located within BRAM otherwise defaults to 0x10000.* |
|
||||
| -T | TranZPUter specific build, adds initialisation and setup code. Build as an embedded OS for the tranZPUter board. |
|
||||
| -Z | Sharp MZ series ZPU build, zOS runs as an OS host on Sharp MZ hardware. Build as a host OS for the Sharp MZ series computer running a ZPU/NIOSII as the host processor. |
|
||||
| -d | Debug mode. Enable more verbose output on state and decisions made by the script. |
|
||||
| -x | Shell trace mode. A very low level, line by line trace of shell execution. Only used during debugging. |
|
||||
| -h | This help screen. |
|
||||
|
||||
<br>
|
||||
To build the standard zOS to be run on a Freescale K64F processor, you would issue the command:
|
||||
|
||||
```bash
|
||||
<ABS PATH>/build.sh -C K64F -O zos -B 0x00000000 -N 0x00002000 -S 0x00001000 -A 0x1FFF0000 -n 0x00020000 -s 0x00000000
|
||||
```
|
||||
|
||||
This specifies that the:
|
||||
|
||||
* target CPU is the K64F processor (-C K64F),
|
||||
* target OS is zOS (-O zos),
|
||||
* base or starting address of the generated firmware is 0x00000000 (-B 0x00000000),
|
||||
* heap for zOS is 0x00002000 bytes in size (-N 0x00002000),
|
||||
* the stack for zOS is 0x000010000 bytes in size (-S 0x000010000),
|
||||
* starting address for applications is base of RAM at 0x1FFF0000 (-A 0x1FFF0000),
|
||||
* application heap size is 0x00020000 (-n 0x00020000),
|
||||
* application doesnt have a local stack (-s 0x00000000).
|
||||
|
||||
When complete, the output will be stored in two locations:<br>
|
||||
|
||||
````bash
|
||||
<zOS>/main.(hex | bin | srec) - The main zOS firmware in 3 standard formats which can be flashed directly into the K64F FlashRAM at 0x00000000.<br>
|
||||
<build>/SD - Applications (and kernels if using the ZPU processor with IOCP) which can be copied directly to a FAT32 formatted SD card.<br>
|
||||
````
|
||||
|
||||
<br>
|
||||
|
||||
Jenkins can be used to automate the build but for simple get up and go compilation use the build.sh and the underlying hierarchical Makefile system by following the basic instructions here.
|
||||
|
||||
@@ -608,7 +719,6 @@ Jenkins can be used to automate the build but for simple get up and go compilati
|
||||
Where I have used or based any component on a 3rd parties design I have included the original authors copyright notice within the headers or given due credit. All 3rd party software, to my knowledge and research, is open source and freely useable, if there is found to be any component with licensing restrictions, it will be removed from this repository and a suitable link/config provided.
|
||||
|
||||
|
||||
<br>
|
||||
## Licenses
|
||||
|
||||
The original ZPU uses the Free BSD license and such the Evo is also released under FreeBSD. SoC components and other developments written by me are currently licensed using the GPL. 3rd party components maintain their original copyright notices.
|
||||
|
||||
2
build.sh
2
build.sh
@@ -4,7 +4,7 @@
|
||||
# build.sh - Shell script to build a ZPU/K64F program or OS.
|
||||
#
|
||||
# SYNOPSIS
|
||||
# build.sh [-CIOoMBAsdxh]
|
||||
# build.sh [-CIOoMBAsTZdxh]
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
|
||||
@@ -271,9 +271,6 @@ static void setupIRQ(void)
|
||||
// Setup the IRQ for Z80_RESET.
|
||||
installIRQ(Z80_RESET, IRQ_MASK_FALLING);
|
||||
|
||||
// Setup the IRQ for Z80_RESET.
|
||||
installIRQ(Z80_RESET, IRQ_MASK_FALLING);
|
||||
|
||||
// Remove previous interrupts not needed in this mode.
|
||||
removeIRQ(Z80_IORQ);
|
||||
|
||||
@@ -281,6 +278,29 @@ static void setupIRQ(void)
|
||||
NVIC_SET_PRIORITY(IRQ_PORTD, 0);
|
||||
NVIC_SET_PRIORITY(IRQ_PORTE, 16);
|
||||
break;
|
||||
|
||||
// The MZ800 we setup for RESET and SVCREQ handling, everything else ignored.
|
||||
case MZ800:
|
||||
// Install the dummy method to be called when PortE triggers.
|
||||
_VectorsRam[IRQ_PORTE + 16] = irqPortE;
|
||||
|
||||
// Install the method to be called when PortD triggers.
|
||||
_VectorsRam[IRQ_PORTD + 16] = irqPortD;
|
||||
|
||||
// Setup the IRQ for CTL_SVCREQ.
|
||||
installIRQ(CTL_SVCREQ, IRQ_MASK_LOW);
|
||||
|
||||
// Setup the IRQ for Z80_RESET.
|
||||
installIRQ(Z80_RESET, IRQ_MASK_FALLING);
|
||||
|
||||
// Remove previous interrupts not needed in this mode.
|
||||
removeIRQ(Z80_IORQ);
|
||||
|
||||
// Set relevant priorities to meet latency.
|
||||
NVIC_SET_PRIORITY(IRQ_PORTD, 0);
|
||||
NVIC_SET_PRIORITY(IRQ_PORTE, 16);
|
||||
break;
|
||||
|
||||
|
||||
// For the MZ80B we need to enable IORQ to process the OUT statements the Z80 generates for memory mode selection and I/O.
|
||||
case MZ80B:
|
||||
@@ -373,6 +393,15 @@ static void restoreIRQ(void)
|
||||
// Setup the IRQ for Z80_RESET.
|
||||
installIRQ(Z80_RESET, IRQ_MASK_FALLING);
|
||||
break;
|
||||
|
||||
// The MZ800 just needs to enable IORQ to process the OUT statements the Z80 generates for memory mode selection.
|
||||
case MZ800:
|
||||
// Setup the IRQ for CTL_SVCREQ.
|
||||
installIRQ(CTL_SVCREQ, IRQ_MASK_LOW);
|
||||
|
||||
// Setup the IRQ for Z80_RESET.
|
||||
installIRQ(Z80_RESET, IRQ_MASK_FALLING);
|
||||
break;
|
||||
|
||||
// For the MZ80B we need to enable IORQ to process the OUT statements the Z80 generates for memory mode selection and I/O.
|
||||
case MZ80B:
|
||||
@@ -1756,7 +1785,7 @@ FRESULT saveZ80Memory(const char *dst, uint32_t addr, uint32_t size, t_svcDirEnt
|
||||
// Sanity check on filenames.
|
||||
if(dst == NULL || size == 0)
|
||||
return(FR_INVALID_PARAMETER);
|
||||
|
||||
|
||||
// Try and create the destination file.
|
||||
fr0 = f_open(&File, dst, FA_CREATE_ALWAYS | FA_WRITE);
|
||||
|
||||
@@ -2012,6 +2041,23 @@ void convertSharpFilenameToAscii(char *dst, char *src, uint8_t size)
|
||||
return;
|
||||
}
|
||||
|
||||
// Helper method to convert a Sharp ASCII filename to one acceptable for use in the FAT32 filesystem.
|
||||
//
|
||||
void convertToFAT32FileNameFormat(char *dst)
|
||||
{
|
||||
// Go through the given filename and change any characters which FAT32 doesnt support. This is necessary as the Sharp filenaming convention allows
|
||||
// for almost any character!
|
||||
//
|
||||
for(int idx=0; idx < strlen(dst); idx++)
|
||||
{
|
||||
if(dst[idx] == '/')
|
||||
{
|
||||
dst[idx] = '-';
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// tranZPUter i/f methods for zOS - handling and control //
|
||||
// //
|
||||
@@ -2091,11 +2137,24 @@ void loadTranZPUterDefaultROMS(uint8_t cpuConfig)
|
||||
break;
|
||||
|
||||
case MZ800:
|
||||
//result = loadBIOS(MZ_ROM_1Z_013A_40C, MZ700, MZ_MROM_ADDR);
|
||||
// The MZ-800 uses a composite ROM containing the modified BIOS of the MZ-700 (1Z_013B), the IPL of the MZ-800 (9Z_504M), the CGROM for video text output
|
||||
// and the IOCS, a BASIC common code area,
|
||||
//
|
||||
// First we load the MZ-700 compatible BIOS.
|
||||
printf("Loading 1Z_013B\n");
|
||||
result = loadBIOS(MZ_ROM_1Z_013B, MZ800, MZ_MROM_ADDR);
|
||||
|
||||
// Next we load the modified 9Z-504M - modified to add an option to start TZFS.
|
||||
printf("Loading 9Z_504M\n");
|
||||
result = loadBIOS(MZ_ROM_9Z_504M, MZ800, MZ_800_IPL_ADDR);
|
||||
|
||||
// Finally we load the common IOCS.
|
||||
printf("Loading IOCS\n");
|
||||
result = loadBIOS(MZ_ROM_800_IOCS, MZ800, MZ_800_IOCS_ADDR);
|
||||
break;
|
||||
|
||||
case MZ80B:
|
||||
result = loadBIOS(MZ_ROM_MZ80B_IPL, MZ700, MZ_MROM_ADDR);
|
||||
result = loadBIOS(MZ_ROM_MZ80B_IPL, MZ700, MZ_MROM_ADDR);
|
||||
break;
|
||||
|
||||
case MZ80A:
|
||||
@@ -2103,21 +2162,25 @@ void loadTranZPUterDefaultROMS(uint8_t cpuConfig)
|
||||
result = loadBIOS(MZ_ROM_SA1510_40C, MZ80A, MZ_MROM_ADDR);
|
||||
break;
|
||||
}
|
||||
if(!result && (result=loadZ80Memory((const char *)MZ_ROM_TZFS, 0, MZ_UROM_ADDR, 0x1800, 0, TRANZPUTER, 1) != FR_OK))
|
||||
// The MZ-800 architecure occupies the TZFS memory area, so we dont load TZFS at this point. If the user selects TZFS then a request to load will be made.
|
||||
if(z80Control.hostType != MZ800)
|
||||
{
|
||||
printf("Error: Failed to load bank 1 of %s into tranZPUter memory.\n", MZ_ROM_TZFS);
|
||||
}
|
||||
if(!result && (result=loadZ80Memory((const char *)MZ_ROM_TZFS, 0x1800, MZ_BANKRAM_ADDR+0x10000, 0x1000, 0, TRANZPUTER, 1) != FR_OK))
|
||||
{
|
||||
printf("Error: Failed to load page 2 of %s into tranZPUter memory.\n", MZ_ROM_TZFS);
|
||||
}
|
||||
if(!result && (result=loadZ80Memory((const char *)MZ_ROM_TZFS, 0x2800, MZ_BANKRAM_ADDR+0x20000, 0x1000, 0, TRANZPUTER, 1) != FR_OK))
|
||||
{
|
||||
printf("Error: Failed to load page 3 of %s into tranZPUter memory.\n", MZ_ROM_TZFS);
|
||||
}
|
||||
if(!result && (result=loadZ80Memory((const char *)MZ_ROM_TZFS, 0x3800, MZ_BANKRAM_ADDR+0x30000, 0x1000, 0, TRANZPUTER, 1) != FR_OK))
|
||||
{
|
||||
printf("Error: Failed to load page 4 of %s into tranZPUter memory.\n", MZ_ROM_TZFS);
|
||||
if(!result && (result=loadZ80Memory((const char *)MZ_ROM_TZFS, 0, MZ_UROM_ADDR, 0x1800, 0, TRANZPUTER, 1) != FR_OK))
|
||||
{
|
||||
printf("Error: Failed to load bank 1 of %s into tranZPUter memory.\n", MZ_ROM_TZFS);
|
||||
}
|
||||
if(!result && (result=loadZ80Memory((const char *)MZ_ROM_TZFS, 0x1800, MZ_BANKRAM_ADDR+0x10000, 0x1000, 0, TRANZPUTER, 1) != FR_OK))
|
||||
{
|
||||
printf("Error: Failed to load page 2 of %s into tranZPUter memory.\n", MZ_ROM_TZFS);
|
||||
}
|
||||
if(!result && (result=loadZ80Memory((const char *)MZ_ROM_TZFS, 0x2800, MZ_BANKRAM_ADDR+0x20000, 0x1000, 0, TRANZPUTER, 1) != FR_OK))
|
||||
{
|
||||
printf("Error: Failed to load page 3 of %s into tranZPUter memory.\n", MZ_ROM_TZFS);
|
||||
}
|
||||
if(!result && (result=loadZ80Memory((const char *)MZ_ROM_TZFS, 0x3800, MZ_BANKRAM_ADDR+0x30000, 0x1000, 0, TRANZPUTER, 1) != FR_OK))
|
||||
{
|
||||
printf("Error: Failed to load page 4 of %s into tranZPUter memory.\n", MZ_ROM_TZFS);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2143,8 +2206,15 @@ void loadTranZPUterDefaultROMS(uint8_t cpuConfig)
|
||||
// If autoboot flag set, force a restart to the ROM which will call User ROM startup code.
|
||||
if(osControl.tzAutoBoot)
|
||||
{
|
||||
// Set the memory model to BOOT so we can bootstrap TZFS.
|
||||
resetZ80(TZMM_BOOT);
|
||||
if(z80Control.hostType != MZ800)
|
||||
{
|
||||
// Set the memory model to BOOT so we can bootstrap TZFS.
|
||||
resetZ80(TZMM_BOOT);
|
||||
} else
|
||||
{
|
||||
// The MZ-800 wants to run the original software so reset leaving the memory mode as original.
|
||||
resetZ80(TZMM_ORIG);
|
||||
}
|
||||
}
|
||||
}
|
||||
// For the T80 we just issue a soft reset.
|
||||
@@ -3297,7 +3367,7 @@ uint8_t svcSaveFile(enum FILE_TYPE type)
|
||||
// Setup the defaults
|
||||
//
|
||||
svcSetDefaults(type);
|
||||
|
||||
|
||||
// MZF are handled with their own methods as it involves looking into the file to determine the name and details.
|
||||
//
|
||||
if(type == MZF)
|
||||
@@ -3313,6 +3383,9 @@ uint8_t svcSaveFile(enum FILE_TYPE type)
|
||||
//
|
||||
sprintf(fqfn, "0:\\%s\\%s.%s", svcControl.directory, asciiFileName, TZSVC_DEFAULT_MZF_EXT);
|
||||
|
||||
// Convert any non-FAT32 characters prior to save.
|
||||
convertToFAT32FileNameFormat(fqfn);
|
||||
|
||||
// Call the main method to save memory passing in the correct MZF details and header.
|
||||
result = saveZ80Memory(fqfn, (mzfHeader.loadAddr < MZ_CMT_DEFAULT_LOAD_ADDR-3 ? MZ_CMT_DEFAULT_LOAD_ADDR : mzfHeader.loadAddr), mzfHeader.fileSize, &mzfHeader, TRANZPUTER);
|
||||
} else
|
||||
@@ -3322,6 +3395,9 @@ uint8_t svcSaveFile(enum FILE_TYPE type)
|
||||
{
|
||||
// Build the full filename from what has been provided.
|
||||
sprintf(fqfn, "0:\\%s\\%s.%s", svcControl.directory, svcControl.filename, type == CAS ? TZSVC_DEFAULT_CAS_EXT : TZSVC_DEFAULT_BAS_EXT);
|
||||
|
||||
// Convert any non-FAT32 characters prior to save.
|
||||
convertToFAT32FileNameFormat(fqfn);
|
||||
|
||||
// Call the main method to save memory passing in the correct details from the service record.
|
||||
result = saveZ80Memory(fqfn, svcControl.saveAddr, svcControl.saveSize, NULL, TRANZPUTER);
|
||||
@@ -3783,6 +3859,18 @@ void processServiceRequest(void)
|
||||
setZ80CPUFrequency(MZ_700_CPU_FREQ, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
// Load the MZ800 9Z-504M bios into memory for compatibility switch.
|
||||
case TZSVC_CMD_LOAD800BIOS:
|
||||
loadBIOS(MZ_ROM_9Z_504M, MZ800, MZ_MROM_ADDR);
|
||||
|
||||
// Set the frequency of the CPU if we are emulating the hardware.
|
||||
if(z80Control.hostType != MZ800)
|
||||
{
|
||||
// Change frequency to match Sharp MZ-800
|
||||
setZ80CPUFrequency(MZ_800_CPU_FREQ, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
// Load the MZ-80B IPL ROM into memory for compatibility switch.
|
||||
case TZSVC_CMD_LOAD80BIPL:
|
||||
@@ -3966,7 +4054,7 @@ uint8_t testTZFSAutoBoot(void)
|
||||
}
|
||||
|
||||
// Method to identify the type of host the tranZPUter SW is running on. Originally it was only the MZ80A but the scope has expanded
|
||||
// to the MZ-700 and MZ-80B and potentially a plethora of other machines in the future.
|
||||
// to the MZ-700, MZ-80B, MZ-800 and potentially a plethora of other machines in the future.
|
||||
//
|
||||
void setHost(void)
|
||||
{
|
||||
|
||||
@@ -177,6 +177,8 @@
|
||||
// Sharp MZ constants.
|
||||
//
|
||||
#define MZ_MROM_ADDR 0x0000 // Monitor ROM start address.
|
||||
#define MZ_800_IPL_ADDR 0xE000 // Address of the 9Z_504M IPL BIOS.
|
||||
#define MZ_800_IOCS_ADDR 0xF400 // Address of the MZ-800 common IOCS bios.
|
||||
#define MZ_MROM_STACK_ADDR 0x1000 // Monitor ROM start stack address.
|
||||
#define MZ_MROM_STACK_SIZE 0x0200 // Monitor ROM stack size.
|
||||
#define MZ_UROM_ADDR 0xE800 // User ROM start address.
|
||||
@@ -199,12 +201,17 @@
|
||||
#define MZ_80A_CPU_FREQ 2000000 // CPU Speed of the Sharp MZ-80A
|
||||
#define MZ_700_CPU_FREQ 3580000 // CPU Speed of the Sharp MZ-700
|
||||
#define MZ_80B_CPU_FREQ 4000000 // CPU Speed of the Sharp MZ-80B
|
||||
#define MZ_800_CPU_FREQ 3580000 // CPU Speed of the Sharp MZ-800
|
||||
#define MZ_ROM_SA1510_40C "0:\\TZFS\\SA1510.ROM" // Original 40 character Monitor ROM.
|
||||
#define MZ_ROM_SA1510_80C "0:\\TZFS\\SA1510-8.ROM" // Original Monitor ROM patched for 80 character screen mode.
|
||||
#define MZ_ROM_1Z_013A_40C "0:\\TZFS\\1Z-013A.ROM" // Original 40 character Monitor ROM for the Sharp MZ700.
|
||||
#define MZ_ROM_1Z_013A_80C "0:\\TZFS\\1Z-013A-8.ROM" // Original Monitor ROM patched for the Sharp MZ700 patched for 80 column mode.
|
||||
#define MZ_ROM_1Z_013A_KM_40C "0:\\TZFS\\1Z-013A-KM.ROM" // Original 40 character Monitor ROM for the Sharp MZ700 with keyboard remapped for the MZ80A.
|
||||
#define MZ_ROM_1Z_013A_KM_80C "0:\\TZFS\\1Z-013A-KM-8.ROM" // Original Monitor ROM patched for the Sharp MZ700 with keyboard remapped for the MZ80A and patched for 80 column mode.
|
||||
#define MZ_ROM_9Z_504M_COMBINED "0:\\TZFS\\MZ800_IPL.rom" // Original MZ-800 BIOS which comprises the 1Z_013B BIOS, 9Z_504M IPL, CGROM and IOCS.
|
||||
#define MZ_ROM_9Z_504M "0:\\TZFS\\MZ800_9Z_504M.rom" // Modified MZ-800 9Z_504M IPL to contain a select TZFS option.
|
||||
#define MZ_ROM_1Z_013B "0:\\TZFS\\MZ800_1Z_013B.rom" // Original MZ-800 1Z_013B MZ-700 compatible BIOS.
|
||||
#define MZ_ROM_800_IOCS "0:\\TZFS\\MZ800_IOCS.rom" // Original MZ-800 common IOCS bios.
|
||||
#define MZ_ROM_MZ80B_IPL "0:\\TZFS\\MZ80B_IPL.ROM" // Original IPL ROM for the Sharp MZ-80B.
|
||||
#define MZ_ROM_TZFS "0:\\TZFS\\TZFS.ROM" // tranZPUter Filing System ROM.
|
||||
#define MZ_ROM_ZPU_ZOS "0:\\ZOS\\ZOS.ROM" // zOS for the ZPU running on the tranZPUter SW-700 board.
|
||||
@@ -246,6 +253,7 @@
|
||||
#define TZSVC_CMD_LOAD700BIOS40 0x22 // Service command requesting that the MZ700 1Z-013A 40 column BIOS is loaded.
|
||||
#define TZSVC_CMD_LOAD700BIOS80 0x23 // Service command requesting that the MZ700 1Z-013A 80 column patched BIOS is loaded.
|
||||
#define TZSVC_CMD_LOAD80BIPL 0x24 // Service command requesting the MZ-80B IPL is loaded.
|
||||
#define TZSVC_CMD_LOAD800BIOS 0x25 // Service command requesting that the MZ800 9Z-504M BIOS is loaded.
|
||||
#define TZSVC_CMD_LOADBDOS 0x30 // Service command to reload CPM BDOS+CCP.
|
||||
#define TZSVC_CMD_ADDSDDRIVE 0x31 // Service command to attach a CPM disk to a drive number.
|
||||
#define TZSVC_CMD_READSDDRIVE 0x32 // Service command to read an attached SD file as a CPM disk drive.
|
||||
@@ -763,6 +771,7 @@ uint8_t reqTranZPUterBus(uint32_t, enum TARGETS);
|
||||
void setupSignalsForZ80Access(enum BUS_DIRECTION);
|
||||
void releaseZ80(void);
|
||||
void refreshZ80(void);
|
||||
void refreshZ80AllRows(void);
|
||||
void setCtrlLatch(uint8_t);
|
||||
uint32_t setZ80CPUFrequency(float, uint8_t);
|
||||
uint8_t copyFromZ80(uint8_t *, uint32_t, uint32_t, enum TARGETS);
|
||||
@@ -790,6 +799,7 @@ uint8_t isZ80MemorySwapped(void);
|
||||
uint8_t getZ80IO(uint8_t *);
|
||||
void clearZ80Reset(void);
|
||||
void convertSharpFilenameToAscii(char *, char *, uint8_t);
|
||||
void convertToFAT32FileNameFormat(char *);
|
||||
|
||||
// tranZPUter OS i/f methods.
|
||||
uint8_t setZ80SvcStatus(uint8_t);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -16006,11 +16006,11 @@ shared variable ram : ram_type :=
|
||||
16968 => x"7a4f5300",
|
||||
16969 => x"2a2a2025",
|
||||
16970 => x"73202800",
|
||||
16971 => x"30342f30",
|
||||
16972 => x"322f3230",
|
||||
16971 => x"30362f30",
|
||||
16972 => x"332f3230",
|
||||
16973 => x"32310000",
|
||||
16974 => x"76312e31",
|
||||
16975 => x"65000000",
|
||||
16975 => x"66000000",
|
||||
16976 => x"205a5055",
|
||||
16977 => x"2c207265",
|
||||
16978 => x"76202530",
|
||||
|
||||
@@ -34858,7 +34858,7 @@ architecture arch of DualPort3264BootBRAM is
|
||||
7459 => x"20",
|
||||
7460 => x"7a",
|
||||
7461 => x"73",
|
||||
7462 => x"32",
|
||||
7462 => x"33",
|
||||
7463 => x"76",
|
||||
7464 => x"20",
|
||||
7465 => x"76",
|
||||
@@ -62175,7 +62175,7 @@ architecture arch of DualPort3264BootBRAM is
|
||||
7458 => x"20",
|
||||
7459 => x"00",
|
||||
7460 => x"2a",
|
||||
7461 => x"34",
|
||||
7461 => x"36",
|
||||
7462 => x"31",
|
||||
7463 => x"00",
|
||||
7464 => x"20",
|
||||
@@ -71283,7 +71283,7 @@ architecture arch of DualPort3264BootBRAM is
|
||||
7460 => x"2a",
|
||||
7461 => x"30",
|
||||
7462 => x"32",
|
||||
7463 => x"65",
|
||||
7463 => x"66",
|
||||
7464 => x"2c",
|
||||
7465 => x"32",
|
||||
7466 => x"73",
|
||||
|
||||
@@ -51403,7 +51403,7 @@ architecture arch of DualPortBootBRAM is
|
||||
14920 => x"4f",
|
||||
14921 => x"2a",
|
||||
14922 => x"20",
|
||||
14923 => x"34",
|
||||
14923 => x"36",
|
||||
14924 => x"2f",
|
||||
14925 => x"31",
|
||||
14926 => x"31",
|
||||
@@ -69610,10 +69610,10 @@ architecture arch of DualPortBootBRAM is
|
||||
14921 => x"2a",
|
||||
14922 => x"73",
|
||||
14923 => x"30",
|
||||
14924 => x"32",
|
||||
14924 => x"33",
|
||||
14925 => x"32",
|
||||
14926 => x"76",
|
||||
14927 => x"65",
|
||||
14927 => x"66",
|
||||
14928 => x"20",
|
||||
14929 => x"2c",
|
||||
14930 => x"76",
|
||||
|
||||
@@ -51398,7 +51398,7 @@ architecture arch of SinglePortBootBRAM is
|
||||
14920 => x"4f",
|
||||
14921 => x"2a",
|
||||
14922 => x"20",
|
||||
14923 => x"34",
|
||||
14923 => x"36",
|
||||
14924 => x"2f",
|
||||
14925 => x"31",
|
||||
14926 => x"31",
|
||||
@@ -69605,10 +69605,10 @@ architecture arch of SinglePortBootBRAM is
|
||||
14921 => x"2a",
|
||||
14922 => x"73",
|
||||
14923 => x"30",
|
||||
14924 => x"32",
|
||||
14924 => x"33",
|
||||
14925 => x"32",
|
||||
14926 => x"76",
|
||||
14927 => x"65",
|
||||
14927 => x"66",
|
||||
14928 => x"20",
|
||||
14929 => x"2c",
|
||||
14930 => x"76",
|
||||
|
||||
@@ -14985,11 +14985,11 @@ shared variable ram : ram_type :=
|
||||
14920 => x"7a4f5300",
|
||||
14921 => x"2a2a2025",
|
||||
14922 => x"73202800",
|
||||
14923 => x"30342f30",
|
||||
14924 => x"322f3230",
|
||||
14923 => x"30362f30",
|
||||
14924 => x"332f3230",
|
||||
14925 => x"32310000",
|
||||
14926 => x"76312e31",
|
||||
14927 => x"65000000",
|
||||
14927 => x"66000000",
|
||||
14928 => x"205a5055",
|
||||
14929 => x"2c207265",
|
||||
14930 => x"76202530",
|
||||
|
||||
@@ -34858,7 +34858,7 @@ architecture arch of DualPort3264BootBRAM is
|
||||
7459 => x"20",
|
||||
7460 => x"7a",
|
||||
7461 => x"73",
|
||||
7462 => x"32",
|
||||
7462 => x"33",
|
||||
7463 => x"76",
|
||||
7464 => x"20",
|
||||
7465 => x"76",
|
||||
@@ -62175,7 +62175,7 @@ architecture arch of DualPort3264BootBRAM is
|
||||
7458 => x"20",
|
||||
7459 => x"00",
|
||||
7460 => x"2a",
|
||||
7461 => x"34",
|
||||
7461 => x"36",
|
||||
7462 => x"31",
|
||||
7463 => x"00",
|
||||
7464 => x"20",
|
||||
@@ -71283,7 +71283,7 @@ architecture arch of DualPort3264BootBRAM is
|
||||
7460 => x"2a",
|
||||
7461 => x"30",
|
||||
7462 => x"32",
|
||||
7463 => x"65",
|
||||
7463 => x"66",
|
||||
7464 => x"2c",
|
||||
7465 => x"32",
|
||||
7466 => x"73",
|
||||
|
||||
@@ -51403,7 +51403,7 @@ architecture arch of DualPortBootBRAM is
|
||||
14920 => x"4f",
|
||||
14921 => x"2a",
|
||||
14922 => x"20",
|
||||
14923 => x"34",
|
||||
14923 => x"36",
|
||||
14924 => x"2f",
|
||||
14925 => x"31",
|
||||
14926 => x"31",
|
||||
@@ -69610,10 +69610,10 @@ architecture arch of DualPortBootBRAM is
|
||||
14921 => x"2a",
|
||||
14922 => x"73",
|
||||
14923 => x"30",
|
||||
14924 => x"32",
|
||||
14924 => x"33",
|
||||
14925 => x"32",
|
||||
14926 => x"76",
|
||||
14927 => x"65",
|
||||
14927 => x"66",
|
||||
14928 => x"20",
|
||||
14929 => x"2c",
|
||||
14930 => x"76",
|
||||
|
||||
@@ -51398,7 +51398,7 @@ architecture arch of SinglePortBootBRAM is
|
||||
14920 => x"4f",
|
||||
14921 => x"2a",
|
||||
14922 => x"20",
|
||||
14923 => x"34",
|
||||
14923 => x"36",
|
||||
14924 => x"2f",
|
||||
14925 => x"31",
|
||||
14926 => x"31",
|
||||
@@ -69605,10 +69605,10 @@ architecture arch of SinglePortBootBRAM is
|
||||
14921 => x"2a",
|
||||
14922 => x"73",
|
||||
14923 => x"30",
|
||||
14924 => x"32",
|
||||
14924 => x"33",
|
||||
14925 => x"32",
|
||||
14926 => x"76",
|
||||
14927 => x"65",
|
||||
14927 => x"66",
|
||||
14928 => x"20",
|
||||
14929 => x"2c",
|
||||
14930 => x"76",
|
||||
|
||||
@@ -106,8 +106,8 @@
|
||||
#endif
|
||||
|
||||
// Version info.
|
||||
#define VERSION "v1.1e"
|
||||
#define VERSION_DATE "04/02/2021"
|
||||
#define VERSION "v1.1f"
|
||||
#define VERSION_DATE "06/03/2021"
|
||||
#define PROGRAM_NAME "zOS"
|
||||
|
||||
// Utility functions.
|
||||
|
||||
Reference in New Issue
Block a user