Menu

Tree [2b16ec] master /
 History

HTTPS access


File Date Author Commit
 ez80_cpm3 2024-04-28 Paul Osmialowski Paul Osmialowski [e90097] Initial commit
 ez80ztp_cpm3 2024-05-04 Paul Osmialowski Paul Osmialowski [ec92d8] boot: simplify the startup code and make it mor...
 .gitignore 2024-04-28 Paul Osmialowski Paul Osmialowski [e90097] Initial commit
 LICENSE 2024-04-28 Paul Osmialowski Paul Osmialowski [e90097] Initial commit
 README.md 2024-05-04 Paul Osmialowski Paul Osmialowski [2b16ec] NFC: Ethernet Smart Cable connects you to the ZDI

Read Me

CP/M 3.1 for the ez80 ADL mode

This is an ADL-mode rewrite of the ez80 CP/M 3.1 port, initially composed by
Howard M. Harte, available at https://github.com/hharte/ez80_cpm.git (the
LICENSE file was copied as-is from this repository). No banking has been used,
it is the ADL at its finest.

Two variants are available:

  1. ez80_cpm3 - simplest version which requires ZDSII_eZ80Acclaim_4.11.1 for
    being built,

  2. ez80ztp_cpm3 - enhanced version with the network drive and the network
    console; it requires ZDSII_eZ80Acclaim_5.1.1 along with RZK/ZTP-2.3.2 for being
    built.

Why ADL mode?

Moving the BIOS and BDOS away from the 64kB of RAM visible to the Z80 mode makes
it possible to leave most of it for the CP/M programs running in the TPA. This
is how the banked CP/M systems always had it. With the ADL mode of the ez80 CPU,
it is possible to avoid all the hassle of banking and make a good use of the
24-bit ADL addressing.

Since the TPA starts at the page 01 and ends at the page FD, it leaves
a 63kB of RAM for the programs to use.

The area starting at the page FD is organized as such:

  • FD00 - BDOS redirection to ADL, drive table, DPBs, DPHs, BCBs, device table
  • FE44 - SCB
  • FF00 - BIOS jump tabe with the redirection to ADL

The userspace programs and BDOS routines are running with the interrupts
enabled, the BIOS routines are running with the interrupts disabled.

The CCP command interpreter is always reloaded from an in-memory copy visible
to the ADL-mode routines.

For specific board only

This port of CP/M was prepared for this specific board:

eZ80 FAMILY EVALUATION PLATFORM
zilog PC: 99C0858-001G
attached module: eZ80F91 E-NET MODULE

A simplest SD card reader was attached to the SPI lines as such:

PB0_T0_I - CS
PB3_SCK  - SCK
PB7_MOSI - MOSI
PB6_MISO - MISO
VCC      - VCC
GND      - GND

Additionally, the PB2_SS and PB5_T5_0 lines have been connected to VDD.

The initial console is always on UART0 with the following serial communication
settings:

  • Speed: 57600
  • Parity: None
  • Bits: 8
  • Stop: 1
  • H/W control: None
  • XON/XOFF: No

The support for XON/XOFF flow control has been removed from the ported code.

No partition table!

The three 16MB CP/M disk images were copied to the SD Card, one after another
starting at sector 0. As there is no support for partition tables, the three
disk images were first concatenated into one file, and then transferred to the
SD Card, e.g.:

$ dd if=3images.rawimg of=/dev/sdb

(assuming the SD card adapter is accessible at /dev/sdb).

If no CP/M disk images are available (hence there is nothing to concatenate),
one alternative is to create the three empty formatted images as such:

$ dd if=/dev/zero ibs=3M count=16 | tr "\000" "\345" >3images.rawimg

...and then use the spectrangsxd server (specifying which of the three images
to work with):

$ spectrangsxd 2423 2424 3images.rawimg:0
...
$ spectrangsxd 2423 2424 3images.rawimg:1
...
$ spectrangsxd 2423 2424 3images.rawimg:2
...

...along with the spectranfs client, in order to populate the given UID of
those images with your files:

$ spectranfs 127.0.0.1 2424 0 put some.txt

(in the example above, the some.txt file will be copied to the UID 0 of the
image currently handled by spectrangsxd).

The ez80_cpm3 variant

A simple port which requires ZDSII_eZ80Acclaim_4.11.1 for being built. The ZDSII
IDE works well in the Wine emulator.

An individual target eZ80DevPlatform_F91_RAM_CPM.ztgt has been created for
this project.

It was always started using a ZDI debugger (through the Ethernet Smart Cable),
no booting form the flash was ever attempted.

The ez80ztp_cpm3 variant

A more advanced port which requires ZDSII_eZ80Acclaim_5.1.1 along with
RZK/ZTP-2.3.2 for being built. The ZDSII IDE works well in the Wine emulator.

No individual target has been created for this project.

It should be possible to start it using a ZDI debugger (e.g. through the
Ethernet Smart Cable) and from the Flash.

The use of the ZTP library and the RZK kernel

The network layer has been provided by the ZTP library, which cannot be used
without the RZK kernel. In effect, the entire CP/M (system and userspace) is
running within a thread created by the RZK kernel. It is started by calling the
CreateZTPAppThread() function from the main() function.

And here is the challenge: the CP/M system requires the mixed memory mode (the
MADL register set to 1) in order to freely switch between Z80 and ADL as
needed. The RZK kernel has not been prepared for that, it reqires the MADL
register's value to remain 0. In effect, each call to any of the RZK or ZTP
functions must be preceded by the rsmix instruction and followed by the
stmix instruction immediately after the return of a function. And here is
another challenge: the ISR must follow the same rule. This is the reason for
the creation of a special ISR which issues rsmix, changes the return address
to a custom function (which issues stmix and returns to the interrupted place)
and then it calls the original ISR of the RZK kernel (in effect, there are two
interrupt vectors in use). It may look suspicious, fortunately it does the job
properly.

The config.h file

After obtainign an IP address from the DHCP, an attemt to connect the
spectrangsxd server is being made. The IP address on which the server is
available is defined in the config.h file. Also the port numbers for the
terminal and the network drive N: is being specified there.

After succesfull connection to the spectrangsxd server, the initial drive
is changed to N:, otherwise it is set to C:. This is convenient since the
SUBMIT command always creates temporary file on the current drive when
processing the .SUB files. Processing the PROFILE.SUB file at the system
startup would shorten the SD Card's life if it was always started from C:.

Example usage session

Startup

10 Mbps Half-Duplex  Link established

Querying DHCP Server...

DHCP OK

Initializing network stack...

IFace   IP address      Def Gtway       state   type     H/W address

0       192.168.1.71    192.168.1.1     UP      Ethernet 0 :90:23:0 :1 :80

Build date: May  4 2024 10:02:14

N>SETDEF [UK]

Date format used     - UK

N>SETDEF *,C:[ORDER=(SUB,COM)]

Drive Search Path:
1st Drive            - Default
2nd Drive            - C:

Search Order         - SUB, COM

N>

Interactive part

N>type profile.sub
SETDEF [UK]
SETDEF *,C:[ORDER=(SUB,COM)]

N>setdef

Drive Search Path:
1st Drive            - Default
2nd Drive            - C:

Search Order         - SUB, COM
Temporary Drive      - Default
Console Page Mode    - On
Program Name Display - Off
Date format used     - UK

N>dir
N: CP1251   DBF : DBASE_03 DBF : DBASE_30 DBF : DBASE_31 DBF : DBASE_83 DBF
N: DBASE_8B DBF : DBASE_F5 DBF : POLYGON  DBF : SUBMIT   COM : PROFILE  SUB
N: SETDEF   COM
N>cputest

This CPU is an HD64180 or Z80180.

N>mem
Memory free= FC00 bytes, 63k.

N>sysinfo
Processor:   Z80
System:      CP/M 3.1
Top of TPA:  FD00
BIOS start:  FF00
BDOS start:  FD00
Common base: 0000
Drives:      C: D: E: N:

N>device

Physical Devices:
I=Input,O=Output,S=Serial,X=Xon-Xoff
UART0  NONE  IOS    UART1  NONE  IOS    EMAC   NONE  IO


Current Assignments:
CONIN:  = UART0
CONOUT: = UART0
AUXIN:  = UART1
AUXOUT: = UART1
LST:    = EMAC

Enter new assignment or hit RETURN


N>d:
D>basic

Mallard-80  BASIC with Jetsam   Version 1.29
(c) Copyright 1984  Locomotive Software Ltd
All rights reserved

33389 free bytes

Ok
system

D>mbasic
BASIC-80 Rev. 5.21
[CP/M Version]
Copyright 1977-1981 (C) by Microsoft
Created: 28-Jul-81
39224 Bytes free
Ok
system

D>dbase

Enter today's date or return for none
 (MM/DD/YY) :

***  dBASE II     Ver 2.43*  30 April 1985

COPYRIGHT (c) ASHTON-TATE 1985
AS AN UNPUBLISHED LICENSED PROPRIETARY WORK.
ALL RIGHTS RESERVED.

Use of this software has been provided under a Software
License Agreement (please read in full). In summary,
you may produce only three back-up copies and use this
software only on a single computer and single terminal.
You may not grant sublicenses nor transfer the software
or related materials in any form to any person unless
Ashton-Tate consents in writing.  This software
contains valuable trade secrets and proprietary
information, and is protected by federal copyright
laws, the violation of which can result in civil
damages and criminal prosecution.

dBASE II is a registered trademark and
dBASE and ASHTON-TATE are trademarks of Ashton-Tate.
. quit
*** End run   dBASE II   ***


Remember to back-up your data.

D>e:
E>turbo
---------------------------------------
TURBO Pascal system       Version 3.01A
                           CP/M-80, Z80

Copyright (C) 1983,84,85   BORLAND Inc.
---------------------------------------

Terminal: Kaypro, no hilite



Include error messages (Y/N)? N
Logged drive: E

Work file:
Main file:

Edit     Compile  Run   Save

eXecute  Dir      Quit  compiler Options

Text:     0 bytes (7BF5-7BF5)
Free: 32016 bytes (7BF6-F906)

>

E>forth

DX-Forth 4.45  2022-01-11  50 MHz  No Terminal selected


bye

E>dir dbfread*.*
E: DBFREAD  PAS : DBFREAD  COM
E>dbfread n:dbase_03.dbf
DBF version: 3
Year: 95
Month: 7
Day: 13
Number of records: 14
...upper half: 0
First record location: 1025
...estimated number of fields: 31
Record length: 590
1. Point_ID, C, locn: 0, size: 12, dec: 0
2. Type, C, locn: 0, size: 20, dec: 0
3. Shape, C, locn: 0, size: 20, dec: 0
4. Circular_D, C, locn: 0, size: 20, dec: 0
5. Non_circul, C, locn: 0, size: 60, dec: 0
6. Flow_prese, C, locn: 0, size: 20, dec: 0
7. Condition, C, locn: 0, size: 20, dec: 0
8. Comments, C, locn: 0, size: 60, dec: 0
9. Date_Visit, D, locn: 0, size: 8, dec: 0
10. Time, C, locn: 0, size: 10, dec: 0
11. Max_PDOP, N, locn: 0, size: 5, dec: 1
12. Max_HDOP, N, locn: 0, size: 5, dec: 1
13. Corr_Type, C, locn: 0, size: 36, dec: 0
14. Rcvr_Type, C, locn: 0, size: 36, dec: 0
15. GPS_Date, D, locn: 0, size: 8, dec: 0
16. GPS_Time, C, locn: 0, size: 10, dec: 0
17. Update_Sta, C, locn: 0, size: 36, dec: 0
18. Feat_Name, C, locn: 0, size: 20, dec: 0
19. Datafile, C, locn: 0, size: 20, dec: 0
20. Unfilt_Pos, N, locn: 0, size: 10, dec: 0
21. Filt_Pos, N, locn: 0, size: 10, dec: 0
22. Data_Dicti, C, locn: 0, size: 20, dec: 0
23. GPS_Week, N, locn: 0, size: 6, dec: 0
24. GPS_Second, N, locn: 0, size: 12, dec: 3
25. GPS_Height, N, locn: 0, size: 16, dec: 3
26. Vert_Prec, N, locn: 0, size: 16, dec: 1
27. Horz_Prec, N, locn: 0, size: 16, dec: 1
28. Std_Dev, N, locn: 0, size: 16, dec: 6
29. Northing, N, locn: 0, size: 16, dec: 3
30. Easting, N, locn: 0, size: 16, dec: 3
31. Point_ID, N, locn: 0, size: 9, dec: 0
Actual (31) and estimated (31) number of fields are the same.
Press any key to continue...

Printing the records. Press any key to interrupt.

1. [ ] 0507121      | CMP                  | circular             | 12                   |                                                              | no                   | Good                 |                                                              | 20050712 | 10:56:30am |   5.2 |   2.0 | Postprocessed Code                   | GeoXT                                | 20050712 | 10:56:52am | New                                  | Driveway             | 050712TR2819.cor     |          2 |          2 | MS4                  |   1331 |   226625.000 |         1131.323 |              3.1 |              1.3 |         0.897088 |       557904.898 |      2212577.192 |       401
2. [ ] 0507122      | CMP                  | circular             | 12                   |                                                              | no                   | Good                 |                                                              | 20050712 | 10:57:34am |   4.9 |   2.0 | Postprocessed Code                   | GeoXT                                | 20050712 | 10:57:37am | New                                  | Driveway             | 050712TR2819.cor     |          1 |          1 | MS4                  |   1331 |   226670.000 |         1125.142 |              2.8 |              1.3 |                  |       557997.831 |      2212576.868 |       402
3. [ ] 0507123      | CMP                  | circular             | 12                   |                                                              | no                   | Good                 |                                                              | 20050712 | 10:59:03am |   5.4 |   4.4 | Postprocessed Code                   | GeoXT                                | 20050712 | 10:59:12am | New                                  | Driveway             | 050712TR2819.cor     |          1 |          1 | MS4                  |   1331 |   226765.000 |         1127.570 |              2.2 |              3.5 |                  |       558184.757 |      2212571.349 |       403
4. [ ] 0507125      | CMP                  | circular             | 12                   |                                                              | no                   | Good                 |                                                              | 20050712 | 11:02:43am |   3.4 |   1.5 | Postprocessed Code                   | GeoXT                                | 20050712 | 11:03:12am | New                                  | Driveway             | 050712TR2819.cor     |          1 |          1 | MS4                  |   1331 |   227005.000 |         1125.364 |              3.2 |              1.6 |                  |       558703.723 |      2212562.547 |       405
5. [ ] 05071210     | CMP                  | circular             | 15                   |                                                              | no                   | Good                 |                                                              | 20050712 | 11:15:20am |   3.7 |   2.2 | Postprocessed Code                   | GeoXT                                | 20050712 | 11:14:52am | New                                  | Driveway             | 050712TR2819.cor     |          1 |          1 | MS4                  |   1331 |   227705.000 |         1118.605 |              1.8 |              2.1 |                  |       558945.763 |      2212739.979 |       410
6. [ ] 05071216     | CMP                  | circular             | 12                   |                                                              | no                   | Good                 |                                                              | 20050712 | 12:13:23pm |   4.4 |   1.8 | Postprocessed Code                   | GeoXT                                | 20050712 | 12:13:57pm | New                                  | Driveway             | 050712TR2819.cor     |          1 |          1 | MS4                  |   1331 |   231250.000 |         1117.390 |              3.1 |              1.2 |                  |       559024.234 |      2212856.927 |       416
7. [ ] 05071217     | CMP                  | circular             | 12                   |                                                              | no                   | Good                 |                                                              | 20050712 | 12:16:46pm |   4.4 |   1.8 | Postprocessed Code                   | GeoXT                                | 20050712 | 12:17:12pm | New                                  | Driveway             | 050712TR2819.cor     |          1 |          1 | MS4                  |   1331 |   231445.000 |         1125.714 |              3.2 |              1.3 |                  |       559342.534 |      2213340.161 |       417
8. [ ] 05071219     | CMP                  | circular             | 12                   |                                                              | no                   | Plugged              |                                                              | 20050712 | 12:22:55pm |   4.4 |   1.8 | Postprocessed Code                   | GeoXT                                | 20050712 | 12:22:22pm | New                                  | Driveway             | 050712TR2819.cor     |          1 |          1 | MS4                  |   1331 |   231755.000 |         1110.786 |              2.5 |              1.1 |                  |       559578.776 |      2213560.247 |       419
9. [ ] 05071224     | CMP                  | circular             | 12                   |                                                              | no                   | Good                 |                                                              | 20050712 | 12:37:17pm |   4.1 |   1.7 | Postprocessed Code                   | GeoXT                                | 20050712 | 12:38:32pm | New                                  | Driveway             | 050712TR2819.cor     |          1 |          1 | MS4                  |   1331 |   232725.000 |         1077.924 |              2.8 |              1.4 |                  |       560582.575 |      2213759.022 |       424
10. [ ] 05071225     | CMP                  | circular             | 12                   |                                                              | no                   | Good                 |                                                              | 20050712 | 12:39:48pm |   4.0 |   1.7 | Postprocessed Code                   | GeoXT                                | 20050712 | 12:39:52pm | New                                  | Driveway             | 050712TR2819.cor     |          1 |          1 | MS4                  |   1331 |   232805.000 |         1082.990 |              2.0 |              1.0 |                  |       560678.501 |      2213716.657 |       425
11. [ ] 05071229     | CMP                  | circular             | 12                   |                                                              | no                   | Good                 |                                                              | 20050712 | 12:49:05pm |   3.7 |   1.7 | Postprocessed Code                   | GeoXT                                | 20050712 | 12:49:07pm | New                                  | Driveway             | 050712TR2819.cor     |          1 |          1 | MS4                  |   1331 |   233360.000 |         1096.860 |              2.4 |              1.2 |                  |       560126.094 |      2213720.301 |       429
12. [ ] 05071231     | CMP                  | circular             | 12                   |                                                              | no                   | Plugged              |                                                              | 20050712 | 12:53:58pm |   3.0 |   1.6 | Postprocessed Code                   | GeoXT                                | 20050712 | 12:54:02pm | New                                  | Driveway             | 050712TR2819.cor     |          1 |          1 | MS4                  |   1331 |   233655.000 |         1105.113 |              1.8 |              1.1 |                  |       559952.331 |      2213689.001 |       431
13. [ ] 05071232     | CMP                  | circular             | 12                   |                                                              | no                   | Plugged              |                                                              | 20050712 | 12:55:47pm |   3.5 |   1.7 | Postprocessed Code                   | GeoXT                                | 20050712 | 12:55:47pm | New                                  | Driveway             | 050712TR2819.cor     |          2 |          2 | MS4                  |   1331 |   233760.000 |         1101.939 |              2.1 |              1.1 |         1.223112 |       559870.352 |      2213661.918 |       432
14. [ ] 05071236     | CMP                  | circular             | 12                   |                                                              | no                   | Plugged              |                                                              | 20050712 | 01:08:40pm |   3.3 |   1.6 | Postprocessed Code                   | GeoXT                                | 20050712 | 01:08:42pm | New                                  | Driveway             | 050712TR2819.cor     |          1 |          1 | MS4                  |   1331 |   234535.000 |         1125.517 |              1.8 |              1.2 |                  |       559195.031 |      2213046.199 |       436

E>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.