diff --git a/.gitignore b/.gitignore index ca0e7c16e..7bd807e5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1678,3 +1678,6 @@ software/FusionX/src/driver/MZ2000/emumz.c software/FusionX/src/driver/MZ2000/sharpmz.c software/FusionX/src/driver/MZ80A/z80driver.c.bad software/FusionX/src/driver/MZ80A/z80vhw_rfs.c.bad +software/FusionX/disk +software/FusionX/roms +software/linux/project/FusionX/ diff --git a/.gitmodules b/.gitmodules index 0fe64a128..9e0caca0c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "software/FusionX/src/driver/6502"] path = software/FusionX/src/driver/6502 url = https://github.com/redcode/6502.git +[submodule "software/FusionX/src/driver/software/FusionX/src/driver/6502"] + path = software/FusionX/src/driver/software/FusionX/src/driver/6502 + url = https://github.com/redcode/6502.git diff --git a/software/FusionX/bin/z80ctrl b/software/FusionX/bin/z80ctrl index f617a39c3..309d7f50b 100755 Binary files a/software/FusionX/bin/z80ctrl and b/software/FusionX/bin/z80ctrl differ diff --git a/software/FusionX/etc/startZ80_RFS.sh b/software/FusionX/etc/startZ80_RFS.sh new file mode 100755 index 000000000..883ebf58f --- /dev/null +++ b/software/FusionX/etc/startZ80_RFS.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +FUSIONXDIR=/apps/FusionX + +# Setup screen width, used to load correct RFS ROM images. +SCREENWIDTH=40 +if [[ "$#" -ne 0 ]]; then + if [[ "$1" -eq 80 ]]; then + SCREENWIDTH=80 + fi +fi +echo "Screen width set to: ${SCREENWIDTH}" + +# Detach CPU 1 from scheduler and IRQ's as it will be dedicated to the z80drv. +for f in `ps -eaf |grep -v kthread_z80 | awk '{print $1}'` +do + taskset -pc 0 $f >/dev/null 2>/dev/null +done + +# Detach IRQ's +for I in $(ls /proc/irq) +do + if [[ -d "/proc/irq/$I" ]] + then + echo 0 > /proc/irq/$I/smp_affinity_list 2>/dev/null + fi +done + +# Load the Z80 driver. Small pause to ensure the driver is fully loaded and initialsed prior to loading ROM images. +cd ${FUSIONXDIR}/modules +rmmod z80drv 2>/dev/null +insmod z80drv.ko +sleep 1 + +# Load the original RFS ROM images. +${FUSIONXDIR}/bin/z80ctrl --loadrom --file ${FUSIONXDIR}/rom/MROM_256_${SCREENWIDTH}c.bin --addr 0x000000 +${FUSIONXDIR}/bin/z80ctrl --loadrom --file ${FUSIONXDIR}/rom/USER_ROM_256_${SCREENWIDTH}c.bin --addr 0x80000 +${FUSIONXDIR}/bin/z80ctrl --loadrom --file ${FUSIONXDIR}/rom/USER_ROM_II_256_${SCREENWIDTH}c.bin --addr 0x100000 +${FUSIONXDIR}/bin/z80ctrl --loadrom --file ${FUSIONXDIR}/rom/USER_ROM_III_256_${SCREENWIDTH}c.bin --addr 0x180000 + +# Add the RFS Virtual Hardware to the driver. +${FUSIONXDIR}/bin/z80ctrl --adddev --device rfs + +# Start the Z80 (ie. MZ-80A virtual processor). +${FUSIONXDIR/bin/z80ctrl --start + +# Ensure the system is set for performance mode with max frequency. +# NB: Enabling this prior to starting the Z80 results in a kernel error. +echo performance > /sys/devices//system/cpu/cpufreq/policy0/scaling_governor +echo 1200000 > /sys/devices//system/cpu/cpufreq/policy0/scaling_min_freq + +# Done. +echo "FusionX loaded and configured in RFS mode." diff --git a/software/FusionX/etc/z80drv.sh b/software/FusionX/etc/z80drv.sh index 5712255d0..326cb924e 100755 --- a/software/FusionX/etc/z80drv.sh +++ b/software/FusionX/etc/z80drv.sh @@ -1,8 +1,11 @@ #!/bin/sh -cd /customer -./cpuset.sh +FUSIONXDIR=/apps/FusionX + +cd ${FUSIONXDIR}/modules +${FUSIONXDIR/etc/cpuset.sh rmmod z80drv 2>/dev/null insmod z80drv.ko +#echo performance > /sys/devices//system/cpu/cpufreq/policy0/scaling_governor #drvid=`ps -eaf | grep kthread_z80 | grep -v grep | awk '{print $1}'` #taskset -pc 1 $drvid diff --git a/software/FusionX/modules/z80drv.ko b/software/FusionX/modules/z80drv.ko index af0981599..ccf1917a5 100644 Binary files a/software/FusionX/modules/z80drv.ko and b/software/FusionX/modules/z80drv.ko differ diff --git a/software/FusionX/src/driver/6502 b/software/FusionX/src/driver/6502 new file mode 160000 index 000000000..8318be608 --- /dev/null +++ b/software/FusionX/src/driver/6502 @@ -0,0 +1 @@ +Subproject commit 8318be6089590ca27fc398c222b056cef148d1d0 diff --git a/software/FusionX/src/driver/software/FusionX/src/driver/6502 b/software/FusionX/src/driver/software/FusionX/src/driver/6502 new file mode 160000 index 000000000..8318be608 --- /dev/null +++ b/software/FusionX/src/driver/software/FusionX/src/driver/6502 @@ -0,0 +1 @@ +Subproject commit 8318be6089590ca27fc398c222b056cef148d1d0 diff --git a/software/FusionX/start_FusionX.sh b/software/FusionX/start_FusionX.sh index 0d5c4bdc8..e7315fbca 100644 --- a/software/FusionX/start_FusionX.sh +++ b/software/FusionX/start_FusionX.sh @@ -1,6 +1,10 @@ #!/bin/sh -ROOTDIR=/apps/FusionX +FUSIONXDIR=/apps/FusionX -cd ${ROOTDIR} -#nohup ${ROOTDIR}/bin/FusionX & +cd ${FUSIONXDIR} + +# Choose one of the initial options below. +# +# Host installs a virtual RFS board and initialises host. +${FUSIONXDIR}/etc/startZ80_RFS.sh