• ZINSTALL bash script

    From Nathanael@21:1/5 to All on Mon Apr 18 22:49:32 2022
    #!/bin/bash
    rootdir=$(pwd)
    [[ -z $1 ]] && zver=1.37 || zver=$1
    cd $rootdir

    function fetchz80pack () {
    echo ""
    echo "================================================"
    echo " Fetching Z80Pack "
    echo "================================================"
    echo ""

    case $zver in
    master | dev ) git clone https://github.com/udo-munk/z80pack.git
    cd $rootdir/z80pack
    git checkout $zver
    cd $rootdir
    ;;
    1.37 | 1.36 )
    echo "--------------------------"
    echo Installing zpack80-$zver.tgz
    echo "--------------------------"

    wget https://www.autometer.de/unix4fun/z80pack/ftp/z80pack-$zver.tgz && tar -xvf z80pack-$zver.tgz && rm z80pack-$zver.tgz
    mv z80pack-$zver z80pack
    cd $rootdir
    ;;
    * ) echo "Please specify the version of Z80Pack to install:"
    echo ""
    echo " ./doit xxxx"
    echo ""
    echo "Where 'xxxx' is one of dev master 1.36 1.37"
    exit 1
    ;;
    esac
    }

    function frontpanel () {

    echo ""
    echo "================================================"
    echo " Building Frontpanel "
    echo "================================================"
    echo ""

    cd $rootdir/z80pack/frontpanel
    make -f Makefile.linux
    echo "Enter your password if prompted:"
    sudo cp libfrontpanel.so /usr/lib
    cd $rootdir
    }

    function webfrontend () {
    echo ""
    echo "================================================"
    echo " Building Webfrontend "
    echo "================================================"
    echo ""

    cd $rootdir/z80pack/webfrontend/
    rm -r civetweb/
    git clone https://github.com/civetweb/civetweb.git
    cd civetweb
    git checkout 7259a80
    make lib WITH_WEBSOCKET=1 COPT='-DNO_SSL -DNO_CACHING'
    cd $rootdir
    }

    function cromemco () {
    echo ""
    echo "================================================"
    echo " Building Cromemco "
    echo "================================================"
    echo ""

    cd $rootdir/z80pack/cromemcosim/srcsim/
    sed -i '46s/.*/#define HAS_DISKMANAGER/' sim.h
    sed -i '47s/.*/#define HAS_NETSERVER/' sim.h
    make -f Makefile.linux
    cd $rootdir
    }

    function imsai () {
    echo ""
    echo "================================================"
    echo " Building Imsai "
    echo "================================================"
    echo ""

    cd $rootdir/z80pack/imsaisim/srcsim/
    sed -i '46s/.*/#define HAS_DISKMANAGER/' sim.h
    sed -i '47s/.*/#define HAS_NETSERVER/' sim.h
    make -f Makefile.linux
    echo "Enter your password if prompted:"
    sudo mkdir -p /usr/local/share/imsaisim/roms
    sudo cp $rootdir/z80pack/imsaisim/roms/*.* /usr/local/share/imsaisim/roms

    for i in cpm22 imdos202 imsai-cpm13 um-cpm13; do
    sed -i '8s|.*|env $BOOTENV ./imsaisim -r -z $*|' $rootdir/z80pack/imsaisim/$i
    done

    for i in cpm3 imdos205r0 ; do
    sed -i '9s|.*|env $BOOTENV ./imsaisim -r -z $*|' $rootdir/z80pack/imsaisim/$i
    done

    for i in ucsd ; do
    sed -i '10s|.*|env $BOOTENV ./imsaisim -r -z $*|' $rootdir/z80pack/imsaisim/$i
    done

    cd $rootdir
    }

    function altair () {

    echo ""
    echo "================================================"
    echo " Building Altair "
    echo "================================================"
    echo ""

    cd $rootdir/z80pack/altairsim/srcsim
    make -f Makefile.linux
    cd $rootdir
    }

    function mostek () {

    echo ""
    echo "================================================"
    echo " Building Mostek "
    echo "================================================"
    echo ""

    cd $rootdir/z80pack/mosteksim/srcsim
    make -f Makefile
    cd $rootdir
    }

    function cpm () {

    echo ""
    echo "================================================"
    echo " Building CP/M "
    echo "================================================"
    echo ""

    cd $rootdir/z80pack/cpmsim/srcsim
    make -f Makefile.linux
    cd $rootdir
    }

    function tools () {

    echo ""
    echo "================================================"
    echo " Compiling the tools dude! "
    echo "================================================"
    echo ""

    cd $rootdir/z80pack/cpmsim/srctools
    make
    echo "Enter your password if prompted:"
    sudo make install
    mkdir -p ~/bin
    PATH=$PATH:/home/nathanael/bin; export PATH
    for i in bin2hex cpmr.sh cpmw.sh mkdskimg ptp2bin receive send; do cp $i ~/bin; done
    chmod +777 /tmp/z80pack/cpmsim.aux*
    cd $rootdir
    }

    function preflight () {
    [[ -d ./z80pack ]] && { echo "Directory z80pack already exists. Remove it, then re-run this script."; exit 1; }

    dependencies="sudo wget git build-essential libjpeg8-dev libx11-dev mesa-common-dev libglu1-mesa-dev freeglut3-dev libxmu-dev socat"
    unset missing

    echo ""
    echo "---------------------------"
    echo "Testing for dependencies..."
    echo "---------------------------"
    echo ""

    for dependency in $dependencies; do
    echo $dependency
    dpkg -S $dependency >/dev/null 2>/dev/null || missing=$missing$dependency" "
    done

    [[ ! -z "$missing" ]] && {
    echo ""
    echo "-------------------------------------------------------------------------------"
    echo "ERROR: Some dependencies are missing. They must be installed before continuing."
    echo " They may be installed with: "
    echo " "
    echo " sudo apt-get install $missing "
    echo " "
    echo " Would you like to install these now? "
    echo "-------------------------------------------------------------------------------"
    echo ""

    while true; do
    read -p "Install now (Y/N)? " ans
    case ans in
    [yY]* ) sudo apt-get install $missing; exit 0 ;;
    [nN]* ) echo " "
    echo "-------------------------------------------------------------------------------"
    echo " **** Z80Pack installation is not complete. "
    echo "-------------------------------------------------------------------------------"
    echo ""
    exit 2
    ;;
    * ) echo "Please answer Y or N."; break ;;
    esac
    done
    } || {
    echo ""
    echo "All dependencies checked. Let's go!"
    echo ""
    }
    }

    # ==========
    # MAIN
    # ==========

    preflight
    fetchz80pack
    frontpanel
    [[ ! "$zver"=="1.36" ]] && webfrontend
    cpm
    tools
    cromemco
    imsai
    altair
    mostek

    echo ""
    echo "Z80Pack successfully installed! YAY!"
    echo ""

    exit 0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nathanael@21:1/5 to All on Mon Apr 18 22:50:44 2022
    ==============================
    dev branch imsai runtime error
    ==============================

    ##### ### ##### ### ##### ### # #
    # # # # # # # # # # # ## ##
    # # # # # # # # # # # # # #
    ##### # # ##### # # ##### ##### # # # #
    # # # # # # # # # # # #
    # # # # # # # # # # # # #
    ##### ### ##### ### ##### ### # #

    Release 1.38-dev, Copyright (C) 1987-2021 by Udo Munk
    IMSAI 8080 Simulation Release 1.19,
    Copyright (C) 2008-2021 by Udo Munk & 2018-2021 by David McNaughton

    CPU speed is 2 MHz, CPU executes undocumented instructions
    SIO 1A running at 115200 baud
    SIO 1B running at 110 baud
    SIO 2A running at 115200 baud
    SIO 2B running at 2400 baud

    Web server builtin, URL is http://localhost:8080

    RAM 0000H - FFFFH
    MMU has 7 additional RAM banks of 48 KB

    Loader statistics for file /usr/local/share/imsaisim/roms:
    START : FFFFH
    END : 0000H
    LOADED: 0002H (2)

    W (4915) diskmanager: No disk map: -z/disk.map, attempting to create file.
    W (4923) diskmanager: Can't create disk map: -z/disk.map
    MODEM.init string: ATS15=1

    SIO PORT MAP:
    SIO1.portA = WEBTTY STDIO
    SIO1.portB = VIOKBD
    SIO2.portA = WEBPTR SCKTSRV
    SIO2.portB = MODEM

    FrontPanel Simulator v2.1 Copyright (C) 2007-2015 by John Kichury
    readFile: could not open file /panel.conf
    fp_init: error initializing the panel
    E (6360) system: frontpanel error
    I (7000) netsrv: Server stopped.
    I (7016) netsrv: Bye!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nathanael@21:1/5 to All on Mon Apr 18 22:53:38 2022
    ===================================
    master branch cromemco build errors
    ===================================

    ./lnsrc
    gcc -O3 -c -Wall -Wextra -U_FORTIFY_SOURCE -DCONFDIR=\"/usr/local/share/cromemcosim/conf\" -DDISKSDIR=\"/usr/local/share/cromemcosim/disks\" -DBOOTROM=\"/usr/local/share/cromemcosim/bootrom.hex\" sim0.c
    In file included from sim0.c:66:
    sim.h:48:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘on’
    48 | * SIGIO on BSD sockets not working with Cygwin
    | ^~
    sim.h:48:10: error: unknown type name ‘on’
    In file included from sim0.c:67:
    simglb.h:55:8: error: unknown type name ‘WORD’
    55 | extern WORD PC, SP, IX, IY;
    | ^~~~
    simglb.h:91:8: error: unknown type name ‘WORD’
    91 | extern WORD t_start, t_end;
    | ^~~~
    simglb.h:96:8: error: unknown type name ‘WORD’
    96 | extern WORD fp_led_address;
    | ^~~~
    simglb.h:98:8: error: unknown type name ‘WORD’
    98 | extern WORD address_switch;
    | ^~~~
    In file included from sim0.c:72:
    memory.h:30:27: error: unknown type name ‘WORD’; did you mean ‘SWORD’?
    30 | static inline void memwrt(WORD addr, BYTE data)
    | ^~~~
    | SWORD
    memory.h:56:27: error: unknown type name ‘WORD’; did you mean ‘SWORD’?
    56 | static inline BYTE memrdr(WORD addr)
    | ^~~~
    | SWORD
    memory.h:76:29: error: unknown type name ‘WORD’; did you mean ‘SWORD’?
    76 | static inline BYTE dma_read(WORD addr)
    | ^~~~
    | SWORD
    memory.h:81:30: error: unknown type name ‘WORD’; did you mean ‘SWORD’?
    81 | static inline void dma_write(WORD addr, BYTE data)
    | ^~~~
    | SWORD
    memory.h:89:27: error: unknown type name ‘WORD’; did you mean ‘SWORD’?
    89 | static inline BYTE getmem(WORD addr)
    | ^~~~
    | SWORD
    memory.h:94:27: error: unknown type name ‘WORD’; did you mean ‘SWORD’?
    94 | static inline void putmem(WORD addr, BYTE data)
    | ^~~~
    | SWORD
    sim0.c: In function ‘main’:
    sim0.c:344:4: warning: implicit declaration of function ‘putmem’ [-Wimplicit-function-declaration]
    344 | putmem(i, m_flag);
    | ^~~~~~
    sim0.c: In function ‘save_core’:
    sim0.c:464:7: warning: implicit declaration of function ‘getmem’; did you mean ‘getdelim’? [-Wimplicit-function-declaration]
    464 | d = getmem(i);
    | ^~~~~~
    | getdelim
    make: *** [Makefile.linux:61: sim0.o] Error 1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nathanael@21:1/5 to All on Mon Apr 18 22:54:24 2022
    =================================
    master branch imsai runtime error
    =================================

    ####### ##### ### ##### ### # #
    # # # # # # # # ## ##
    # # # # # # # # # # #
    # ##### # # ##### ##### # # # #
    # # # # # # # # #
    # # # # # # # # # #
    ####### ##### ### ##### ### # #

    Release 1.37, Copyright (C) 1987-2021 by Udo Munk
    IMSAI 8080 Simulation Release 1.18,
    Copyright (C) 2008-2021 by Udo Munk & 2018-2021 by David McNaughton

    CPU speed is 2 MHz, CPU executes undocumented instructions
    RAM size bank 0 is 64 KB, MMU has 7 additional banks a 48 KB
    SIO 1A running at 9600 baud
    SIO 1B running at 1200 baud
    SIO 2A running at 9600 baud
    SIO 2B running at 2400 baud
    MPU-B Banked ROM/RAM enabled

    can't open file /usr/local/share/imsaisim/bootrom.hex

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nathanael@21:1/5 to All on Mon Apr 18 22:55:06 2022
    =================================
    1.37 branch cromemco build errors
    =================================

    ./lnsrc
    gcc -O3 -c -Wall -Wextra -U_FORTIFY_SOURCE -DCONFDIR=\"/usr/local/share/cromemcosim/conf\" -DDISKSDIR=\"/usr/local/share/cromemcosim/disks\" -DBOOTROM=\"/usr/local/share/cromemcosim/bootrom.hex\" sim0.c
    In file included from sim0.c:66:
    sim.h:48:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘on’
    48 | * SIGIO on BSD sockets not working with Cygwin
    | ^~
    sim.h:48:10: error: unknown type name ‘on’
    In file included from sim0.c:67:
    simglb.h:55:8: error: unknown type name ‘WORD’
    55 | extern WORD PC, SP, IX, IY;
    | ^~~~
    simglb.h:91:8: error: unknown type name ‘WORD’
    91 | extern WORD t_start, t_end;
    | ^~~~
    simglb.h:96:8: error: unknown type name ‘WORD’
    96 | extern WORD fp_led_address;
    | ^~~~
    simglb.h:98:8: error: unknown type name ‘WORD’
    98 | extern WORD address_switch;
    | ^~~~
    In file included from sim0.c:72:
    memory.h:29:27: error: unknown type name ‘WORD’; did you mean ‘SWORD’?
    29 | static inline void memwrt(WORD addr, BYTE data)
    | ^~~~
    | SWORD
    memory.h:53:27: error: unknown type name ‘WORD’; did you mean ‘SWORD’?
    53 | static inline BYTE memrdr(WORD addr)
    | ^~~~
    | SWORD
    memory.h:69:29: error: unknown type name ‘WORD’; did you mean ‘SWORD’?
    69 | static inline BYTE dma_read(WORD addr)
    | ^~~~
    | SWORD
    memory.h:74:30: error: unknown type name ‘WORD’; did you mean ‘SWORD’?
    74 | static inline void dma_write(WORD addr, BYTE data)
    | ^~~~
    | SWORD
    memory.h:82:27: error: unknown type name ‘WORD’; did you mean ‘SWORD’?
    82 | static inline BYTE getmem(WORD addr)
    | ^~~~
    | SWORD
    memory.h:87:27: error: unknown type name ‘WORD’; did you mean ‘SWORD’?
    87 | static inline void putmem(WORD addr, BYTE data)
    | ^~~~
    | SWORD
    sim0.c: In function ‘main’:
    sim0.c:316:4: warning: implicit declaration of function ‘putmem’ [-Wimplicit-function-declaration]
    316 | putmem(i, m_flag);
    | ^~~~~~
    sim0.c: In function ‘save_core’:
    sim0.c:436:7: warning: implicit declaration of function ‘getmem’; did you mean ‘getdelim’? [-Wimplicit-function-declaration]
    436 | d = getmem(i);
    | ^~~~~~
    | getdelim
    make: *** [Makefile.linux:61: sim0.o] Error 1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nathanael@21:1/5 to All on Mon Apr 18 22:55:48 2022
    ====================================
    1.36 cromemco and imsai build errors
    ====================================

    ================================================
    Building Cromemco ================================================

    ./lnsrc
    gcc -O3 -c -Wall -Wextra -U_FORTIFY_SOURCE -DCONFDIR=\"/usr/local/share/cromemcosim/conf\" -DDISKSDIR=\"/usr/local/share/cromemcosim/disks\" -DBOOTROM=\"/usr/local/share/cromemcosim/bootrom.hex\" sim0.c
    sim0.c: In function ‘main’:
    sim0.c:192:11: error: ‘I8080’ undeclared (first use in this function)
    192 | cpu = I8080;
    | ^~~~~
    sim0.c:192:11: note: each undeclared identifier is reported only once for each function it appears in
    sim0.c:196:11: error: ‘Z80’ undeclared (first use in this function)
    196 | cpu = Z80;
    | ^~~
    sim0.c: In function ‘init_cpu’:
    sim0.c:338:13: error: ‘I8080’ undeclared (first use in this function)
    338 | if (cpu == I8080) { /* i8080 specific */
    | ^~~~~
    sim0.c: In function ‘reset_cpu’:
    sim0.c:366:13: error: ‘Z80’ undeclared (first use in this function)
    366 | if (cpu == Z80) {
    | ^~~
    make: *** [Makefile.linux:60: sim0.o] Error 1

    ================================================
    Building Imsai ================================================

    ./lnsrc
    gcc -O3 -c -Wall -Wextra -U_FORTIFY_SOURCE -DCONFDIR=\"/usr/local/share/imsaisim/conf\" -DDISKSDIR=\"/usr/local/share/imsaisim/disks\" -DBOOTROM=\"/usr/local/share/imsaisim/bootrom.hex\" sim0.c
    In file included from sim0.c:65:
    sim.h:54:21: warning: "/*" within comment [-Wcomment]
    54 | #define LENCMD 80 /* length of command buffers etc */
    |
    sim0.c: In function ‘main’:
    sim0.c:257:31: error: ‘RELEASE’ undeclared (first use in this function)
    257 | printf("\nRelease %s, %s\n", RELEASE, COPYR);
    | ^~~~~~~
    sim0.c:257:31: note: each undeclared identifier is reported only once for each function it appears in
    sim0.c:257:40: error: ‘COPYR’ undeclared (first use in this function)
    257 | printf("\nRelease %s, %s\n", RELEASE, COPYR);
    | ^~~~~
    sim0.c: In function ‘load_file’:
    sim0.c:459:10: error: ‘LENCMD’ undeclared (first use in this function)
    459 | char fn[LENCMD];
    | ^~~~~~
    sim0.c:459:7: warning: unused variable ‘fn’ [-Wunused-variable]
    459 | char fn[LENCMD];
    | ^~
    sim0.c:490:1: warning: control reaches end of non-void function [-Wreturn-type]
    490 | }
    | ^
    make: *** [Makefile.linux:57: sim0.o] Error 1
    Enter your password if prompted:
    cp: cannot stat '/home/nathanael/temp/z80pack/imsaisim/roms/*.*': No such file or directory
    sed: can't read /home/nathanael/temp/z80pack/imsaisim/cpm3: No such file or directory

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Udo Munk@21:1/5 to Nathanael on Mon Apr 18 23:13:47 2022
    Nathanael schrieb am Dienstag, 19. April 2022 um 07:50:45 UTC+2:
    ...
    Loader statistics for file /usr/local/share/imsaisim/roms:
    ...
    readFile: could not open file /panel.conf
    fp_init: error initializing the panel
    E (6360) system: frontpanel error
    I (7000) netsrv: Server stopped.
    I (7016) netsrv: Bye!

    This looks like you try to run a system wide installation with data files in /usr/local/share/imsaisim,
    but you didn't copy the conf directory to there. A complete installation looks like this:

    udos-mbp:cpm udo$ ls /usr/local/share/imsaisim
    conf disks roms

    And all files in the subdirectories of course:

    udos-mbp:cpm udo$ ls /usr/local/share/imsaisim/conf
    blue_paint.jpg imsai_1600.jpg paddle_up_red.jpg
    case_left.jpg paddle_cent_blue.jpg panel.conf
    case_rear.jpg paddle_cent_red.jpg pwr_sw_dn.jpg
    case_right.jpg paddle_dn_blue.jpg pwr_sw_up.jpg
    envmap.jpg paddle_dn_red.jpg system.conf
    imsai_1024.jpg paddle_up_blue.jpg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Udo Munk@21:1/5 to Nathanael on Mon Apr 18 23:31:01 2022
    Nathanael schrieb am Dienstag, 19. April 2022 um 07:54:25 UTC+2:
    ...
    can't open file /usr/local/share/imsaisim/bootrom.hex
    ...

    System wide installation in /usr/local/share/imsaisim, but without copying the data files
    there.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Udo Munk@21:1/5 to Nathanael on Mon Apr 18 23:28:30 2022
    Nathanael schrieb am Dienstag, 19. April 2022 um 07:53:39 UTC+2:
    ...
    In file included from sim0.c:66:
    sim.h:48:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘on’
    48 | * SIGIO on BSD sockets not working with Cygwin
    | ^~
    sim.h:48:10: error: unknown type name ‘on’
    ...

    In this case you are using a C compiler that doesn't understand C comments anymore:

    /*
    * SIGIO on BSD sockets not working with Cygwin
    */
    #ifdef __CYGWIN__
    #undef TCPASYNC
    #endif

    No idea what kind of broken compiler environment produces this, on some systems I'm testing
    with gcc 4, 5, 6, 7, 8, 9 and llvm.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)