All Projects → ivanizag → iz-cpm

ivanizag / iz-cpm

Licence: BSD-3-Clause license
Portable CP/M emulation to run CP/M 2.2 binaries for Z80

Programming Languages

rust
11053 projects
Batchfile
5799 projects
shell
77523 projects

Projects that are alternatives of or similar to iz-cpm

spectrum128 cpm
zx spectrum 128 emulation on stm32f407 + Grant Searle's CP/M system port ili9341 16 bit display
Stars: ✭ 29 (-48.21%)
Mutual labels:  z80, cpm, cpm22
ZSM4
Z80/Z180/Z280 Macro Assembler for CP/M, UZI180 and RSX180
Stars: ✭ 26 (-53.57%)
Mutual labels:  z80, cpm, cpm22
cpmtools
Tools to access CP/M file systems (forked)
Stars: ✭ 29 (-48.21%)
Mutual labels:  cpm, cpm22
a80
Intel 8080/Zilog Z80 assembler written in D.
Stars: ✭ 23 (-58.93%)
Mutual labels:  z80, cpm
mescc
Mike's Enhanced Small C Compiler for Z80 and CP/M.
Stars: ✭ 23 (-58.93%)
Mutual labels:  z80, cpm
lighthouse-of-doom
A simple text-based adventure game
Stars: ✭ 52 (-7.14%)
Mutual labels:  z80, cpm
gorilla-cpm
GORILLA.BAS port to CP/M in Turbo Modula-2. Supported terminals: VT52, VT100, ANSI, ADM-31, KayPro, C128, Memotech monochrome, CPC / Zenith Z19
Stars: ✭ 45 (-19.64%)
Mutual labels:  z80, cpm
TMS9918A
TMS9918A video card for RC2014
Stars: ✭ 104 (+85.71%)
Mutual labels:  z80
asMSX
AsMSX, originally developed by Pitpan. More info: https://www.msx.org/wiki/AsMSX.
Stars: ✭ 58 (+3.57%)
Mutual labels:  z80
queens-cpm
Eight Queen Puzzle - portable CP/M version, written on Commodore 128
Stars: ✭ 24 (-57.14%)
Mutual labels:  cpm
ArduZ80
The first Z80 emulation library for Arduino
Stars: ✭ 44 (-21.43%)
Mutual labels:  z80
scas
SirCmpwn's assembler (and linker)
Stars: ✭ 22 (-60.71%)
Mutual labels:  z80
6502.Net
A .Net-based Cross-Assembler for Several 8-Bit Microprocessors
Stars: ✭ 44 (-21.43%)
Mutual labels:  z80
channels
ZX Spectrum browser for forums and imageboards
Stars: ✭ 52 (-7.14%)
Mutual labels:  z80
Zany80
Zany80 fantasy computer system
Stars: ✭ 48 (-14.29%)
Mutual labels:  z80
Z80Core
A Z80 core written in Java
Stars: ✭ 25 (-55.36%)
Mutual labels:  z80
cpm8266
Z80-CP/M2.2 emulation on ESP8266 NONOS SDK + the NoSDK from cnlohr
Stars: ✭ 110 (+96.43%)
Mutual labels:  cpm
jsGBC
👾 A GameBoy Color Emulator written in JavaScript
Stars: ✭ 44 (-21.43%)
Mutual labels:  z80
z80count
A tool to annotate Z80 assembler with cycle counts
Stars: ✭ 28 (-50%)
Mutual labels:  z80
ersatz80
Z80+ARM=BUGS
Stars: ✭ 13 (-76.79%)
Mutual labels:  z80

iz-cpm -- CP/M 2.2 environment

What is this?

This is a CP/M 2.2 execution environment. It provides everything needed to run a standard CP/M for Z80 or 8080 binary.

Uses my iz80 library for Zilog Z80 and Intel 8080 emulation.

Made with Rust

Note that iz-cpm is a very basic implementation, mostly for educational purposes. I recommend MockbaTheBorg's RunCPM or Udo Munk's Z80pack for a much more complete CP/M emulation.

Installation

Extract the latest zip for Linux, MacOS or Windows. Optionally run download.sh or download.bat to download the CP/M 2.2 system disk, Microsoft Basic, Turbo Pascal, Lisp and some games.

Build from source

To build from source, install the latest Rust compiler, clone the repo and run cargo build --release. To cross compile to Windows, install the target with rustup and run cargo build --release --target x86_64-pc-windows-gnu.

Usage examples

Execute iz-cpm to open the CP/M command prompt (the CCP) on the current directory:

casa@servidor:~/software/cpm22$ ls
ASM.COM      CCSINIT.COM   DISKDEF.LIB  iz-cpm        STAT.COM
CBIOS.ASM    CCSYSGEN.COM  DUMP.ASM     LOAD.COM      STDBIOS.ASM
CCBIOS.ASM   CPM24CCS.COM  DUMP.COM     MOVCPM.COM    SUBMIT.COM
CCBOOT.ASM   DDT.COM       ED.COM       PIP.COM       SYSGEN.COM
-CCSCPM.251  DEBLOCK.ASM   GENMOD.COM   RLOCBIOS.COM
casa@servidor:~/software/cpm22$ ../../iz-cpm 
iz-cpm https://github.com/ivanizag/iz-cpm
CP/M 2.2 Copyright (c) 1979 by Digital Research
Press ctrl-c ctrl-c to return to host

A>dir
A: CCSINIT  COM : MOVCPM   COM : CPM24CCS COM : STAT     COM
A: SYSGEN   COM : STDBIOS  ASM : IZ-CPM       : LOAD     COM
A: DISKDEF  LIB : ASM      COM : RLOCBIOS COM : DUMP     COM
A: -CCSCPM  251 : CCBIOS   ASM : DUMP     ASM : CCSYSGEN COM
A: DEBLOCK  ASM : ED       COM : SUBMIT   COM : DDT      COM
A: PIP      COM : CBIOS    ASM : CCBOOT   ASM : GENMOD   COM
A>

Execute iz-cpm with a file to execute a CP/M binary directly, bypassing the CPP:

casa@servidor:~$ ./iz-cpm software/OBASIC.COM 
44531 Bytes free
BASIC Rev. 4.51
[CP/M Version]
Copyright 1977 (C) by Microsoft
Ok
print "hello"
hello
Ok

Map up to 16 directories as CP/M drives:

casa@servidor:~$ ./iz-cpm --disk-a software/cpm22 --disk-b software/zork --disk-e .
iz-cpm https://github.com/ivanizag/iz-cpm
CP/M 2.2 Copyright (c) 1979 by Digital Research
Press ctrl-c ctrl-c to return to host

A>b:
B>dir
B: ZORK2    DAT : ZORK1    COM : ZORK3    DAT : ZORK3    COM
B: FILE_ID  DIZ : ZORK1    DAT : ZORK1    SAV : ZORK2    COM
B>zork1
ZORK I: The Great Underground Empire
Copyright (c) 1981, 1982, 1983 Infocom, Inc. All rights
reserved.
ZORK is a registered trademark of Infocom, Inc.
Revision 88 / Serial number 840726

West of House
You are standing in an open field west of a white house, with
a boarded front door.
There is a small mailbox here.

>

Usage

iz-cpm https://github.com/ivanizag/iz-cpm
CP/M 2.2 Copyright (c) 1979 by Digital Research
Press ctrl-c ctrl-c to return to host 

USAGE:
    iz-cpm [FLAGS] [OPTIONS] [ARGS]

FLAGS:
    -t, --call-trace        Traces BDOS calls excluding screen I/O
    -T, --call-trace-all    Traces BDOS and BIOS calls
    -z, --cpu-trace         Traces Z80 instructions execution
    -h, --help              Prints help information
    -s, --slow              Runs slower
    -V, --version           Prints version information

OPTIONS:
        --cpu <model>            cpu model z80 or 8080 [default: z80]
    -a, --disk-a <path>          directory to map disk A: [default: .]
    -b, --disk-b <path>          directory to map disk B:
    -c, --disk-c <path>          directory to map disk C:
    -d, --disk-d <path>          directory to map disk D:
        --disk-e <path>          directory to map disk E:
        --disk-f <path>          directory to map disk F:
        --disk-g <path>          directory to map disk G:
        --disk-h <path>          directory to map disk H:
        --disk-i <path>          directory to map disk I:
        --disk-j <path>          directory to map disk J:
        --disk-k <path>          directory to map disk K:
        --disk-l <path>          directory to map disk L:
        --disk-m <path>          directory to map disk M:
        --disk-n <path>          directory to map disk N:
        --disk-o <path>          directory to map disk O:
        --disk-p <path>          directory to map disk P:
        --terminal <terminal>    Terminal emulation ADM-3A or ANSI [default: adm3a]


ARGS:
    <CMD>     The binay image to run, 
    <ARGS>    Parameters for the given command

Features

  • Execution of 8080 and Z80 binaries on top of CP/M
  • Direct usage of the host computer filesystem
  • Terminal emulation of ADM-3A as used in the KAYPRO computers
  • Z80 emulation validated with ZEXALL
  • CPU execution tracing
  • BDOS and BIOS tracing
  • Portable, runs in Linux, MacOS and Windows. Mmm, not in CP/M.

How does it work

CP/M was designed to be portable to a variety of devices using Intel 8080, Intel 8085 or Zilog Z80 processors thanks to a tiered architecture. The main parts of CP/M are:

  • The BIOS: Basic Input/Output system. Interface with the hardware. CP/M defines a very small interface: 16 entrypoints to manage I/O and access to disk sectors. The hardware vendors provided the BIOS for their device based on source code available on the CP/M distribution.
  • The BDOS: Basic Disk Operating System. Main component of CP/M. Provided by Digital Research and common to all systems. Provides the high level entrypoints to be used by application developpers.
  • The CCP: Console Command Processor. The CP/M Command prompt.

To emulate this environment using the host filesystem, we have to provide a replacement BDOS translating as we don't want to relay on the physical disk sectors abstraction of the BIOS. The main components are:

  • Z80 emulator. It uses iz80
  • BIOS emulator. Only the I/O entrypoints. In theory, it shouldn't be necessary, but some programs use it directly, bypassing BDOS.
  • BDOS emulator. Traps the calls and executes code on the host.
  • CPP. Runs natively, no emulation needed. We use ZCPR1 an open source alternative. See cpmish for other open source alternatives to the CP/M binaries. The CPP binary from CP/M 2.2 can be used optionally.
  • Terminal emulator. CP/M does not define how the terminal should work. Applications needed to be aware and usually could be configured for several leading options, like ADM-3a, VT-52, Hazeltine 1500 and Osborne. This emulator supports ADM-3a used also on the very popular Kaypro computers.

Useful links:

TODO

  • Proper documentation
  • File level read-only option (I won't do that, the host can control that)
  • BIOS support for punch cards (Nope)
  • BIOS support for track/sector access to disks (Not needed)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].