Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for UEFI #2828

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/Cosmos.Build.Tasks/IL2CPU.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public IL2CPU()

protected override string GenerateFullPathToTool()
{
if (String.IsNullOrWhiteSpace(ToolPath))
if (string.IsNullOrWhiteSpace(ToolPath))
{
return Path.Combine(CosmosBuildDir, IsWindows() ? @"IL2CPU\IL2CPU.exe" : "IL2CPU/IL2CPU");
}
Expand Down
11 changes: 6 additions & 5 deletions source/Cosmos.Build.Tasks/LimineDeploy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ public class LimineDeploy : ToolTask
[Required]
public string LimineIsoFile { get; set; }

protected override string ToolName => IsWindows() ? "limine-deploy.exe" : "limine-deploy";
protected override string ToolName => IsWindows() ? "limine.exe" : "limine";

protected override string GenerateFullPathToTool()
{
return String.IsNullOrWhiteSpace(ToolExe) ? null : Path.Combine(String.IsNullOrWhiteSpace(ToolPath) ? Directory.GetCurrentDirectory() : Path.GetFullPath(ToolPath), ToolExe);
return string.IsNullOrWhiteSpace(ToolExe) ? null : Path.Combine(string.IsNullOrWhiteSpace(ToolPath) ? Directory.GetCurrentDirectory() : Path.GetFullPath(ToolPath), ToolExe);
}

protected override string GenerateCommandLineCommands()
{
var xBuilder = new CommandLineBuilder();
xBuilder.AppendSwitch($"{IsoFile}");
CommandLineBuilder xBuilder = new();
xBuilder.AppendSwitch($"bios-install");
xBuilder.AppendFileNameIfNotNull($"{IsoFile}");

return xBuilder.ToString();
}
}
}
7 changes: 5 additions & 2 deletions source/Cosmos.Build.Tasks/MakeIso.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ protected override string GenerateCommandLineCommands()
xBuilder.AppendSwitch("-R");
xBuilder.AppendSwitch("-l");
xBuilder.AppendSwitchIfNotNull("-o ", OutputFile);
xBuilder.AppendSwitch(" -b boot/limine-cd.bin");
xBuilder.AppendSwitch(" -b boot/limine-bios-cd.bin");
xBuilder.AppendSwitch("-no-emul-boot");
xBuilder.AppendSwitch("-boot-load-size 4");
xBuilder.AppendSwitch("-boot-info-table");
xBuilder.AppendSwitch("-boot-info-table");
xBuilder.AppendSwitch("--efi-boot boot/limine-uefi-cd.bin");
xBuilder.AppendSwitch("-efi-boot-part");
xBuilder.AppendSwitch("--efi-boot-image");
xBuilder.AppendFileNameIfNotNull(IsoDirectory.TrimEnd('\\', '/'));

Log.LogMessage(MessageImportance.High, xBuilder.ToString());
Expand Down
12 changes: 9 additions & 3 deletions source/Cosmos.Build.Tasks/build/Cosmos.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,9 @@
</ItemGroup>

<ItemGroup>
<_IsoFile Include="$(LiminePath)boot\limine-cd.bin" />
<_IsoFile Include="$(LiminePath)boot\limine.sys" />
<_IsoFile Include="$(LiminePath)boot\limine-uefi-cd.bin" />
<_IsoFile Include="$(LiminePath)boot\limine-bios-cd.bin" />
<_IsoFile Include="$(LiminePath)boot\limine-bios.sys" />
<_IsoFile Include="$(LiminePath)boot\liminewp.bmp" />
</ItemGroup>

Expand All @@ -366,7 +367,12 @@

<Copy SourceFiles="@(_IsoFile)"
DestinationFolder="$(IntermediateIsoDirectory)\boot\" />


<Copy SourceFiles="$(LiminePath)EFI\boot\BOOTAA64.EFI" DestinationFolder="$(IntermediateIsoDirectory)\EFI\boot\" />
<Copy SourceFiles="$(LiminePath)EFI\boot\BOOTIA32.EFI" DestinationFolder="$(IntermediateIsoDirectory)\EFI\boot\" />
<Copy SourceFiles="$(LiminePath)EFI\boot\BOOTRISCV64.EFI" DestinationFolder="$(IntermediateIsoDirectory)\EFI\boot\" />
<Copy SourceFiles="$(LiminePath)EFI\boot\BOOTX64.EFI" DestinationFolder="$(IntermediateIsoDirectory)\EFI\boot\" />

<Copy SourceFiles="@(_IsoCustomFiles)"
DestinationFolder="$(IntermediateIsoDirectory)%(RecursiveDir)"
SkipUnchangedFiles="true"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.