mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 04:18:43 +00:00
402 lines
16 KiB
XML
402 lines
16 KiB
XML
<Project>
|
|
|
|
<PropertyGroup>
|
|
<CosmosDir Condition="$(CosmosDir) == ''">$(AppData)\Cosmos User Kit</CosmosDir>
|
|
<KernelAssembliesDir>$(CosmosDir)\Kernel\</KernelAssembliesDir>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<BinFile Condition="'$(BinFile)' == ''">$(OutputPath)$(AssemblyName).bin</BinFile>
|
|
<IsoFile Condition="'$(IsoFile)' == ''">$(OutputPath)$(AssemblyName).iso</IsoFile>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<CosmosToolsPath Condition="'$(CosmosToolsPath)' == ''">$(MSBuildThisFileDirectory)..\tools\</CosmosToolsPath>
|
|
|
|
<NasmToolPath Condition = "'$(NasmToolPath)' == ''">$(CosmosToolsPath)nasm\win\</NasmToolPath>
|
|
<NasmToolExe Condition = "'$(NasmToolExe)' == ''">nasm.exe</NasmToolExe>
|
|
|
|
<LdToolPath Condition = "'$(LdToolPath)' == ''">$(CosmosToolsPath)cygwin\win\</LdToolPath>
|
|
<LdToolExe Condition = "'$(LdToolExe)' == ''">ld.exe</LdToolExe>
|
|
|
|
<ObjdumpToolPath Condition = "'$(ObjdumpToolPath)' == ''">$(CosmosToolsPath)cygwin\win\</ObjdumpToolPath>
|
|
<ObjdumpToolExe Condition = "'$(ObjdumpToolExe)' == ''">objdump.bat</ObjdumpToolExe>
|
|
|
|
<MkisofsToolPath Condition = "'$(MkisofsToolPath)' == ''">$(CosmosToolsPath)mkisofs\win\</MkisofsToolPath>
|
|
<MkisofsToolExe Condition = "'$(MkisofsToolExe)' == ''">mkisofs.exe</MkisofsToolExe>
|
|
|
|
<SyslinuxToolPath Condition = "'$(SyslinuxToolPath)' == ''">$(CosmosToolsPath)syslinux\win\</SyslinuxToolPath>
|
|
<SyslinuxToolExe Condition = "'$(SyslinuxToolExe)' == ''">syslinux.exe</SyslinuxToolExe>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<DebugEnabled Condition="'$(DebugEnabled)' == '' AND '$(Configuration)' == 'Debug'">True</DebugEnabled>
|
|
<DebugEnabled Condition="'$(DebugEnabled)' == ''">False</DebugEnabled>
|
|
|
|
<DebugCom Condition="'$(DebugCom)' == ''">1</DebugCom>
|
|
<DebugCom Condition="'$(DebugEnabled)' == 'False'">0</DebugCom>
|
|
|
|
<BinFormat Condition="'$(BinFormat)' == ''">ELF</BinFormat>
|
|
<DebugMode Condition="'$(DebugMode)' == ''">Source</DebugMode>
|
|
<TraceMode Condition="'$(TraceMode)' == ''">User</TraceMode>
|
|
<StackCorruptionDetectionEnabled Condition="'$(StackCorruptionDetectionEnabled)' == ''">True</StackCorruptionDetectionEnabled>
|
|
<StackCorruptionDetectionLevel Condition="'$(StackCorruptionDetectionLevel)' == ''">MethodFooters</StackCorruptionDetectionLevel>
|
|
<IgnoreDebugStubAttribute Condition="'$(IgnoreDebugStubAttribute)' == ''">False</IgnoreDebugStubAttribute>
|
|
|
|
<Il2cpuOutput Condition="'$(Il2cpuOutput)' == ''">$(OutputPath)$(AssemblyName).asm</Il2cpuOutput>
|
|
|
|
<NasmOutput Condition="'$(NasmOutput)' == '' AND '$(BinFormat)' == 'ELF'">$(OutputPath)$(AssemblyName).obj</NasmOutput>
|
|
<NasmOutput Condition="'$(NasmOutput)' == ''">$(OutputPath)$(AssemblyName).bin</NasmOutput>
|
|
|
|
<MapFile Condition="'$(MapFile)' == ''">$(OutputPath)$(AssemblyName).map</MapFile>
|
|
<CosmosDebugSymbolsFile Condition="'$(CosmosDebugSymbolsFile)' == ''">$(OutputPath)$(AssemblyName).cdb</CosmosDebugSymbolsFile>
|
|
|
|
<IntermediateIsoDirectory Condition="'$(IntermediateIsoDirectory)' == ''">$(OutputPath)ISO\</IntermediateIsoDirectory>
|
|
<SyslinuxPath Condition="'$(SyslinuxPath)' == ''">$(CosmosToolsPath)syslinux\bios\</SyslinuxPath>
|
|
|
|
<Deployment Condition="'$(Deployment)' == ''">ISO</Deployment>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<CosmosBuildTasksAssembly Condition="'$(CosmosBuildTasksAssembly)' == '' OR !Exists('$(CosmosBuildTasksAssembly)')">$(CosmosToolsPath)Cosmos.Build.Tasks.dll</CosmosBuildTasksAssembly>
|
|
</PropertyGroup>
|
|
|
|
<ItemDefinitionGroup Condition="'$(DefineExplicitDefaults)' == 'True'">
|
|
<Content>
|
|
<Deploy>False</Deploy>
|
|
</Content>
|
|
</ItemDefinitionGroup>
|
|
|
|
<ItemGroup>
|
|
<ContentToDeploy Include="@(Content->WithMetadataValue('Deploy', 'True'))" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<UpToDateCheckOutput Include="$(Il2cpuOutput)" />
|
|
<UpToDateCheckOutput Include="$(NasmOutput)" />
|
|
<UpToDateCheckOutput Include="$(IsoFile)" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup Condition="'$(KernelPkg)' == ''">
|
|
<PlugsReference Include="$(KernelAssembliesDir)Cosmos.Core_Asm.dll" />
|
|
<PlugsReference Include="$(KernelAssembliesDir)Cosmos.Core_Plugs.dll" />
|
|
<PlugsReference Include="$(KernelAssembliesDir)Cosmos.Debug.Kernel.Plugs.Asm.dll" />
|
|
<PlugsReference Include="$(KernelAssembliesDir)Cosmos.System2_Plugs.dll" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup Condition="'$(KernelPkg)' == 'X86'">
|
|
<PlugsReference Include="$(KernelAssembliesDir)Cosmos.CPU.x86.dll" />
|
|
<PlugsReference Include="$(KernelAssembliesDir)Cosmos.CPU_Asm.dll" />
|
|
<PlugsReference Include="$(KernelAssembliesDir)Cosmos.CPU_Plugs.dll" />
|
|
<PlugsReference Include="$(KernelAssembliesDir)Cosmos.Debug.Kernel.Plugs.Asm.dll" />
|
|
<PlugsReference Include="$(KernelAssembliesDir)Cosmos.Platform.PC.dll" />
|
|
<PlugsReference Include="$(KernelAssembliesDir)Cosmos.Plugs.TapRoot.dll" />
|
|
</ItemGroup>
|
|
|
|
<ItemDefinitionGroup Condition="'$(DefineExplicitDefaults)' == 'True'">
|
|
<PackageReference>
|
|
<IsPlugsReference>False</IsPlugsReference>
|
|
</PackageReference>
|
|
</ItemDefinitionGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Update="@(PackageReference)">
|
|
<ExcludeAssets Condition="'%(IsPlugsReference)' == 'True'">Compile</ExcludeAssets>
|
|
</PackageReference>
|
|
</ItemGroup>
|
|
|
|
<UsingTask TaskName="Cosmos.Build.Tasks.CreateMbr" AssemblyFile="$(CosmosBuildTasksAssembly)" />
|
|
<UsingTask TaskName="Cosmos.Build.Tasks.CreateSyslinuxConfig" AssemblyFile="$(CosmosBuildTasksAssembly)" />
|
|
<UsingTask TaskName="Cosmos.Build.Tasks.ExtractMapFromElfFile" AssemblyFile="$(CosmosBuildTasksAssembly)" />
|
|
<UsingTask TaskName="Cosmos.Build.Tasks.IL2CPU" AssemblyFile="$(CosmosBuildTasksAssembly)" />
|
|
<UsingTask TaskName="Cosmos.Build.Tasks.Launch" AssemblyFile="$(CosmosBuildTasksAssembly)" />
|
|
<UsingTask TaskName="Cosmos.Build.Tasks.Ld" AssemblyFile="$(CosmosBuildTasksAssembly)" />
|
|
<UsingTask TaskName="Cosmos.Build.Tasks.MakeIso" AssemblyFile="$(CosmosBuildTasksAssembly)" />
|
|
<UsingTask TaskName="Cosmos.Build.Tasks.Nasm" AssemblyFile="$(CosmosBuildTasksAssembly)" />
|
|
<UsingTask TaskName="Cosmos.Build.Tasks.ReadNasmMapToDebugInfo" AssemblyFile="$(CosmosBuildTasksAssembly)" />
|
|
<UsingTask TaskName="Cosmos.Build.Tasks.TheRingMaster" AssemblyFile="$(CosmosBuildTasksAssembly)" />
|
|
|
|
<PropertyGroup>
|
|
<CoreBuildDependsOn>$(CoreBuildDependsOn);CosmosBuild</CoreBuildDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<CosmosBuildDependsOn>
|
|
FailIfRelease;
|
|
TheRingMaster;
|
|
IL2CPU;
|
|
Nasm;
|
|
Ld;
|
|
ExtractMapFromElfFile;
|
|
ReadNasmMapToDebugInfo;
|
|
MakeIso
|
|
</CosmosBuildDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="CosmosBuild" DependsOnTargets="$(CosmosBuildDependsOn)" />
|
|
|
|
<Target Name="FailIfRelease" Condition="'$(Configuration)' == 'Release'">
|
|
<Error Text="The Release configuration isn't currently supported!" />
|
|
</Target>
|
|
|
|
<!--
|
|
================================================================================
|
|
TheRingMaster
|
|
================================================================================
|
|
-->
|
|
<Target Name="TheRingMaster">
|
|
|
|
<!--
|
|
Disabled for now
|
|
-->
|
|
<!--<TheRingMaster KernelAssemblyPath="$(TargetPath)"
|
|
ToolPath="$(TheRingMasterToolPath)"
|
|
ToolExe="$(TheRingMasterToolExe)" />-->
|
|
|
|
</Target>
|
|
|
|
<Target Name="IL2CPU"
|
|
Inputs="$(TargetPath);@(PlugsReference)"
|
|
Outputs="$(Il2cpuOutput)"
|
|
DependsOnTargets="ResolveReferences;_ComputeNetPublishAssets">
|
|
|
|
<ItemGroup>
|
|
<_Il2cpuAssemblies Include="@(ResolvedAssembliesToPublish)"
|
|
Condition="'%(ResolvedAssembliesToPublish.AssetType)' != 'native'
|
|
AND '%(ResolvedAssembliesToPublish.Extension)' == '.dll'" />
|
|
</ItemGroup>
|
|
|
|
<IL2CPU KernelPkg="$(KernelPkg)"
|
|
DebugMode="$(DebugMode)"
|
|
DebugEnabled="$(DebugEnabled)"
|
|
StackCorruptionDetectionEnabled="$(StackCorruptionDetectionEnabled)"
|
|
StackCorruptionDetectionLevel="$(StackCorruptionDetectionLevel)"
|
|
TraceAssemblies="$(TraceAssemblies)"
|
|
IgnoreDebugStubAttribute="$(IgnoreDebugStubAttribute)"
|
|
DebugCom="$(DebugCom)"
|
|
TargetAssembly="$(TargetPath)"
|
|
References="@(_Il2cpuAssemblies)"
|
|
PlugsReferences="@(PlugsReference)"
|
|
OutputFilename="$(Il2cpuOutput)"
|
|
EnableLogging="True"
|
|
EmitDebugSymbols="$(DebugSymbols)"
|
|
CosmosBuildDir="$(CosmosDir)\Build"
|
|
WorkingDir="$(TargetDir)"
|
|
ToolPath="$(Il2cpuToolPath)"
|
|
ToolExe="$(Il2cpuToolExe)" />
|
|
|
|
</Target>
|
|
|
|
<!--
|
|
================================================================================
|
|
Nasm
|
|
|
|
[IN]
|
|
$(Il2cpuOutput) - a .asm file.
|
|
|
|
[OUT]
|
|
$(NasmOutput) - a .obj file.
|
|
|
|
================================================================================
|
|
-->
|
|
<Target Name="Nasm"
|
|
Inputs="$(Il2cpuOutput)"
|
|
Outputs="$(NasmOutput)">
|
|
|
|
<NASM InputFile="$(Il2cpuOutput)"
|
|
OutputFile="$(NasmOutput)"
|
|
OutputFormat="$(BinFormat)"
|
|
ToolPath="$(NasmToolPath)"
|
|
ToolExe="$(NasmToolExe)" />
|
|
|
|
</Target>
|
|
|
|
<!--
|
|
================================================================================
|
|
Ld
|
|
|
|
[IN]
|
|
$(NasmOutput) - NASM output.
|
|
|
|
[OUT]
|
|
$(BinFile) - a linked file.
|
|
|
|
================================================================================
|
|
-->
|
|
<Target Name="Ld"
|
|
Inputs="$(NasmOutput)"
|
|
Outputs="$(BinFile)"
|
|
Condition="'$(BinFormat)' == 'ELF'">
|
|
|
|
<Ld InputFiles="$(NasmOutput)"
|
|
OutputFile="$(BinFile)"
|
|
TextAddress="0x2000000"
|
|
DataAddress="0x1000000"
|
|
Entry="Kernel_Start"
|
|
ToolPath="$(LdToolPath)"
|
|
ToolExe="$(LdToolExe)" />
|
|
|
|
</Target>
|
|
|
|
<!--
|
|
================================================================================
|
|
ExtractMapFromElfFile
|
|
|
|
[IN]
|
|
$(BinFile) - a binary file.
|
|
|
|
[OUT]
|
|
$(CosmosDebugSymbolsPath) - a debug symbols file.
|
|
|
|
================================================================================
|
|
-->
|
|
<Target Name="ExtractMapFromElfFile"
|
|
Inputs="$(BinFile)"
|
|
Outputs="$(CosmosDebugSymbolsFile)"
|
|
Condition="'$(BinFormat)' == 'ELF'">
|
|
|
|
<ExtractMapFromElfFile InputFile="$(BinFile)"
|
|
MapFile="$(MapFile)"
|
|
DebugInfoFile="$(CosmosDebugSymbolsFile)"
|
|
ToolPath="$(ObjdumpToolPath)"
|
|
ToolExe="$(ObjdumpToolExe)" />
|
|
|
|
</Target>
|
|
|
|
<!--
|
|
================================================================================
|
|
ReadNasmMapToDebugInfo
|
|
|
|
[IN]
|
|
$(MapFile) - a NASM map file.
|
|
|
|
[OUT]
|
|
$(CosmosDebugSymbolsPath) - a debug symbols file.
|
|
|
|
================================================================================
|
|
-->
|
|
<Target Name="ReadNasmMapToDebugInfo"
|
|
Inputs="$(MapFile)"
|
|
Outputs="$(CosmosDebugSymbolsFile)"
|
|
Condition="'$(BinFormat)' != 'ELF'">
|
|
|
|
<ReadNasmMapToDebugInfo MapFile="$(MapFile)"
|
|
DebugInfoFile="$(CosmosDebugSymbolsFile)" />
|
|
|
|
</Target>
|
|
|
|
<!--
|
|
================================================================================
|
|
MakeISO
|
|
|
|
[IN]
|
|
$(BinFile) - a binary file.
|
|
|
|
[OUT]
|
|
$(IsoFile) - a bootable ISO file.
|
|
|
|
================================================================================
|
|
-->
|
|
<Target Name="MakeIso"
|
|
Inputs="$(BinFile)"
|
|
Outputs="$(IsoFile)"
|
|
Condition="'$(Deployment)' == 'ISO'">
|
|
|
|
<ItemGroup>
|
|
<_IsoFile Include="$(SyslinuxPath)core\isolinux.bin" />
|
|
<_IsoFile Include="$(SyslinuxPath)com32\elflink\ldlinux\ldlinux.c32" />
|
|
<_IsoFile Include="$(SyslinuxPath)com32\lib\libcom32.c32" />
|
|
<_IsoFile Include="$(SyslinuxPath)com32\mboot\mboot.c32" />
|
|
<_IsoFile Include="$(BinFile)" />
|
|
<_IsoFile Include="@(ContentToDeploy)" />
|
|
</ItemGroup>
|
|
|
|
<RemoveDir Directories="$(IntermediateIsoDirectory)" />
|
|
<MakeDir Directories="$(IntermediateIsoDirectory)" />
|
|
|
|
<Copy SourceFiles="@(_IsoFile)"
|
|
DestinationFolder="$(IntermediateIsoDirectory)" />
|
|
|
|
<CreateSyslinuxConfig TargetDirectory="$(IntermediateIsoDirectory)"
|
|
BinName="$([System.IO.Path]::GetFileName('$(BinFile)'))" />
|
|
|
|
<MakeIso IsoDirectory="$(IntermediateIsoDirectory)"
|
|
OutputFile="$(IsoFile)"
|
|
ToolPath="$(MkisofsToolPath)"
|
|
ToolExe="$(MkisofsToolExe)" />
|
|
|
|
</Target>
|
|
|
|
<!--
|
|
TODO: When this is an SDK, rename to Publish and remove BeforeTargets and the PropertyGroup.
|
|
-->
|
|
<Target Name="BootablePublish"
|
|
BeforeTargets="Publish"
|
|
DependsOnTargets="Build">
|
|
|
|
<PropertyGroup>
|
|
<IsPublishable>False</IsPublishable>
|
|
</PropertyGroup>
|
|
|
|
<Error Condition="'$(PublishType)' == ''" Text="No publish type specified!" />
|
|
|
|
</Target>
|
|
|
|
<Target Name="IsoPublish"
|
|
AfterTargets="Publish"
|
|
Condition="'$(PublishType)' == 'ISO'">
|
|
|
|
<Error Condition="'$(IsoPublishOutputPath)' == ''" Text="No ISO publish output path specified!" />
|
|
<Error Condition="'$(Deployment)' != 'ISO'" Text="Deployment type should be ISO!" />
|
|
|
|
<MakeDir Directories="$([System.IO.Path]::GetDirectoryName('$(IsoPublishOutputPath)'))" />
|
|
<Copy SourceFiles="$(IsoFile)" DestinationFiles="$(IsoPublishOutputPath)" />
|
|
|
|
</Target>
|
|
|
|
<Target Name="UsbPublish"
|
|
AfterTargets="Publish"
|
|
Condition="'$(PublishType)' == 'USB'">
|
|
|
|
<Error Condition="'$(UsbPublishDrive)' == ''" Text="No USB drive specified!" />
|
|
<Error Condition="'$(Deployment)' != 'ISO'" Text="Deployment type should be ISO!" />
|
|
<Error Condition="'$(OS)' != 'Windows_NT'" Text="USB publish only works on Windows!" />
|
|
|
|
<PropertyGroup>
|
|
<UsbPublishFormatDrive Condition="'$(UsbPublishFormatDrive)' == ''">False</UsbPublishFormatDrive>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<_UsbFile Include="$(SyslinuxPath)com32\elflink\ldlinux\ldlinux.c32" />
|
|
<_UsbFile Include="$(SyslinuxPath)com32\lib\libcom32.c32" />
|
|
<_UsbFile Include="$(SyslinuxPath)com32\mboot\mboot.c32" />
|
|
<_UsbFile Include="$(BinFile)" />
|
|
</ItemGroup>
|
|
|
|
<Copy SourceFiles="@(_UsbFile)"
|
|
DestinationFolder="$(UsbPublishDrive)" />
|
|
|
|
<CreateSyslinuxConfig TargetDirectory="$(UsbPublishDrive)"
|
|
BinName="$([System.IO.Path]::GetFileName('$(BinFile)'))" />
|
|
|
|
<CreateMbr TargetDrive="$(UsbPublishDrive)"
|
|
FormatDrive="$(UsbPublishFormatDrive)"
|
|
ToolPath="$(SyslinuxToolPath)"
|
|
ToolExe="$(SyslinuxToolExe)" />
|
|
|
|
</Target>
|
|
|
|
<Target Name="Launch">
|
|
|
|
<Launch ConfigurationFile="$(OutputPath)Bochs.bxrc"
|
|
IsoFile="$(MSBuildProjectDirectory)\$(IsoFile)" />
|
|
|
|
</Target>
|
|
|
|
<PropertyGroup>
|
|
<CosmosDesignTimeTargetsPath Condition="'$(CosmosDesignTimeTargetsPath)'==''">$(MSBuildExtensionsPath)\Cosmos\Cosmos.DesignTime.targets</CosmosDesignTimeTargetsPath>
|
|
</PropertyGroup>
|
|
|
|
<Import Project="$(CosmosDesignTimeTargetsPath)" Condition="'$(CosmosDesignTimeTargetsPath)' != '' AND Exists('$(CosmosDesignTimeTargetsPath)')" />
|
|
|
|
</Project>
|