From db659da8766540a65692b081efad15e417609cd8 Mon Sep 17 00:00:00 2001 From: Wayne Warthen Date: Mon, 8 Mar 2021 10:25:13 -0800 Subject: [PATCH] Build script improvements - Allow building a 128KB ROM with 0KB ROM disk - Move Z280 UART driver to top of device list to make it the highest priority driver for Z280 platforms --- Source/HBIOS/Build.ps1 | 49 +++++++++++++++++--------------- Source/HBIOS/Build.sh | 64 ++++++++++++++++++++++-------------------- Source/HBIOS/hbios.asm | 12 ++++---- Source/ver.inc | 2 +- Source/ver.lib | 2 +- 5 files changed, 68 insertions(+), 61 deletions(-) diff --git a/Source/HBIOS/Build.ps1 b/Source/HBIOS/Build.ps1 index d9928e2f..5f7fc69d 100644 --- a/Source/HBIOS/Build.ps1 +++ b/Source/HBIOS/Build.ps1 @@ -1,4 +1,4 @@ -param([string]$Platform = "", [string]$Config = "", [string]$RomSize = "512", [string]$RomName = "") +param([string]$Platform = "", [string]$Config = "", [int]$RomSize = 512, [string]$RomName = "") # # This PowerShell script performs the heavy lifting in the build of RomWBW. It handles the assembly @@ -65,8 +65,8 @@ while ($true) # while ($true) { - if (($RomSize -eq "256") -or ($RomSize -eq "512") -or ($RomSize -eq "1024")) {break} - $RomSize = (Read-Host -prompt "ROM Size [256|512|1024]").Trim() + if (($RomSize -eq 128) -or ($RomSize -eq 256) -or ($RomSize -eq 512) -or ($RomSize -eq 1024)) {break} + $RomSize = (Read-Host -prompt "ROM Size [128|256|512|1024]").Trim() } # @@ -114,7 +114,11 @@ $UpdFile = "${OutDir}/${RomName}.upd" # Final name of System ROM image if ($Platform -eq "UNA") {$Bios = 'una'} else {$Bios = 'wbw'} # List of RomWBW proprietary apps to imbed in ROM disk. -$RomApps = "assign","fdu","format","mode","rtc","survey","syscopy","sysgen","talk","timer","xm","inttest" +$RomApps = "assign","mode","rtc","syscopy","xm" +if ($RomSize -gt "256") +{ + $RomApps += "fdu","format","survey","sysgen","talk","timer","inttest" +} "" "Building ${RomName} ${ROMSize}KB ROM configuration ${Config} for Z${CPUType}..." @@ -211,31 +215,30 @@ if ($Platform -ne "UNA") # Create a blank ROM disk image to create a working ROM disk image Set-Content -Value ([byte[]](0xE5) * (([int]${RomSize} * 1KB) - 128KB)) -Encoding byte -Path $RomDiskFile -# Copy all files from the appropriate directory to the working ROM disk image -cpmcp -f $RomFmt $RomDiskFile ../RomDsk/ROM_${RomSize}KB/*.* 0: - -# Add any platform specific files to the working ROM disk image -if (Test-Path "../RomDsk/${Platform}/*.*") +if ($RomSize -gt 128) { - cpmcp -f $RomFmt $RomDiskFile ../RomDsk/${Platform}/*.* 0: -} + # Copy all files from the appropriate directory to the working ROM disk image + cpmcp -f $RomFmt $RomDiskFile ../RomDsk/ROM_${RomSize}KB/*.* 0: -# Add the proprietary RomWBW applications to the working ROM disk image -foreach ($App in $RomApps) -{ - cpmcp -f $RomFmt $RomDiskFile ../../Binary/Apps/$App.com 0: -} + # Add any platform specific files to the working ROM disk image + if (Test-Path "../RomDsk/${Platform}/*.*") + { + cpmcp -f $RomFmt $RomDiskFile ../RomDsk/${Platform}/*.* 0: + } + + # Add the proprietary RomWBW applications to the working ROM disk image + foreach ($App in $RomApps) + { + cpmcp -f $RomFmt $RomDiskFile ../../Binary/Apps/$App.com 0: + } -# Add the CP/M and ZSystem system images to the ROM disk (used by SYSCOPY) -if ($RomSize -ne "256") -{ + # Add the CP/M and ZSystem system images to the ROM disk (used by SYSCOPY) cpmcp -f $RomFmt $RomDiskFile ..\cpm22\cpm_${Bios}.sys 0:cpm.sys cpmcp -f $RomFmt $RomDiskFile ..\zsdos\zsys_${Bios}.sys 0:zsys.sys -} - -# Set all the files in the ROM disk image to read only for extra protection under flash file system. -cpmchattr -f $RomFmt $RomDiskFile r 0:*.* + # Set all the files in the ROM disk image to read only for extra protection under flash file system. + cpmchattr -f $RomFmt $RomDiskFile r 0:*.* +} # # Finally, the individual binary components are concatenated together to produce diff --git a/Source/HBIOS/Build.sh b/Source/HBIOS/Build.sh index df6e703c..6c351ae0 100755 --- a/Source/HBIOS/Build.sh +++ b/Source/HBIOS/Build.sh @@ -42,7 +42,7 @@ while ! echo ${configs[@]} | grep -s -w -q "$config" ; do done configfile=Config/${platform}_${config}.asm -while [ ! '(' "$romsize" = 1024 -o "$romsize" = 512 -o "$romsize" = 256 ')' ] ; do +while [ ! '(' "$romsize" = 1024 -o "$romsize" = 512 -o "$romsize" = 256 -o "$romsize" = 128 ')' ] ; do echo -n "Romsize :" read romsize done @@ -58,7 +58,10 @@ else BIOS=wbw fi -Apps=(assign fdu format mode rtc survey syscopy sysgen talk timer xm inttest) +Apps=(assign mode rtc syscopy xm) +if [ $romsize -gt 256 ] ; then + Apps+=(fdu format survey sysgen talk timer inttest) +fi blankfile=Blank${romsize}KB.dat romdiskfile=RomDisk.tmp @@ -113,43 +116,44 @@ fi echo "Building ${romsize}KB $romname ROM disk data file..." cp $blankfile $romdiskfile + +if [ $romsize -gt 128 ] ; then -echo placing files into $romdiskfile - -for file in $(ls -1 ../RomDsk/ROM_${romsize}KB/* | sort -V) ; do - echo " " $file - $CPMCP -f $romfmt $romdiskfile $file 0: -done - -if [ -d ../RomDsk/$platform ] ; then - for file in ../RomDsk/$platform/* ; do + echo placing files into $romdiskfile + + for file in $(ls -1 ../RomDsk/ROM_${romsize}KB/* | sort -V) ; do echo " " $file $CPMCP -f $romfmt $romdiskfile $file 0: done -fi - -echo "adding apps to $romdiskfile" -for i in ${Apps[@]} ; do - set +e - f=$(../../Tools/unix/casefn.sh ../../Binary/Apps/$i.com) - set -e - if [ -z "$f" ] ; then - echo " " $i "not found" - else - echo " " $f - $CPMCP -f $romfmt $romdiskfile $f 0: + + if [ -d ../RomDsk/$platform ] ; then + for file in ../RomDsk/$platform/* ; do + echo " " $file + $CPMCP -f $romfmt $romdiskfile $file 0: + done fi -done - -echo "copying systems to $romdiskfile" -if [ $romsize != 256 ] ; then + + echo "adding apps to $romdiskfile" + for i in ${Apps[@]} ; do + set +e + f=$(../../Tools/unix/casefn.sh ../../Binary/Apps/$i.com) + set -e + if [ -z "$f" ] ; then + echo " " $i "not found" + else + echo " " $f + $CPMCP -f $romfmt $romdiskfile $f 0: + fi + done + + echo "copying systems to $romdiskfile" $CPMCP -f $romfmt $romdiskfile ../CPM22/cpm_$BIOS.sys 0:cpm.sys $CPMCP -f $romfmt $romdiskfile ../ZSDOS/zsys_$BIOS.sys 0:zsys.sys + + echo "setting files in the ROM disk image to read only" + $CPMCH -f $romfmt $romdiskfile r 0:*.* fi -echo "setting files in the ROM disk image to read only" -$CPMCH -f $romfmt $romdiskfile r 0:*.* - if [ $platform = UNA ] ; then cp osimg.bin $outdir/UNA_WBW_SYS.bin cp $romdiskfile $outdir/UNA_WBW_ROM$romsize.bin diff --git a/Source/HBIOS/hbios.asm b/Source/HBIOS/hbios.asm index 9a43b700..ddb9b4c3 100644 --- a/Source/HBIOS/hbios.asm +++ b/Source/HBIOS/hbios.asm @@ -2202,6 +2202,9 @@ HB_PCINITTBL: #IF (ASCIENABLE) .DW ASCI_PREINIT #ENDIF +#IF (Z2UENABLE) + .DW Z2U_PREINIT +#ENDIF #IF (UARTENABLE) .DW UART_PREINIT #ENDIF @@ -2214,9 +2217,6 @@ HB_PCINITTBL: #IF (ACIAENABLE) .DW ACIA_PREINIT #ENDIF -#IF (Z2UENABLE) - .DW Z2U_PREINIT -#ENDIF #IF (PIO_4P | PIO_ZP) .DW PIO_PREINIT #ENDIF @@ -2248,6 +2248,9 @@ HB_INITTBL: #IF (ASCIENABLE) .DW ASCI_INIT #ENDIF +#IF (Z2UENABLE) + .DW Z2U_INIT +#ENDIF #IF (UARTENABLE) .DW UART_INIT #ENDIF @@ -2260,9 +2263,6 @@ HB_INITTBL: #IF (ACIAENABLE) .DW ACIA_INIT #ENDIF -#IF (Z2UENABLE) - .DW Z2U_INIT -#ENDIF #IF (DSRTCENABLE) .DW DSRTC_INIT #ENDIF diff --git a/Source/ver.inc b/Source/ver.inc index a0cd61b9..adcb7f08 100644 --- a/Source/ver.inc +++ b/Source/ver.inc @@ -2,4 +2,4 @@ #DEFINE RMN 1 #DEFINE RUP 1 #DEFINE RTP 0 -#DEFINE BIOSVER "3.1.1-pre.57" +#DEFINE BIOSVER "3.1.1-pre.58" diff --git a/Source/ver.lib b/Source/ver.lib index 1b49de90..7b76d538 100644 --- a/Source/ver.lib +++ b/Source/ver.lib @@ -3,5 +3,5 @@ rmn equ 1 rup equ 1 rtp equ 0 biosver macro - db "3.1.1-pre.57" + db "3.1.1-pre.58" endm