CP/M-68K simulator
web site: CP/M-68K Simulator
tested on Fedora,
back to emulators page.
History
2021-11-15: I re-created this page on my self-hosted web server.
2017-06-08: it looks like the web site is gone now. Luckily I have the source files on my machine. Update: no, the web site is still there, it was just very slow today.
2014-04-22: user areas with files:
C>user Enter User No: 0 C>dir C: RELOC 68K : DUMP 68K : PIP 68K : STAT 68K : INIT REL C: LINK68 68K : SENDC68 68K : DDT 68K : DDT68000 68K : AS68 68K C: CP68 68K : AS68INIT : LIBF A : C068 68K : C168 68K C: AR68 68K : CONFIG 68K : LO68 68K : MORE 68K : NM68 68K C: LIBE A : SIZE68 68K : ASSERT H : CTYPE H : COPY SUB C: ERRNO H : OPTION H : OSIFERR H : PORTAB H : SETJMP H C: CLIB : CE SUB : CLINKE SUB : CLINKF SUB : CLINK SUB C: AS68SYMB DAT : C SUB : RELOC3 SUB : SGTTY H : SIGNAL H C: STDIO H : STDINT H : ENDIAN H : ED 68K : S O C: CC REL : CC 68K : WHEREIS 68K : BBYE 68K : UEMACS 68K C: F83 BIN : PUTBOOT 68K : BYE 68K : CPM SYS : GREEN 68K C: MAKE REL : MAKE 68K : ARC 68K : EMACS 68K : F83 68K C: SPLIT 68K
user 1:
1C>dir C: ASSERT H : CTYPE H : ERRNO H : OPTION H : OSIFERR H C: PORTAB H : SETJMP H : SGTTY H : SIGNAL H : STDIO H C: ENDIAN H : STDINT H : BYTESWAP H : BYTESWAP S : BYTESWAP O
user 2: loader and regular bios etc.
C>user 2 2C>dir C: PUTBOOT REL : PUTBOOT O : SIMBIOS S : SIMBIOS O : CPMLIB C: CPMLDR SYS : CPM REL : CPM SYS : LCPM SUB : LCPM10 SUB C: NEWCON C : NEWCON DOC : MAKELDR SUB : LDRBIOS S : RELCPM SUB C: LDRBIOS O : BYTESWAP O : CPMLDR REL : NEWCON O : BYE S C: GREEN S : GREEN O : GREEN REL : MAKECPM SUB : BBYE 68K C: LDRLIB : PUTBOOT 68K : PUTBOOT S
user 4: CP/M loader lib source
4C>dir C: BDOSDEF H : BDOSIF S : BDOSMAIN C : BDOSREAD C : BIOSDEF H C: CPMLDR C : DSKUTIL C : FILEIO C : IOSYS C : LDRIF S C: M SUB : PKTIO H : LDRLIB : MAKE SUB : BDOSIF O C: LDRIF O : BDOSMAIN O : BDOSREAD O : CPMLDR O : DSKUTIL O C: FILEIO O : IOSYS O : STDIO H
user 6:
6C>dir C: SPLIT S : SPLIT REL : RELMOD C : RELMOD REL
user 10: make
10C>dir C: MAKE C : ATRIBUTE C : CHDIR C : MAKE 68K : UTIL C C: MOVMEM O : MAKE BAK : MAKEFILE : MAKELOAD S : STRSAVE O C: UTIL O : MOVMEM C : MAKE O : STRSAVE C : ATRIBUTE O C: MAKE SUB : CHDIR O
user 11: CC
11C>dir C: CALLSYSA S : CC 68K : CC C : CC DOC : CCLINK C: CCLOAD S : CC REL : PEXEC C
user 12: uemacs V3.9 misc files
12C>dir C: 00_INDEX TXT : AMIGA RC : AZMAP CMD : BDATA CMD : BLOCK CMD C: BOXMAC CMD : CG197_0I 003 : COMP : EMACS HLP : EMACSRC C: EMACS RC : EMACS TUT : EMACS TXT : FINDCOM CMD : FUNC CMD C: HEADER CUG : INDENT CMD : ME110 RC : ME150 RC : MENU1 C: MENU CMD : README : SUBMIT DSK : TRAND CMD
user 13: uemacs V?
13C>dir C: EMACS 68K : ANSI C : BASIC C : BIOS H : BIOS S C: BUFFER C : DISPLAY C : ED H : FILE C : FILEIO C C: LINE C : MAIN C : ME TXT : PORTAB H : RANDOM C C: REGION C : SEARCH C : SPAWN C : STDIO H : TCAP C C: TERMIO C : VT52 C : WINDOW C : WORD C : EMACS REL C: NOTES TXT
user 14: uemacs V3.6.1
14C>dir C: SPAWN C : ANSI C : BASIC C : BIND C : EBIND H C: EDEF H : EFUNC H : EPATH H : ESTRUCT H : BUFFER C C: DISPLAY C : UEMACS 68K : FILE C : FILEIO C : HP150 C C: LINE C : LOCK C : MAIN C : RANDOM C : REGION C C: SEARCH C : BIOS S : TCAP C : TERMIO C : NOTES TXT C: VT52 C : WORD C : WINDOW C : UEMACS REL : BIOS H
user 15: uemacs V3.9
15C>dir C: ESTRUCT H : ANSI O : CRYPT O : BASIC O : BIND O C: BUFFER O : DG10 O : NOTES TXT : 00_INDEX TXT : ANSI C C: BADER DOC : BASIC C : BIND C : BUFFER C : CG198_1I 008 C: CRYPT C : CUG DOC : DG10 C : DISPLAY C : DOLOCK C C: EBIND H : EDEF H : EFUNC H : EMACS C : EMACS KEY C: EPATH H : EVAL C : EVAR H : EXEC C : FILE C C: FILEIO C : HEADER CUG : HP110 C : HP150 C : IBMPC C C: INPUT C : ISEARCH C : LINE C : LOCK C : MAIN C C: MAKEFILE : MENU C : MISC : RANDOM C : REGION C C: SEARCH C : SPAWN C : ST520 C : SUBMIT DSK : TCAP C C: TERMIO C : TIPC C : UNIX MK : VMSVT C : VT52 C C: WINDOW C : WORD C : Z309 C
is there a user 16?
15C>user 16 User # range is [0-15]
just kidding. stat is here:
C>stat C: RW, FREE SPACE: 12,842K M: RW, FREE SPACE: 16,256K
What else? whereis
C>whereis emacs C>whereis emacs.* EMACS.68K 0 EMACS.HLP 12 EMACS.RC 12 EMACS.TUT 12 EMACS.TXT 12 EMACS.68K 13 EMACS.REL 13 EMACS.C 15 EMACS.KEY 15 C>whereis stat.* STAT.68K 0
that is useful.
2014-04-22: does it start?
tingo@kg-core1$ ./cpmsim Read 32768 bytes from boot track CP/M-68K(tm) Version 1.2 03/20/84 Copyright (c) 1984 Digital Research, Inc. CP/M-68K BIOS Version 1.0 Simulated system of April 2014 TPA =16251 K C>AUTOST.SUB AUTOST.SUB?
it does. To exit emulator, use the bbye command:
C>bbye CP/M-68K terminating normally Final PC=00008106
The bye command does something else:
C>bye CP/M-68K BIOS Version 1.0 Simulated system of April 2014 TPA =16251 K C>AUTOST.SUB Exception $0B at user address $0000041A. Aborted.
Funny.
2014-04-22: I read about this emulator on the comp.os.cpm newsgroup a while ago, today I decided to see if I could get it to compile under FreeBSD.
tingo@kg-core1$ uname -a FreeBSD kg-core1.kg4.no 8.4-STABLE FreeBSD 8.4-STABLE #0 r253646: Thu Jul 25 10:12:31 UTC 2013 root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64
create a place to test it:
tingo@kg-core1$ pwd /home/tingo/work/cpm68k
unzip Musashi sources:
tingo@kg-core1$ unzip ~/dl/musashi331.zip Archive: /home/tingo/dl/musashi331.zip extracting: example.zip extracting: history.txt extracting: m68k.h extracting: m68k_in.c extracting: m68kconf.h extracting: m68kcpu.c extracting: m68kcpu.h extracting: m68kdasm.c extracting: m68kmake.c extracting: readme.txt
check format:
tingo@kg-core1$ file * example.zip: Zip archive data, at least v2.0 to extract history.txt: ASCII English text, with CRLF line terminators m68k.h: ASCII C program text, with CRLF line terminators m68k_in.c: ASCII C program text, with CRLF line terminators m68kconf.h: ASCII C program text, with CRLF line terminators m68kcpu.c: ASCII C program text, with CRLF line terminators m68kcpu.h: ASCII C program text, with CRLF line terminators m68kdasm.c: ASCII C program text, with CRLF line terminators m68kmake.c: ASCII C program text, with CRLF line terminators readme.txt: ASCII English text, with CRLF line terminators
run through dos2unix:
tingo@kg-core1$ dos2unix *
check again:
tingo@kg-core1$ file * example.zip: Zip archive data, at least v2.0 to extract history.txt: ASCII English text m68k.h: ASCII C program text m68k_in.c: ASCII C program text m68kconf.h: ASCII C program text m68kcpu.c: ASCII C program text m68kcpu.h: ASCII C program text m68kdasm.c: ASCII C program text m68kmake.c: ASCII C program text readme.txt: ASCII English text
Next, move one file out of the way:
tingo@kg-core1$ mv m68kconf.h m68kconf.h_org
then unzip the cpmsim sources:
tingo@kg-core1$ unzip ~/dl/cpmsim.zip Archive: /home/tingo/dl/cpmsim.zip extracting: cpmsim.c extracting: simbios.s extracting: simbios.bin extracting: cpm400.bin extracting: diskc.cpm.fs extracting: makefile extracting: sim.h extracting: m68kconf.h extracting: cpmsim
I also had to run dos2unix on the makefile:
tingo@kg-core1$ dos2unix makefile
Ok, try to compile:
tingo@kg-core1$ make mkdir obj gcc -Wall -O2 -c -Iobj -I. cpmsim.c -o obj/sim.o cpmsim.c: In function 'disk_write': cpmsim.c:425: warning: implicit declaration of function 'TEMP_FAILURE_RETRY' gcc -Wall m68kmake.c -o obj/m68kmake obj/m68kmake obj m68k_in.c Musashi v3.3 68000, 68010, 68EC020, 68020 emulator Copyright 1998-2000 Karl Stenerud (karl@mame.net) Generated 1962 opcode handlers from 503 primitives gcc -Wall -O2 -c -Iobj -I. m68kcpu.c -o obj/m68kcpu.o gcc -Wall -O2 -c -Iobj -I. obj/m68kops.c -o obj/m68kops.o gcc -Wall -O2 -c -Iobj -I. obj/m68kopac.c -o obj/m68kopac.o gcc -Wall -O2 -c -Iobj -I. obj/m68kopdm.c -o obj/m68kopdm.o gcc -Wall -O2 -c -Iobj -I. obj/m68kopnz.c -o obj/m68kopnz.o gcc -Wall -O2 -c -Iobj -I. m68kdasm.c gcc -Wall obj/sim.o obj/m68kcpu.o obj/m68kops.o obj/m68kopac.o obj/m68kopdm.o obj/m68kopnz.o m68kdasm.o -o cpmsim obj/sim.o(.text+0x8cf): In function `disk_write': : undefined reference to `TEMP_FAILURE_RETRY' *** Error code 1 Stop in /zs/tingo/work/cpm68k.
Well, didn't work straight through. Ah. I found this on the newsgroup: NOTE: OS/X users will need this added to cpmsim.c:
#ifdef __APPLE__ #define TEMP_FAILURE_RETRY(expr) \ ({ long int _res; \ do _res = (long int) (expr); \ while (_res == -1L && errno == EINTR); \ _res; }) #endif
I changed __APPLE__
into __FreeBSD__
and added it to cpmsim.c and did a rebuild (note: the make clean
target doesn't really remove the obj directory):
tingo@kg-core1$ make mkdir obj gcc -Wall -O2 -c -Iobj -I. cpmsim.c -o obj/sim.o gcc -Wall m68kmake.c -o obj/m68kmake obj/m68kmake obj m68k_in.c Musashi v3.3 68000, 68010, 68EC020, 68020 emulator Copyright 1998-2000 Karl Stenerud (karl@mame.net) Generated 1962 opcode handlers from 503 primitives gcc -Wall -O2 -c -Iobj -I. m68kcpu.c -o obj/m68kcpu.o gcc -Wall -O2 -c -Iobj -I. obj/m68kops.c -o obj/m68kops.o gcc -Wall -O2 -c -Iobj -I. obj/m68kopac.c -o obj/m68kopac.o gcc -Wall -O2 -c -Iobj -I. obj/m68kopdm.c -o obj/m68kopdm.o gcc -Wall -O2 -c -Iobj -I. obj/m68kopnz.c -o obj/m68kopnz.o gcc -Wall obj/sim.o obj/m68kcpu.o obj/m68kops.o obj/m68kopac.o obj/m68kopdm.o obj/m68kopnz.o m68kdasm.o -o cpmsim
compiled.