mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
Limitations :
- Bochs must be installed on the system. This is not checked as a prerequisite by the Builder.
- You will find a GuessForBochs Cosmos project under BlueSkeye user project folder that can be used to launch the Guess project under Bochs.
- You may have to fix manually the path for the following properties in Cosmos.bxrc file copied to the CosmosForBochs\Bin\Debug folder
* romimage
* vgaromimage
- The Cosmos project UI is not yet Bochs aware. If you do not use the GuessForBochs project you must manually edit your Cosmos project file to modify the following property in both the Debug and Release property group from the project file :
<Launch>Bochs</Launch>
You must also add the following properties in both the Debug and Release property group from the project file :
<BochsConfig>Cosmos.bxrc</BochsConfig>
<Bochs_Deployment>ISO</Bochs_Deployment>
<Bochs_Launch>Bochs</Bochs_Launch>
<Bochs_DebugEnabled>True</Bochs_DebugEnabled>
<Bochs_DebugMode>Source</Bochs_DebugMode>
<Bochs_IgnoreDebugStubAttribute />
<Bochs_VMwareEdition>Player</Bochs_VMwareEdition>
<Bochs_OutputPath>bin\Debug\</Bochs_OutputPath>
<Bochs_Framework>MicrosoftNET</Bochs_Framework>
<Bochs_UseInternalAssembler>False</Bochs_UseInternalAssembler>
<Bochs_TraceAssemblies />
<Bochs_EnableGDB>False</Bochs_EnableGDB>
<Bochs_StartCosmosGDB>false</Bochs_StartCosmosGDB>
<Bochs_Name>GuessForBochs</Bochs_Name>
<Bochs_Description>Use Bochs emulator to deploy and debug.</Bochs_Description>
<Bochs_VisualStudioDebugPort>Pipe: Cosmos\Serial</Bochs_VisualStudioDebugPort>
<Bochs_PxeInterface>192.168.43.1</Bochs_PxeInterface>
<Bochs_SlavePort>Serial: COM3</Bochs_SlavePort>
<Bochs_ShowLaunchConsole>False</Bochs_ShowLaunchConsole>
126 lines
No EOL
2.9 KiB
C#
126 lines
No EOL
2.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Microsoft.Build.Utilities;
|
|
using Microsoft.Build.Framework;
|
|
using System.Reflection;
|
|
using Cosmos.Assembler;
|
|
using Cosmos.Assembler.x86;
|
|
using System.IO;
|
|
using Cosmos.Build.Common;
|
|
using Microsoft.Win32;
|
|
using Cosmos.IL2CPU.X86;
|
|
using Cosmos.IL2CPU;
|
|
using System.Reflection.Emit;
|
|
using System.Diagnostics;
|
|
|
|
namespace Cosmos.Build.MSBuild {
|
|
public class IL2CPU : AppDomainIsolatedTask {
|
|
protected IL2CPUTask mTask = new IL2CPUTask();
|
|
|
|
[Required]
|
|
public string DebugMode {
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public bool DebugEnabled {
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public string TraceAssemblies {
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public bool IgnoreDebugStubAttribute {
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public byte DebugCom {
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[Required]
|
|
public bool UseNAsm {
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[Required]
|
|
public ITaskItem[] References {
|
|
get;
|
|
set;
|
|
}
|
|
|
|
[Required]
|
|
public string OutputFilename {
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public bool EnableLogging {
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public bool EmitDebugSymbols {
|
|
get;
|
|
set;
|
|
}
|
|
|
|
protected void LogMessage(string aMsg) {
|
|
Log.LogMessage(aMsg);
|
|
}
|
|
|
|
protected void LogInformation(string aMsg) {
|
|
Log.LogMessage(MessageImportance.High, aMsg);
|
|
}
|
|
|
|
protected void LogWarning(string aMsg) {
|
|
Log.LogWarning(aMsg);
|
|
}
|
|
|
|
protected void LogError(string aMsg) {
|
|
Log.LogError(aMsg);
|
|
}
|
|
|
|
protected void LogException(Exception e) {
|
|
Log.LogErrorFromException(e, true);
|
|
}
|
|
|
|
public override bool Execute() {
|
|
var xSW = Stopwatch.StartNew();
|
|
|
|
try {
|
|
mTask.OnLogMessage = LogMessage;
|
|
mTask.OnLogError = LogError;
|
|
mTask.OnLogWarning = LogWarning;
|
|
mTask.OnLogException = LogException;
|
|
|
|
mTask.DebugEnabled = DebugEnabled;
|
|
mTask.DebugMode = DebugMode;
|
|
mTask.TraceAssemblies = TraceAssemblies;
|
|
mTask.DebugCom = DebugCom;
|
|
mTask.UseNAsm = UseNAsm;
|
|
mTask.References = References;
|
|
mTask.OutputFilename = OutputFilename;
|
|
mTask.EnableLogging = EnableLogging;
|
|
mTask.EmitDebugSymbols = EmitDebugSymbols;
|
|
mTask.IgnoreDebugStubAttribute = IgnoreDebugStubAttribute;
|
|
Log.LogMessage(MessageImportance.High,
|
|
string.Format("IL2CPU invoked with DebugMode='{0}', DebugEnabled='{1}', TraceAssemvlies='{2}', IgnoreDebugStub='{3}'",
|
|
DebugMode, DebugEnabled, TraceAssemblies ?? "{NULL}", IgnoreDebugStubAttribute
|
|
));
|
|
return mTask.Execute();
|
|
} finally {
|
|
xSW.Stop();
|
|
Log.LogMessage(MessageImportance.High, "IL2CPU task took {0}", xSW.Elapsed);
|
|
}
|
|
}
|
|
}
|
|
} |