Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Ongoing VS2015 work.
  • Loading branch information
mterwoord committed Jul 23, 2015
1 parent d285220 commit d827212
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 28 deletions.
10 changes: 5 additions & 5 deletions Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs
Expand Up @@ -13,16 +13,16 @@ public static void Apply(Engine engine)

engine.AllowedSecondsInKernel = 120;

// Currently, there's still a bug somewhere for testing vmware.
//engine.RunTargets.Remove(RunTargetEnum.Bochs);
// If you want to exclude a testing platform, modify uncomment and modify the following line
engine.RunTargets.Remove(RunTargetEnum.VMware);

// if you're working on the compiler (or other lower parts), you can choose to run the compiler in process
// 1 thing to keep in mind though, is that this only works with 1 kernel at a time!
engine.RunIL2CPUInProcess = false;
engine.RunIL2CPUInProcess = true;

engine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location);
engine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location);
engine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location);
//engine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location);
//engine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location);

// known bugs, therefor disabled for now:
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Cosmos.TestRunner.Core/Engine.Helpers.cs
Expand Up @@ -36,7 +36,7 @@ private void RunIL2CPU(string kernelFileName, string outputFile)
var xArguments = new[]
{
"DebugEnabled:True",
"StackCorruptionDetectionEnabled:False",
"StackCorruptionDetectionEnabled:true",
"DebugMode:Source",
"TraceAssemblies:",
"DebugCom:1",
Expand Down
8 changes: 8 additions & 0 deletions Tests/Cosmos.TestRunner.Core/Engine.Running.cs
Expand Up @@ -45,6 +45,14 @@ private void InitializeDebugConnector(DebugConnector debugConnector)
debugConnector.CmdBreak = t =>
{
};
debugConnector.CmdStackCorruptionOccurred =
a =>
{
OutputHandler.LogMessage("Stackcorruption occurred at: 0x" + a.ToString("X8"));
OutputHandler.SetKernelTestResult(false, "Stackcorruption occurred at: 0x" + a.ToString("X8"));
mKernelResultSet = true;
mKernelRunning = false;
};
}

private void HandleRunning(DebugConnector debugConnector, Base host)
Expand Down
2 changes: 1 addition & 1 deletion Tests/Cosmos.TestRunner/Program.cs
Expand Up @@ -21,7 +21,7 @@ static void Main(string[] args)
var xOutputXml = new OutputHandlerXml();
xEngine.OutputHandler = new MultiplexingOutputHandler(
xOutputXml,
new OutputHandlerConsole());
new OutputHandlerFullConsole());

xEngine.Execute();

Expand Down
2 changes: 1 addition & 1 deletion install-VS2015.bat
@@ -1,7 +1,7 @@
@REM Delete so if builder fails it wont exist
del source\Cosmos.Build.Builder\bin\Debug\Cosmos.Build.Builder.*

%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "source\Builder.sln" /nologo /maxcpucount /p:Configuration=Debug /p:Platform=x86
"%ProgramFiles(x86)%\MSBuild\14.0\Bin\msbuild.exe" "source\Builder.sln" /nologo /maxcpucount /p:Configuration=Debug /p:Platform=x86

@if not exist source\Cosmos.Build.Builder\bin\Debug\Cosmos.Build.Builder.exe goto error

Expand Down
11 changes: 6 additions & 5 deletions source/Cosmos.Build.Builder/CosmosTask.cs
Expand Up @@ -41,6 +41,7 @@ public static string GetSetupName(int releaseNumber)
case VsVersion.Vs2015:
setupName += "-vs2015";
break;

}

if (App.UseVsHive)
Expand Down Expand Up @@ -82,7 +83,7 @@ public static string GetSetupName(int releaseNumber)

CompileCosmos(); //Working
CopyTemplates();

CreateScriptToUseChangesetWhichTaskIsUse();

CreateSetup(); //Working
Expand Down Expand Up @@ -119,7 +120,7 @@ public static string GetSetupName(int releaseNumber)
}

protected void MsBuild(string aSlnFile, string aBuildCfg) {
string xMsBuild = Path.Combine(Paths.Windows, @"Microsoft.NET\Framework\v4.0.30319\msbuild.exe");
string xMsBuild = Path.Combine(Paths.ProgFiles32, @"MSBuild\14.0\Bin\msbuild.exe");
string xParams = Quoted(aSlnFile) + @" /maxcpucount /verbosity:normal /nologo /p:Configuration=" + aBuildCfg + " /p:Platform=x86 /p:OutputPath=" + Quoted(mOutputDir);
// Clean then build: http://adrianfoyn.wordpress.com/2011/03/30/wrestling-with-msbuild-the-bane-of-trebuild/
if (false == App.NoMsBuildClean) {
Expand Down Expand Up @@ -259,7 +260,7 @@ public static string GetSetupName(int releaseNumber)
CheckIfUserKitRunning();
CheckIsVsRunning();
CheckIfBuilderRunning();

switch (App.VsVersion) {
case VsVersion.Vs2013:
CheckVs2013();
Expand Down Expand Up @@ -374,7 +375,7 @@ public static string GetSetupName(int releaseNumber)
void WriteDevKit() {
Section("Writing Dev Kit to Registry");

// Inno deletes this from registry, so we must add this after.
// Inno deletes this from registry, so we must add this after.
// We let Inno delete it, so if user runs it by itself they get
// only UserKit, and no DevKit settings.
// HKCU instead of HKLM because builder does not run as admin.
Expand Down Expand Up @@ -527,4 +528,4 @@ public static string GetSetupName(int releaseNumber)
Section("Build Complete!");
}
}
}
}
2 changes: 1 addition & 1 deletion source/Cosmos.Debug.Common/DebugConnector.Thread.cs
Expand Up @@ -138,7 +138,7 @@ private void ThreadMethod()
xPendingOutgoing.Completed.Set();
}

throw;
return;
}
catch (Exception E)
{
Expand Down
31 changes: 17 additions & 14 deletions source/Cosmos.IL2CPU/IL/Branch.cs
Expand Up @@ -208,24 +208,27 @@ public override void Execute(MethodInfo aMethod, ILOpCode aOpCode)
//else
//{
// todo: improve code clarity
if (xStackContentSize > 4)
{
throw new Exception("Cosmos.IL2CPU.x86->IL->Branch.cs->Error: Simple branches are not yet supported on operands > 4 bytes!");
}
new CPU.Pop { DestinationReg = CPU.Registers.EAX };
if (xTestOp == ConditionalTestEnum.Zero)
{
new CPU.Compare { DestinationReg = CPU.Registers.EAX, SourceValue = 0 };
new CPU.ConditionalJump { Condition = ConditionalTestEnum.Equal, DestinationLabel = AppAssembler.TmpBranchLabel(aMethod, aOpCode) };
}
else if (xTestOp == ConditionalTestEnum.NotZero)
if (xStackContentSize <= 4)
{
new CPU.Compare { DestinationReg = CPU.Registers.EAX, SourceValue = 0 };
new CPU.ConditionalJump { Condition = ConditionalTestEnum.NotEqual, DestinationLabel = AppAssembler.TmpBranchLabel(aMethod, aOpCode) };
new CPU.Pop {DestinationReg = CPU.Registers.EAX};
if (xTestOp == ConditionalTestEnum.Zero)
{
new CPU.Compare {DestinationReg = CPU.Registers.EAX, SourceValue = 0};
new CPU.ConditionalJump {Condition = ConditionalTestEnum.Equal, DestinationLabel = AppAssembler.TmpBranchLabel(aMethod, aOpCode)};
}
else if (xTestOp == ConditionalTestEnum.NotZero)
{
new CPU.Compare {DestinationReg = CPU.Registers.EAX, SourceValue = 0};
new CPU.ConditionalJump {Condition = ConditionalTestEnum.NotEqual, DestinationLabel = AppAssembler.TmpBranchLabel(aMethod, aOpCode)};
}
else
{
throw new NotSupportedException("Cosmos.IL2CPU.x86->IL->Branch.cs->Error: Situation not supported yet! (In the Simple Comparison)");
}
}
else
{
throw new NotSupportedException("Cosmos.IL2CPU.x86->IL->Branch.cs->Error: Situation not supported yet! (In the Simple Comparison)");
throw new Exception("Cosmos.IL2CPU.x86->IL->Branch.cs->Error: Simple branches are not yet supported on operands > 4 bytes!");
}
}
//}
Expand Down

0 comments on commit d827212

Please sign in to comment.