From 366ad2a9ef160a9b54e6b3e57f08e0f2d0bdc5da Mon Sep 17 00:00:00 2001 From: b1ackmai1er Date: Sun, 20 Dec 2020 21:08:12 +0800 Subject: [PATCH 1/3] Create an update image for flashing --- Source/HBIOS/Build.ps1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/HBIOS/Build.ps1 b/Source/HBIOS/Build.ps1 index 327f9a6f..6f682f29 100644 --- a/Source/HBIOS/Build.ps1 +++ b/Source/HBIOS/Build.ps1 @@ -92,19 +92,22 @@ $ErrorAction = 'Stop' # Directories of required build tools (TASM & cpmtools) $TasmPath = '..\..\tools\tasm32' $CpmToolsPath = '..\..\tools\cpmtools' +$CmpToolsPath = "..\..\tools\lzsa" # Add tool directories to PATH and setup TASM's TABS directory path $env:TASMTABS = $TasmPath -$env:PATH = $TasmPath + ';' + $CpmToolsPath + ';' + $env:PATH +$env:PATH = $TasmPath + ';' + $CpmToolsPath + ';' + $CmpToolsPath + ';' + $env:PATH # Initialize working variables $OutDir = "../../Binary" # Output directory for final image file $RomFmt = "wbw_rom${RomSize}" # Location of files to imbed in ROM disk $BlankROM = "Blank${RomSize}KB.dat" # An initial "empty" image for the ROM disk of propoer size $RomDiskFile = "RomDisk.tmp" # Temporary filename used to create ROM disk image +$SystemFile = "SysFile.tmp" $RomFile = "${OutDir}/${RomName}.rom" # Final name of ROM image $ComFile = "${OutDir}/${RomName}.com" # Final name of COM image (command line loadable HBIOS/CBIOS) $ImgFile = "${OutDir}/${RomName}.img" # Final name of IMG image (memory loadable HBIOS/CBIOS image) +$CmpRomFile = "${OutDir}/${RomName}.lza"# Final name of compresser ROM image # Select the proper CBIOS to include in the ROM. UNA is special. if ($Platform -eq "UNA") {$Bios = 'una'} else {$Bios = 'wbw'} @@ -242,10 +245,12 @@ if ($Platform -eq "UNA") } else { - Concat 'hbios_rom.bin','osimg.bin','osimg1.bin','osimg.bin',$RomDiskFile $RomFile + Concat 'hbios_rom.bin','osimg.bin','osimg1.bin','osimg.bin' $SystemFile + Concat $SystemFile,$RomDiskFile $RomFile Concat 'hbios_app.bin','osimg_small.bin' $ComFile # Concat 'hbios_img.bin','osimg_small.bin' $ImgFile } +lzsa -f2 $SystemFile $CmpRomFile # Remove the temporary working ROM disk file -Remove-Item $RomDiskFile +Remove-Item $SystemFile,$RomDiskFile From 708f6d36d6dc3b6b22dbab41987f662d295bbcbf Mon Sep 17 00:00:00 2001 From: b1ackmai1er <39449559+b1ackmai1er@users.noreply.github.com> Date: Tue, 22 Dec 2020 20:31:18 +0800 Subject: [PATCH 2/3] Update Build.ps1 Revert --- Source/HBIOS/Build.ps1 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Source/HBIOS/Build.ps1 b/Source/HBIOS/Build.ps1 index 6f682f29..327f9a6f 100644 --- a/Source/HBIOS/Build.ps1 +++ b/Source/HBIOS/Build.ps1 @@ -92,22 +92,19 @@ $ErrorAction = 'Stop' # Directories of required build tools (TASM & cpmtools) $TasmPath = '..\..\tools\tasm32' $CpmToolsPath = '..\..\tools\cpmtools' -$CmpToolsPath = "..\..\tools\lzsa" # Add tool directories to PATH and setup TASM's TABS directory path $env:TASMTABS = $TasmPath -$env:PATH = $TasmPath + ';' + $CpmToolsPath + ';' + $CmpToolsPath + ';' + $env:PATH +$env:PATH = $TasmPath + ';' + $CpmToolsPath + ';' + $env:PATH # Initialize working variables $OutDir = "../../Binary" # Output directory for final image file $RomFmt = "wbw_rom${RomSize}" # Location of files to imbed in ROM disk $BlankROM = "Blank${RomSize}KB.dat" # An initial "empty" image for the ROM disk of propoer size $RomDiskFile = "RomDisk.tmp" # Temporary filename used to create ROM disk image -$SystemFile = "SysFile.tmp" $RomFile = "${OutDir}/${RomName}.rom" # Final name of ROM image $ComFile = "${OutDir}/${RomName}.com" # Final name of COM image (command line loadable HBIOS/CBIOS) $ImgFile = "${OutDir}/${RomName}.img" # Final name of IMG image (memory loadable HBIOS/CBIOS image) -$CmpRomFile = "${OutDir}/${RomName}.lza"# Final name of compresser ROM image # Select the proper CBIOS to include in the ROM. UNA is special. if ($Platform -eq "UNA") {$Bios = 'una'} else {$Bios = 'wbw'} @@ -245,12 +242,10 @@ if ($Platform -eq "UNA") } else { - Concat 'hbios_rom.bin','osimg.bin','osimg1.bin','osimg.bin' $SystemFile - Concat $SystemFile,$RomDiskFile $RomFile + Concat 'hbios_rom.bin','osimg.bin','osimg1.bin','osimg.bin',$RomDiskFile $RomFile Concat 'hbios_app.bin','osimg_small.bin' $ComFile # Concat 'hbios_img.bin','osimg_small.bin' $ImgFile } -lzsa -f2 $SystemFile $CmpRomFile # Remove the temporary working ROM disk file -Remove-Item $SystemFile,$RomDiskFile +Remove-Item $RomDiskFile From 86fceb962bf184c18a141d459dc0c67b792ebbd3 Mon Sep 17 00:00:00 2001 From: b1ackmai1er Date: Tue, 22 Dec 2020 20:34:16 +0800 Subject: [PATCH 3/3] Update md.asm With flash file system enabled and verbose enabled, boot message will display if file system is enabled or disabled. --- Source/HBIOS/md.asm | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/Source/HBIOS/md.asm b/Source/HBIOS/md.asm index 75e1dd6e..8b901ea0 100644 --- a/Source/HBIOS/md.asm +++ b/Source/HBIOS/md.asm @@ -673,14 +673,18 @@ FF_PROBE: LD C,A ; DJNZ FF_PROBE ; ALWAYS AT LEAST ONE DEVICE + #IF (MD_FVBS==1) + CALL PRTSTRD + .TEXT " FLASH FILE SYSTEM $" + LD DE,MD_FFMSGDIS LD A,(MD_FFSEN) OR A JR NZ,MD_PR1 - CALL PRTSTRD - .TEXT " FLASH FILE SYSTEM ENABLED$" -MD_PR1: + LD DE,MD_FFMSGENA +MD_PR1: CALL WRITESTR #ENDIF + XOR A ; INIT SUCCEEDED RET ; @@ -699,8 +703,8 @@ MD_LAND: CALL PC_SPACE #ENDIF ; - LD HL,FF_TABLE ; SEARCH THROUGH THE FLASH - LD DE,FF_T_CNT ; TABLE TO FIND A MATCH + LD HL,MD_TABLE ; SEARCH THROUGH THE FLASH + LD DE,MD_T_CNT ; TABLE TO FIND A MATCH FF_NXT1:LD A,(HL) CP B JR NZ,FF_NXT0 ; FIRST BYTE DOES NOT MATCH @@ -716,7 +720,7 @@ FF_NXT1:LD A,(HL) JR FF_NXT2 ; MATCH SO EXIT ; FF_NXT0:PUSH BC ; WE DIDN'T MATCH SO POINT - LD BC,FF_T_SZ ; TO THE NEXT TABLE ENTRY + LD BC,MD_T_SZ ; TO THE NEXT TABLE ENTRY ADD HL,BC POP BC ; @@ -725,7 +729,7 @@ FF_NXT0:PUSH BC ; WE DIDN'T MATCH SO POINT DEC DE JR NZ,FF_NXT1 ; NOT AT END YET ; - LD HL,MD_UNKNOWN ; WE REACHED THE END WITHOUT A MATCH + LD HL,MD_FFMSGUNK ; WE REACHED THE END WITHOUT A MATCH ; FF_NXT2: #IF (MD_FVBS==1) @@ -938,28 +942,28 @@ MD_FERAS_S LD (HL),A ; COMMAND ; LD A,(HL) ; DO TWO SUCCESSIVE READS -FF_WT4: LD C,(HL) ; FROM THE SAME FLASH ADDRESS. +MD_WT4: LD C,(HL) ; FROM THE SAME FLASH ADDRESS. XOR C ; IF THE SAME ON BOTH READS BIT 6,A ; THEN ERASE IS COMPLETE SO EXIT. ; - JR Z,FF_WT5 ; BIT 6 = 0 IF SAME ON SUCCESSIVE READS = COMPLETE + JR Z,MD_WT5 ; BIT 6 = 0 IF SAME ON SUCCESSIVE READS = COMPLETE ; BIT 6 = 1 IF DIFF ON SUCCESSIVE READS = INCOMPLETE ; LD A,C ; OPERATION IS NOT COMPLETE. CHECK TIMEOUT BIT (BIT 5). BIT 5,C ; IF NO TIMEOUT YET THEN LOOP BACK AND KEEP CHECKING TOGGLE STATUS - JR Z,FF_WT4 ; IF BIT 5=0 THEN RETRY; NZ TRUE IF BIT 5=1 + JR Z,MD_WT4 ; IF BIT 5=0 THEN RETRY; NZ TRUE IF BIT 5=1 ; LD A,(HL) ; WE GOT A TIMOUT. RECHECK TOGGLE BIT IN CASE WE DID COMPLETE XOR (HL) ; THE OPERATION. DO TWO SUCCESSIVE READS. ARE THEY THE SAME? BIT 6,A ; IF THEY ARE THEN OPERATION WAS COMPLETED - JR Z,FF_WT5 ; OTHERWISE ERASE OPERATION FAILED OR TIMED OUT. + JR Z,MD_WT5 ; OTHERWISE ERASE OPERATION FAILED OR TIMED OUT. ; LD C,$F0 ; COMMON FAIL STATUS / PREPARE DEVICE RESET CODE LD (HL),C ; WRITE DEVICE RESET - JR FF_WT6 -FF_WT5: LD C,L ; SET SUCCESS STATUS + JR MD_WT6 +MD_WT5: LD C,L ; SET SUCCESS STATUS ; -FF_WT6: POP AF ; RETURN TO ORIGINAL BANK +MD_WT6: POP AF ; RETURN TO ORIGINAL BANK CALL HBX_BNKSEL ; WHICH IS OUR RAM BIOS COPY ; LD SP,(HBX_BUF + (MD_FEST-MD_FERAS_R)) ; RESTORE STACK @@ -1104,7 +1108,7 @@ MD_W_SZ .EQU $-MD_FWRIT_R ; SIZE OF RELOCATABLE CODE BUFFER REQUIRED #DEFCONT .DB FFROMNM \ #DEFCONT ; ; -FF_TABLE: +MD_TABLE: FF_CHIP(00120H,"29F010$ ") FF_CHIP(001A4H,"29F040$ ") FF_CHIP(01F04H,"AT49F001NT$") @@ -1123,9 +1127,11 @@ FF_CHIP(0BFB6H,"39F020$ ") FF_CHIP(0BFB7H,"39F040$ ") FF_CHIP(0C2A4H,"MX29F040$ ") ; -FF_T_CNT .EQU 17 -FF_T_SZ .EQU ($-FF_TABLE) / FF_T_CNT -MD_UNKNOWN .DB "UNKNOWN$" +MD_T_CNT .EQU 17 +MD_T_SZ .EQU ($-MD_TABLE) / MD_T_CNT +MD_FFMSGUNK .DB "UNKNOWN$" +MD_FFMSGDIS .DB "DISABLED$" +MD_FFMSGENA .DB "ENABLED$" ; ;====================================================================== ;