Skip to content

Commit

Permalink
Merge pull request #326 from Gampyg28/d_WriteKernels
Browse files Browse the repository at this point in the history
Assembly Kernel Flash Write support Intel and AMD.
  • Loading branch information
antuspcm committed Jul 23, 2023
2 parents ded2676 + c1fd502 commit 43becd7
Show file tree
Hide file tree
Showing 6 changed files with 955 additions and 285 deletions.
22 changes: 2 additions & 20 deletions .github/workflows/CheckBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Original works by ddub07 <github.com>
# 03/01/2023 - GampyG28 <github.com> major overhaul, renamed and updated.
# 04/16/2023 - GampyG28 <github.com> Added Assembly Kernels and Loaders
# 07/16/2023 - GampyG28 <github.com> Removed C Kernel builds
#
name: CheckBuild

Expand All @@ -25,25 +26,6 @@ jobs:
- name: Create temporary artifact storage
run: mkdir TemporaryArtifactStorage

- name: Build C Kernels
run: |
cd Kernels
#
# The following loop is the one location that needs to be updated when adding a new C kernel.
#
for p in "P01 FF8000" "P10 FFB800" "P12 FF2000"; do
pcm=${p%% *}
address=${p##* }
echo Building Kernel ": ${pcm}"
make -f makefile PREFIX=/usr/bin/m68k-linux-gnu- pcm=${pcm} address=${address}
echo " Copy-Item Kernel-${pcm}.bin to TemporaryArtifactStorage"
cp Kernel-${pcm}.bin ../TemporaryArtifactStorage/
echo " Cleanup after Kernel-${pcm}"
echo
make clean
done
- name: Build Assembly Kernels and Loaders
run: |
cd Kernels
Expand All @@ -53,7 +35,7 @@ jobs:
# 2: Kernel Base Address
# 3: Loader Base Address or NOLOADER if a loader is not used.
#
for p in "P04 FF9090 FF9890" "P08 FFA800 FFB000" "E54 FF8F50 NOLOADER"; do
for p in "P01 FF8000 NOLOADER" "P04 FF9090 FF9890" "P08 FFA800 FFB000" "P10 FFB800 NOLOADER" "P12 FF2000 NOLOADER" "E54 FF8F50 NOLOADER"; do
pcm="${p%% *}";
p="${p#* }"
address="${p%% *}"
Expand Down
34 changes: 33 additions & 1 deletion Apps/PcmHammer/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,16 @@ private async void readFullContents_BackgroundThread()
string path = "";
this.Invoke((MethodInvoker)delegate ()
{
this.AddUserMessage($"WARNING: This version uses the new Assembly Kernels, USE AT YOUR OWN RISK!");
string msg = $"WARNING!{Environment.NewLine}This version uses the new Assembly Kernels, USE AT YOUR OWN RISK!" +
$"{Environment.NewLine}{Environment.NewLine}Are you willing to accept the responsibility ?";
DialogResult warnDialogResult = MessageBox.Show(msg, "Continue?", MessageBoxButtons.YesNo);
if (warnDialogResult == DialogResult.No)
{
this.AddUserMessage("User chose not to proceed.");
return;
}

path = this.ShowSaveAsDialog();

if (path == null)
Expand Down Expand Up @@ -1353,6 +1363,16 @@ private async void write_BackgroundThread(WriteType writeType, string path = nul
this.DisableUserInput();
this.cancelButton.Enabled = true;

this.AddUserMessage($"WARNING: This version uses the new Assembly Kernels, USE AT YOUR OWN RISK!");
string msg = $"WARNING!{Environment.NewLine}This version uses the new Assembly Kernels, USE AT YOUR OWN RISK!" +
$"{Environment.NewLine}{Environment.NewLine}Are you willing to accept the responsibility ?";
DialogResult warnDialogResult = MessageBox.Show(msg, "Continue?", MessageBoxButtons.YesNo);
if (warnDialogResult == DialogResult.No)
{
this.AddUserMessage("User chose not to proceed.");
return;
}

if (string.IsNullOrWhiteSpace(path))
{
path = this.ShowOpenDialog();
Expand Down Expand Up @@ -1496,14 +1516,26 @@ private async void write_BackgroundThread(WriteType writeType, string path = nul
}
}

if (writeType != WriteType.Compare && pcmInfo.HardwareType == PcmType.P04 && pcmInfo.HardwareType == PcmType.P08 && pcmInfo.HardwareType == PcmType.E54)
if (writeType != WriteType.Compare && (pcmInfo.HardwareType == PcmType.P04 || pcmInfo.HardwareType == PcmType.P08))
{
string msg = $"PCMHammer currently does not support writing to the {pcmInfo.HardwareType.ToString()}";
this.AddUserMessage(msg);
MessageBox.Show(msg);
return;
}

if (pcmInfo.HardwareType == PcmType.P04 || pcmInfo.HardwareType == PcmType.P08 || pcmInfo.HardwareType == PcmType.E54)
{
string msg = $"WARNING: {pcmInfo.HardwareType.ToString()} Support is still in development.";
this.AddUserMessage(msg);
DialogResult dialogResult = MessageBox.Show(msg, "Continue?", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.No)
{
this.AddUserMessage("User chose not to proceed.");
return;
}
}

await this.Vehicle.SuppressChatter();

if (needUnlock)
Expand Down
14 changes: 7 additions & 7 deletions Apps/PcmLibrary/Misc/FileValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,6 @@ private PcmType ValidateSignatures()
return PcmType.P04;
}

// P08 512Kb
this.logger.AddDebugMessage("Trying P08 512Kb");
if ((image[0x7FFFC] == 0xA5) && (image[0x7FFFD] == 0x5A) && (image[0x7FFFE] == 0xA5) && (image[0x7FFFF] == 0xA5))
{
return PcmType.P08;
}

this.logger.AddDebugMessage("Trying P10 512Kb");
if ((image[0x17FFE] == 0x55) && (image[0x17FFF] == 0x55))
{
Expand All @@ -430,6 +423,13 @@ private PcmType ValidateSignatures()
return PcmType.P10;
}
}

// P08 512Kb
this.logger.AddDebugMessage("Trying P08 512Kb");
if ((image[0x7FFFC] == 0xA5) && (image[0x7FFFD] == 0x5A) && (image[0x7FFFE] == 0xA5) && (image[0x7FFFF] == 0xA5))
{
return PcmType.P08;
}
}

// 1Mb types
Expand Down
7 changes: 4 additions & 3 deletions Kernels/BuildAll.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@ rem * They would need to be changed below.
setlocal disabledelayedexpansion
)

REM "-pP04 -aFF9090 -lFF9890 -x",

for %%A in (
"-pP01 -aFF8000",
"-pP01 -aFF8000 -x",
"-pP04 -aFF9090 -lFF9890 -x",
"-pP08 -aFFA800 -lFFB000 -x",
"-pP10 -aFFB800",
"-pP12 -aFF2000",
"-pP10 -aFFB800 -x",
"-pP12 -aFF2000 -x",
"-pE54 -aFF8F50 -x"
) do call Build.cmd %%~A %*

Loading

0 comments on commit 43becd7

Please sign in to comment.