py68k - Fedora

back to main py68k emulator page.

History

2021-11-15: I re-created this page on my self-hosted web server.

2018-03-17: py68k - test it, to find out what else is missing

[tingo@localhost py68k]$ ./py68k.py 
Traceback (most recent call last):
  File "./py68k.py", line 16, in <module>
    import imageELF
  File "/home/tingo/work/emul/py68k/imageELF.py", line 11, in <module>
    from elftools.elf.elffile import ELFFile
ImportError: No module named elftools.elf.elffile

ok, elftools python modules is missing. after installing python-pyelftools.noarch, retry

[tingo@localhost py68k]$ ./py68k.py 
usage: py68k.py [-h] [--target TARGET] [--trace-file TRACE_FILE]
                [--cycle-limit CYCLES] [--trace-everything] [--trace-memory]
                [--trace-read-trigger ADDRESS-or-NAME]
                [--trace-write-trigger ADDRESS-or-NAME] [--trace-instructions]
                [--trace-instruction-trigger ADDRESS-or-NAME] [--trace-jumps]
                [--trace-exceptions] [--trace-exception EXCEPTION]
                [--trace-io] [--trace-cycle-limit CYCLES]
                [--trace-check-PC-in-text] [--debug-device DEBUG_DEVICE]
                [--diskfile DISKFILE]
                image
py68k.py: error: too few arguments

much better. Now try with bios

[tingo@localhost py68k]$ ./py68k.py --target tiny68k ~/work/emul/tiny68k/tinybios.bin
Traceback (most recent call last):
  File "./py68k.py", line 590, in <module>
    print curses.wrapper(run_emu, args)
  File "/usr/lib64/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "./py68k.py", line 479, in run_emu
    emu = configure(args, stdscr)
  File "./py68k.py", line 470, in configure
    import deviceConsole
  File "/home/tingo/work/emul/py68k/deviceConsole.py", line 3, in <module>
    import vt102
ImportError: No module named vt102

ok, the vt102 python module is missing too. It isn't in dnf repositories, so use pip to install it

[tingo@localhost ~]$ sudo pip install vt102
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip install --user` instead.
Collecting vt102
  Downloading vt102-0.5.tar.gz
Installing collected packages: vt102
  Running setup.py install for vt102 ... done
Successfully installed vt102-0.5
You are using pip version 9.0.1, however version 9.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

now retry the emulator

[tingo@localhost py68k]$ ./py68k.py --target tiny68k ~/work/emul/tiny68k/tinybios.bin
Exit due to user interrupt.

ok, black screen, and exit via Ctrl-C x 3. Try with a diskfile as well

[tingo@localhost py68k]$ ./py68k.py --target tiny68k --diskfile ~/work/emul/tiny68k/t68k_cpm_disk.bin ~/work/emul/tiny68k/tinybios.bin
Exit due to user interrupt.

hmm, still a black screen. At least I can exit normally, via Ctrl-C x 3.

2018-03-17: compile musashi

[tingo@localhost py68k]$ cd musashi/
[tingo@localhost musashi]$ make
mkdir BUILD
gcc -g -O3 -c -o BUILD/m68kmake.o m68kmake.c
gcc -g -O3 -o m68kmake BUILD/m68kmake.o
./m68kmake

 Musashi v3.3 68000, 68010, 68EC020, 68020 emulator
 Copyright 1998-2000 Karl Stenerud (karl@mame.net)

Generated 1962 opcode handlers from 513 primitives
gcc -g -O3 -c -o BUILD/mem.o mem.c
gcc -g -O3 -c -o BUILD/m68kcpu.o m68kcpu.c
gcc -g -O3 -c -o BUILD/m68kdasm.o m68kdasm.c
gcc -g -O3 -c -o BUILD/m68kopac.o m68kopac.c
gcc -g -O3 -c -o BUILD/m68kopdm.o m68kopdm.c
gcc -g -O3 -c -o BUILD/m68kopnz.o m68kopnz.c
gcc -g -O3 -c -o BUILD/m68kops.o m68kops.c
gcc -shared -o libmusashi.so BUILD/mem.o BUILD/m68kcpu.o BUILD/m68kdasm.o BUILD/m68kopac.o BUILD/m68kopdm.o BUILD/m68kopnz.o BUILD/m68kops.o
/usr/bin/ld: BUILD/mem.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: BUILD/m68kcpu.o: relocation R_X86_64_32 against symbol `m68ki_cpu' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: BUILD/m68kdasm.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: BUILD/m68kopac.o: relocation R_X86_64_32S against symbol `m68ki_cpu' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: BUILD/m68kopdm.o: relocation R_X86_64_32S against symbol `m68ki_cpu' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: BUILD/m68kopnz.o: relocation R_X86_64_32S against symbol `m68ki_cpu' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: BUILD/m68kops.o: relocation R_X86_64_32 against undefined symbol `m68ki_instruction_jump_table' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make: *** [Makefile:53: libmusashi.so] Error 1

ok, try to fix it before

[tingo@localhost musashi]$ grep ^CFLAGS Makefile 
CFLAGS = -g -O3

after

[tingo@localhost musashi]$ grep ^CFLAGS Makefile 
CFLAGS = -g -O3 -fPIC

clean

[tingo@localhost musashi]$ make clean
rm -f m68kopac.c m68kopdm.c m68kopnz.c m68kops.c m68kops.h
rm -f m68kmake
rm -rf BUILD
rm -f libmusashi.so

retry build

[tingo@localhost musashi]$ make
mkdir BUILD
gcc -g -O3 -fPIC -c -o BUILD/m68kmake.o m68kmake.c
gcc -g -O3 -fPIC -o m68kmake BUILD/m68kmake.o
./m68kmake

 Musashi v3.3 68000, 68010, 68EC020, 68020 emulator
 Copyright 1998-2000 Karl Stenerud (karl@mame.net)

Generated 1962 opcode handlers from 513 primitives
gcc -g -O3 -fPIC -c -o BUILD/mem.o mem.c
gcc -g -O3 -fPIC -c -o BUILD/m68kcpu.o m68kcpu.c
gcc -g -O3 -fPIC -c -o BUILD/m68kdasm.o m68kdasm.c
gcc -g -O3 -fPIC -c -o BUILD/m68kopac.o m68kopac.c
gcc -g -O3 -fPIC -c -o BUILD/m68kopdm.o m68kopdm.c
gcc -g -O3 -fPIC -c -o BUILD/m68kopnz.o m68kopnz.c
gcc -g -O3 -fPIC -c -o BUILD/m68kops.o m68kops.c
gcc -shared -o libmusashi.so BUILD/mem.o BUILD/m68kcpu.o BUILD/m68kdasm.o BUILD/m68kopac.o BUILD/m68kopdm.o BUILD/m68kopnz.o BUILD/m68kops.o

ok

2018-03-17: get source

[tingo@localhost emul]$ git clone https://github.com/John-Titor/py68k.git
Cloning into 'py68k'...
remote: Counting objects: 263, done.
remote: Compressing objects: 100% (121/121), done.
remote: Total 263 (delta 156), reused 245 (delta 139), pack-reused 0
Receiving objects: 100% (263/263), 160.50 KiB | 502.00 KiB/s, done.
Resolving deltas: 100% (156/156), done.

ok

2018-03-17: gcc version

[tingo@localhost ~]$ gcc --version
gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

make version

[tingo@localhost ~]$ make --version
GNU Make 4.2.1
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

ok

2018-03-17: Testing on Fedora 27.

[tingo@localhost ~]$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: Fedora
Description: Fedora release 27 (Twenty Seven)
Release: 27
Codename: TwentySeven
[tingo@localhost ~]$ uname -a
Linux localhost.localdomain 4.15.6-300.fc27.x86_64 #1 SMP Mon Feb 26 18:43:03 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

ok.