Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
29 changes: 0 additions & 29 deletions Build/Tools/NAsm/LICENSE

This file was deleted.

Binary file removed Build/Tools/NAsm/nasm.exe
Binary file not shown.
Binary file removed Build/Tools/NAsm/ndisasm.exe
Binary file not shown.
1 change: 0 additions & 1 deletion Build/Tools/NAsm/roff/.gitkeep

This file was deleted.

Binary file removed Build/Tools/NAsm/roff/ldrdf.exe
Binary file not shown.
Binary file removed Build/Tools/NAsm/roff/rdf2bin.exe
Binary file not shown.
Binary file removed Build/Tools/NAsm/roff/rdf2com.exe
Binary file not shown.
Binary file removed Build/Tools/NAsm/roff/rdf2ihx.exe
Binary file not shown.
Binary file removed Build/Tools/NAsm/roff/rdf2ith.exe
Binary file not shown.
Binary file removed Build/Tools/NAsm/roff/rdf2srec.exe
Binary file not shown.
Binary file removed Build/Tools/NAsm/roff/rdfdump.exe
Binary file not shown.
Binary file removed Build/Tools/NAsm/roff/rdflib.exe
Binary file not shown.
Binary file removed Build/Tools/NAsm/roff/rdx.exe
Binary file not shown.
3 changes: 0 additions & 3 deletions Build/Tools/NAsm/version.txt

This file was deleted.

2 changes: 1 addition & 1 deletion Setup/Cosmos.iss
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Type: filesandordirs; Name: "{app}"
[Files]
; Tools
Source: ".\Build\Tools\*.exe"; DestDir: "{app}\Build\Tools"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\Tools\NAsm\*.exe"; DestDir: "{app}\Build\Tools\NAsm"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\Tools\Yasm\*.exe"; DestDir: "{app}\Build\Tools\Yasm"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\Tools\Cygwin\*"; DestDir: "{app}\Build\Tools\cygwin"; Flags: ignoreversion uninsremovereadonly overwritereadonly
Source: ".\Build\Tools\mkisofs\*"; DestDir: "{app}\Build\Tools\mkisofs"; Flags: ignoreversion uninsremovereadonly overwritereadonly
Source: ".\Build\VSIP\IL2CPU\*"; DestDir: "{app}\Build\IL2CPU"; Flags: ignoreversion uninsremovereadonly recursesubdirs
Expand Down
7 changes: 4 additions & 3 deletions Tests/Cosmos.TestRunner.Core/Engine.Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,12 @@ private void RunIL2CPU(string kernelFileName, string outputFile)
private void RunNasm(string inputFile, string outputFile, bool isElf)
{
bool xUsingUserkit = false;
string xNasmPath = Path.Combine(FindCosmosRoot(), "Tools", "NASM");
//Path to nasm starter
string xNasmPath = Path.Combine(FindCosmosRoot(), "Tools", "Nasm");
if (!Directory.Exists(xNasmPath))
{
xUsingUserkit = true;
xNasmPath = Path.Combine(GetCosmosUserkitFolder(), "Build", "NASM");
xNasmPath = Path.Combine(GetCosmosUserkitFolder(), "Build", "Nasm");
}
if (!Directory.Exists(xNasmPath))
{
Expand All @@ -278,7 +279,7 @@ private void RunNasm(string inputFile, string outputFile, bool isElf)

var xArgs = new List<string>
{
$"ExePath:{Path.Combine(xUsingUserkit ? GetCosmosUserkitFolder() : FindCosmosRoot(), "Build", "Tools", "NAsm", "nasm.exe")}",
$"ExePath:{Path.Combine(xUsingUserkit ? GetCosmosUserkitFolder() : FindCosmosRoot(), "Build", "Tools", "Yasm", "yasm.exe")}",
$"InputFile:{inputFile}",
$"OutputFile:{outputFile}",
$"IsELF:{isElf}"
Expand Down
6 changes: 4 additions & 2 deletions Tools/NASM/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ public static int Run(string[] args, Action<string> logMessage, Action<string> l
}

string xFormat = IsELF ? "elf" : "bin";
string xArgs = string.Format("-g -f {0} -o \"{1}\" -D{3}_COMPILATION -O0 \"{2}\"",
string xDebugFormat = IsELF ? "dwarf2" : "null";
string xArgs = string.Format("-g {4} -f {0} -o \"{1}\" -D{3}_COMPILATION -O0 \"{2}\"",
xFormat,
Path.Combine(Directory.GetCurrentDirectory(), OutputFile),
Path.Combine(Directory.GetCurrentDirectory(), InputFile),
xFormat.ToUpper());
xFormat.ToUpper(),
xDebugFormat);

var xProcess = Process.Start(ExePath, xArgs);

Expand Down
74 changes: 74 additions & 0 deletions build/Tools/Yasm/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the author nor the names of other contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
NASM is now licensed under the 2-clause BSD license, also known as the
simplified BSD license.

Copyright 1996-2009 the NASM Authors - All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following
conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Binary file added build/Tools/Yasm/yasm.exe
Binary file not shown.
15 changes: 11 additions & 4 deletions source/Cosmos.Build.Tasks/Nasm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public string OutputFormat

private OutputFormatEnum mOutputFormat;

protected override string ToolName => IsWindows() ? "nasm.exe" : "nasm";
protected override string ToolName => IsWindows() ? "yasm.exe" : "yasm";

protected override MessageImportance StandardErrorLoggingImportance => MessageImportance.High;
protected override MessageImportance StandardOutputLoggingImportance => MessageImportance.High;
Expand Down Expand Up @@ -77,9 +77,16 @@ protected override string GenerateCommandLineCommands()
{
var xBuilder = new CommandLineBuilder();

xBuilder.AppendSwitch("-g");
if (mOutputFormat == OutputFormatEnum.ELF)
{
xBuilder.AppendSwitch("-g dwarf2");
}
else
{
xBuilder.AppendSwitch("-g null");
}

xBuilder.AppendSwitchIfNotNull("-f ", OutputFormat);
xBuilder.AppendSwitchIfNotNull("-f ", OutputFormat.ToLower());
xBuilder.AppendSwitchIfNotNull("-o ", OutputFile);

if (mOutputFormat == OutputFormatEnum.ELF)
Expand Down Expand Up @@ -111,7 +118,7 @@ public override bool Execute()
finally
{
xSW.Stop();
Log.LogMessage(MessageImportance.High, "Nasm task took {0}", xSW.Elapsed);
Log.LogMessage(MessageImportance.High, "Yasm task took {0}", xSW.Elapsed);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/Cosmos.Build.Tasks/build/Cosmos.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<PropertyGroup>
<CosmosToolsPath Condition="'$(CosmosToolsPath)' == ''">$(MSBuildThisFileDirectory)..\tools\</CosmosToolsPath>

<NasmToolPath Condition = "'$(NasmToolPath)' == ''">$(CosmosToolsPath)nasm\win\</NasmToolPath>
<NasmToolExe Condition = "'$(NasmToolExe)' == ''">nasm.exe</NasmToolExe>
<NasmToolPath Condition = "'$(NasmToolPath)' == ''">$(CosmosToolsPath)yasm\win\</NasmToolPath>
<NasmToolExe Condition = "'$(NasmToolExe)' == ''">yasm.exe</NasmToolExe>

<LdToolPath Condition = "'$(LdToolPath)' == ''">$(CosmosToolsPath)cygwin\win\</LdToolPath>
<LdToolExe Condition = "'$(LdToolExe)' == ''">ld.exe</LdToolExe>
Expand Down
29 changes: 0 additions & 29 deletions source/Cosmos.Build.Tasks/tools/nasm/win/LICENSE

This file was deleted.

Binary file removed source/Cosmos.Build.Tasks/tools/nasm/win/nasm.exe
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion source/Cosmos.Build.Tasks/tools/nasm/win/rdoff/.gitkeep

This file was deleted.

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.
3 changes: 0 additions & 3 deletions source/Cosmos.Build.Tasks/tools/nasm/win/version.txt

This file was deleted.

74 changes: 74 additions & 0 deletions source/Cosmos.Build.Tasks/tools/yasm/win/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the author nor the names of other contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
NASM is now licensed under the 2-clause BSD license, also known as the
simplified BSD license.

Copyright 1996-2009 the NASM Authors - All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following
conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Binary file not shown.