diff --git a/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs b/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs index 98a1c5421..2d52a8038 100644 --- a/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs +++ b/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs @@ -15,7 +15,7 @@ namespace Cosmos.TestRunner.Core // Sets the time before an error is registered. For example if set to 60 then if a kernel runs for more than 60 seconds then // that kernel will be marked as a failure and terminated - engine.AllowedSecondsInKernel = 6000; + engine.AllowedSecondsInKernel = 900; // If you want to test only specific platforms, add them to the list, like next line. By default, all platforms are run. engine.RunTargets.Add(RunTargetEnum.Bochs); diff --git a/Tests/Cosmos.TestRunner.Core/TestKernelSets.cs b/Tests/Cosmos.TestRunner.Core/TestKernelSets.cs index 7a64ff15c..16b50765d 100644 --- a/Tests/Cosmos.TestRunner.Core/TestKernelSets.cs +++ b/Tests/Cosmos.TestRunner.Core/TestKernelSets.cs @@ -8,15 +8,18 @@ namespace Cosmos.TestRunner.Core public static IEnumerable GetStableKernelTypes() { yield return typeof(VGACompilerCrash.Kernel); + //yield return typeof(Cosmos.Compiler.Tests.Encryption.Kernel); yield return typeof(Cosmos.Compiler.Tests.Bcl.Kernel); yield return typeof(Cosmos.Compiler.Tests.SingleEchoTest.Kernel); yield return typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel); - //yield return typeof(SimpleStructsAndArraysTest.Kernel); - //yield return typeof(Cosmos.Compiler.Tests.Exceptions.Kernel); - //yield return typeof(Cosmos.Compiler.Tests.LinqTests.Kernel); - //yield return typeof(Cosmos.Compiler.Tests.MethodTests.Kernel); - //yield return typeof(Cosmos.Kernel.Tests.Fat.Kernel); + yield return typeof(SimpleStructsAndArraysTest.Kernel); + yield return typeof(Cosmos.Compiler.Tests.Exceptions.Kernel); + yield return typeof(Cosmos.Compiler.Tests.LinqTests.Kernel); + yield return typeof(Cosmos.Compiler.Tests.MethodTests.Kernel); + + yield return typeof(Cosmos.Kernel.Tests.Fat.Kernel); + //yield return typeof(FrotzKernel.Kernel); } } } diff --git a/Users/Matthijs/DebugCompiler/MyEngine.cs b/Users/Matthijs/DebugCompiler/MyEngine.cs index 84023a530..d7b11bda7 100644 --- a/Users/Matthijs/DebugCompiler/MyEngine.cs +++ b/Users/Matthijs/DebugCompiler/MyEngine.cs @@ -12,33 +12,45 @@ namespace DebugCompiler [TestCaseSource(typeof(MySource), nameof(MySource.ProvideData))] public void Test(Type kernelToRun) { - //Assert.Fail(); - Environment.CurrentDirectory = Path.GetDirectoryName(typeof(RunKernels).Assembly.Location); + try + { + Environment.CurrentDirectory = Path.GetDirectoryName(typeof(RunKernels).Assembly.Location); - var xEngine = new Engine(); - // Sets the time before an error is registered. For example if set to 60 then if a kernel runs for more than 60 seconds then - // that kernel will be marked as a failure and terminated - xEngine.AllowedSecondsInKernel = 300; + var xEngine = new Engine(); - // If you want to test only specific platforms, add them to the list, like next line. By default, all platforms are run. - xEngine.RunTargets.Add(RunTargetEnum.Bochs); - //xEngine.StartBochsDebugGui = true; - xEngine.RunWithGDB = true; - // If you're working on the compiler (or other lower parts), you can choose to run the compiler in process - // one thing to keep in mind though, is that this only works with 1 kernel at a time! - xEngine.RunIL2CPUInProcess = false; - xEngine.TraceAssembliesLevel = TraceAssemblies.All; - //xEngine.DebugStubEnabled = false; + // Sets the time before an error is registered. For example if set to 60 then if a kernel runs for more than 60 seconds then + // that kernel will be marked as a failure and terminated + xEngine.AllowedSecondsInKernel = 1200; - xEngine.EnableStackCorruptionChecks = true; - xEngine.StackCorruptionChecksLevel = StackCorruptionDetectionLevel.AllInstructions; + // If you want to test only specific platforms, add them to the list, like next line. By default, all platforms are run. + xEngine.RunTargets.Add(RunTargetEnum.Bochs); - // Select kernels to be tested by adding them to the engine - xEngine.AddKernel(kernelToRun.Assembly.Location); + //xEngine.StartBochsDebugGui = false; + //xEngine.RunWithGDB = true; + // If you're working on the compiler (or other lower parts), you can choose to run the compiler in process + // one thing to keep in mind though, is that this only works with 1 kernel at a time! + //xEngine.RunIL2CPUInProcess = true; + xEngine.TraceAssembliesLevel = TraceAssemblies.User; - xEngine.OutputHandler = new TestOutputHandler(); + xEngine.EnableStackCorruptionChecks = true; + xEngine.StackCorruptionChecksLevel = StackCorruptionDetectionLevel.AllInstructions; - Assert.IsTrue(xEngine.Execute()); + // Select kernels to be tested by adding them to the engine + xEngine.AddKernel(kernelToRun.Assembly.Location); + + xEngine.OutputHandler = new TestOutputHandler(); + + Assert.IsTrue(xEngine.Execute()); + } + catch (AssertionException) + { + throw; + } + catch(Exception E) + { + Console.WriteLine("Exception occurred: " + E.ToString()); + Assert.Fail(); + } } private class TestOutputHandler : OutputHandlerFullTextBase diff --git a/appveyor.yml b/appveyor.yml index 3a3dc961b..10c4e5ed4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,6 +3,10 @@ configuration: Debug platform: AnyCPU shallow_clone: true clone_folder: c:\Cosmos + +install: +- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/install-nuget-3-4-0.ps1')) + build_script: - cmd: >- rem %APPVEYOR_BUILD_FOLDER% @@ -46,13 +50,22 @@ build_script: msbuild "source\Cosmos.sln" /maxcpucount /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Platform="Any CPU" /p:Configuration=Debug /p:DeployExtension=false + +test: + assemblies: +# - Cosmos.Core.Memory.Test.dll + - DebugCompiler.dll + notifications: - provider: Webhook - url: https://webhooks.gitter.im/e/a0ff70f4ffc77a2d07a0 + url: https://webhooks.gitter.im/e/d5c57ffb9a04b1b180be on_build_success: true on_build_failure: true on_build_status_changed: true + matrix: fast_finish: true + artifacts: - - path: '**\TestResult.xml' \ No newline at end of file + - path: '**\TestResult.xml' + diff --git a/source/Cosmos.Build.Common/BuildProperties.cs b/source/Cosmos.Build.Common/BuildProperties.cs index cdd85e856..776f4f7bc 100644 --- a/source/Cosmos.Build.Common/BuildProperties.cs +++ b/source/Cosmos.Build.Common/BuildProperties.cs @@ -306,7 +306,7 @@ namespace Cosmos.Build.Common { get { - return GetProperty(BuildPropertyNames.PxeInterfaceString, "192.168.42.1"); + return GetProperty(BuildPropertyNames.PxeInterfaceString, ""); } set { @@ -469,4 +469,4 @@ namespace Cosmos.Build.Common } } } -} \ No newline at end of file +} diff --git a/source/Cosmos.Core.Plugs/System/StringImpl.cs b/source/Cosmos.Core.Plugs/System/StringImpl.cs index 0d9429170..09b065343 100644 --- a/source/Cosmos.Core.Plugs/System/StringImpl.cs +++ b/source/Cosmos.Core.Plugs/System/StringImpl.cs @@ -580,13 +580,13 @@ namespace Cosmos.Core.Plugs.System } return false; } - else if (aThis.Length > aSubStr.Length) + else if (aThis.Length < aSubStr.Length) { return false; } else { - for (int i = aThis.Length - aSubStr.Length; i < aThis.Length; i++) + for (int i = 0; i < ci.Length; i++) { if (di[aThis.Length - aSubStr.Length + i] != ci[i]) { diff --git a/source/Cosmos.HAL/ConsoleKeyExExtensions.cs b/source/Cosmos.HAL/ConsoleKeyExExtensions.cs index d271b0c31..57defddff 100644 --- a/source/Cosmos.HAL/ConsoleKeyExExtensions.cs +++ b/source/Cosmos.HAL/ConsoleKeyExExtensions.cs @@ -140,6 +140,37 @@ namespace Cosmos.HAL return ConsoleKey.RightArrow; case ConsoleKeyEx.Sleep: return ConsoleKey.Sleep; + case ConsoleKeyEx.BiggerThan: + case ConsoleKeyEx.Period: + return ConsoleKey.OemPeriod; + case ConsoleKeyEx.LowerThan: + case ConsoleKeyEx.Comma: + return ConsoleKey.OemComma; + case ConsoleKeyEx.NumPeriod: + return ConsoleKey.Decimal; + case ConsoleKeyEx.NumPlus: + return ConsoleKey.Add; + case ConsoleKeyEx.NumEnter: + return ConsoleKey.Enter; + case ConsoleKeyEx.Backslash: + return ConsoleKey.Oem5; + case ConsoleKeyEx.LBracket: + return ConsoleKey.Oem4; + case ConsoleKeyEx.RBracket: + return ConsoleKey.Oem6; + case ConsoleKeyEx.Minus: + return ConsoleKey.OemMinus; + case ConsoleKeyEx.Apostrophe: + return ConsoleKey.Oem7; + case ConsoleKeyEx.Slash: + return ConsoleKey.Oem2; + case ConsoleKeyEx.Equal: + return ConsoleKey.OemPlus; + case ConsoleKeyEx.Backquote: + return ConsoleKey.Oem3; + case ConsoleKeyEx.Semicolon: + case ConsoleKeyEx.Colon: + return ConsoleKey.Oem1; default: throw new Exception("KeyEx not implemented!"); } diff --git a/source/Cosmos.HAL/TextScreen.cs b/source/Cosmos.HAL/TextScreen.cs index 7c1e1bde2..7c094ac6c 100644 --- a/source/Cosmos.HAL/TextScreen.cs +++ b/source/Cosmos.HAL/TextScreen.cs @@ -8,82 +8,89 @@ using Cosmos.Debug.Kernel; namespace Cosmos.HAL { // Dont hold state here. This is a raw to hardware class. Virtual screens should be done // by memory moves - public class TextScreen : TextScreenBase { - protected byte Color = 0x0F; // White - protected UInt16 mClearCellValue; - protected UInt32 mRow2Addr; - protected UInt32 mScrollSize; - protected Int32 mCursorSize = 25; // 25 % as C# Console class - protected bool mCursorVisible = true; - - protected Core.IOGroup.TextScreen IO = new Cosmos.Core.IOGroup.TextScreen(); - protected readonly MemoryBlock08 mRAM; - - public TextScreen() { - - if (this is TextScreen) - { - TextScreenHelpers.Debug("this is TextScreen"); - } - else - { - TextScreenHelpers.Debug("ERROR: This is not of type TextScreen!"); - } - mRAM = IO.Memory.Bytes; - // Set the Console default colors: White foreground on Black background, the default value of mClearCellValue is set there too as it is linked with the Color - SetColors(ConsoleColor.White, ConsoleColor.Black); - mRow2Addr = (UInt32)(Cols * 2); - mScrollSize = (UInt32)(Cols * (Rows - 1) * 2); - SetCursorSize(mCursorSize); - SetCursorVisible(mCursorVisible); - TextScreenHelpers.Debug("End of TextScreen..ctor"); - } - - public override UInt16 Rows { get { return 25; } } - public override UInt16 Cols { get { return 80; } } - - public override void Clear() { - TextScreenHelpers.Debug("Clearing screen with value "); - TextScreenHelpers.DebugNumber(mClearCellValue); - IO.Memory.Fill(mClearCellValue); - } - - public override void ScrollUp() + public class TextScreen : TextScreenBase { - IO.Memory.MoveDown(0, mRow2Addr, mScrollSize); - //IO.Memory.Fill(mScrollSize, mRowSize32, mClearCellValue32); - IO.Memory.Fill(mScrollSize, Cols, mClearCellValue); - } + protected byte Color = 0x0F; // White + protected UInt16 mBackgroundClearCellValue; + protected UInt16 mTextClearCellValue; + protected UInt32 mRow2Addr; + protected UInt32 mScrollSize; + protected Int32 mCursorSize = 25; // 25 % as C# Console class + protected bool mCursorVisible = true; - public override char this[int aX, int aY] - { - get { - var xScreenOffset = (UInt32)((aX + aY * Cols) * 2); - return (char)mRAM[xScreenOffset]; - } - set { - var xScreenOffset = (UInt32)((aX + aY * Cols) * 2); - mRAM[xScreenOffset] = (byte)value; - mRAM[xScreenOffset + 1] = Color; - } - } + protected Core.IOGroup.TextScreen IO = new Cosmos.Core.IOGroup.TextScreen(); + protected readonly MemoryBlock08 mRAM; - public override void SetColors(ConsoleColor aForeground, ConsoleColor aBackground) { - Color = (byte)((byte)(aForeground) | ((byte)(aBackground) << 4)); - // The Color | the NUL character this is used to Clear the Screen - mClearCellValue = (UInt16)(Color << 8 | 0x00); + public TextScreen() + { + if (this is TextScreen) + { + TextScreenHelpers.Debug("this is TextScreen"); + } + else + { + TextScreenHelpers.Debug("ERROR: This is not of type TextScreen!"); + } + mRAM = IO.Memory.Bytes; + // Set the Console default colors: White foreground on Black background, the default value of mClearCellValue is set there too as it is linked with the Color + SetColors(ConsoleColor.White, ConsoleColor.Black); + mBackgroundClearCellValue = mTextClearCellValue; + mRow2Addr = (UInt32)(Cols * 2); + mScrollSize = (UInt32)(Cols * (Rows - 1) * 2); + SetCursorSize(mCursorSize); + SetCursorVisible(mCursorVisible); + TextScreenHelpers.Debug("End of TextScreen..ctor"); } - public override void SetCursorPos(int aX, int aY) - { - char xPos = (char)((aY * Cols) + aX); - // Cursor low byte to VGA index register - IO.Idx3.Byte = 0x0F; - IO.Data3.Byte = (byte)(xPos & 0xFF); - // Cursor high byte to VGA index register - IO.Idx3.Byte = 0x0E; - IO.Data3.Byte = (byte)(xPos >> 8); - } + public override UInt16 Rows { get { return 25; } } + public override UInt16 Cols { get { return 80; } } + + public override void Clear() { + TextScreenHelpers.Debug("Clearing screen with value "); + TextScreenHelpers.DebugNumber(mTextClearCellValue); + IO.Memory.Fill(mTextClearCellValue); + mBackgroundClearCellValue = mTextClearCellValue; + } + + public override void ScrollUp() + { + IO.Memory.MoveDown(0, mRow2Addr, mScrollSize); + //IO.Memory.Fill(mScrollSize, mRowSize32, mClearCellValue32); + IO.Memory.Fill(mScrollSize, Cols, mBackgroundClearCellValue); + } + + public override char this[int aX, int aY] + { + get + { + var xScreenOffset = (UInt32)((aX + aY * Cols) * 2); + return (char)mRAM[xScreenOffset]; + } + set + { + var xScreenOffset = (UInt32)((aX + aY * Cols) * 2); + mRAM[xScreenOffset] = (byte)value; + mRAM[xScreenOffset + 1] = Color; + } + } + + public override void SetColors(ConsoleColor aForeground, ConsoleColor aBackground) + { + Color = (byte)((byte)(aForeground) | ((byte)(aBackground) << 4)); + // The Color | the NUL character this is used to Clear the Screen + mTextClearCellValue = (UInt16)(Color << 8 | 0x00); + } + + public override void SetCursorPos(int aX, int aY) + { + char xPos = (char)((aY * Cols) + aX); + // Cursor low byte to VGA index register + IO.Idx3.Byte = 0x0F; + IO.Data3.Byte = (byte)(xPos & 0xFF); + // Cursor high byte to VGA index register + IO.Idx3.Byte = 0x0E; + IO.Data3.Byte = (byte)(xPos >> 8); + } public override byte GetColor() { return Color; @@ -99,7 +106,7 @@ namespace Cosmos.HAL { TextScreenHelpers.Debug("Changing cursor size to", value, "%"); // We need to transform value from a percentage to a value from 15 to 0 value = 16 - ((16 * value) / 100); - // This is the case in which value is in reality 1% and a for a truncation error we get 16 (invalid value) + // This is the case in which value is in reality 1% and a for a truncation error we get 16 (invalid value) if (value >= 16) value = 15; TextScreenHelpers.Debug("verticalSize is", value); @@ -121,7 +128,7 @@ namespace Cosmos.HAL { byte cursorDisable; mCursorVisible = value; - + // The VGA Cursor is disabled when the value is 1 and enabled when is 0 so we need to invert 'value', sadly the ConvertToByte() function is not working // so we need to do the if by hand... if (value == true) diff --git a/source/Cosmos.IL2CPU/CompilerEngine.cs b/source/Cosmos.IL2CPU/CompilerEngine.cs index e199a74e1..f852ac388 100644 --- a/source/Cosmos.IL2CPU/CompilerEngine.cs +++ b/source/Cosmos.IL2CPU/CompilerEngine.cs @@ -236,6 +236,7 @@ namespace Cosmos.IL2CPU using (var xScanner = new ILScanner(xAsm)) { xScanner.LogException = LogException; + xScanner.LogWarning = LogWarning; CompilerHelpers.DebugEvent += LogMessage; if (EnableLogging) { diff --git a/source/Cosmos.IL2CPU/ILScanner.cs b/source/Cosmos.IL2CPU/ILScanner.cs index 54693569a..71cd036c6 100644 --- a/source/Cosmos.IL2CPU/ILScanner.cs +++ b/source/Cosmos.IL2CPU/ILScanner.cs @@ -66,7 +66,7 @@ namespace Cosmos.IL2CPU mAsmblr = aAsmblr; mReader = new ILReader(); - mPlugManager = new PlugManager(LogException); + mPlugManager = new PlugManager(LogException, LogWarning); } public int MethodCount @@ -407,7 +407,10 @@ namespace Cosmos.IL2CPU { Queue(((SysReflection.MethodInfo) aMethod).ReturnType, aMethod, "Return Type"); } - + if (aMethod.GetFullName().IndexOf("CreateComparer", StringComparison.OrdinalIgnoreCase)!=-1) + { + ; + } // Scan virtuals #region Virtuals scan @@ -505,6 +508,7 @@ namespace Cosmos.IL2CPU if (!aIsPlug && !xIsDynamicMethod) { // Check to see if method is plugged, if it is we don't scan body + xPlug = mPlugManager.ResolvePlug(aMethod, xParamTypes); if (xPlug != null) { diff --git a/source/Cosmos.IL2CPU/PlugManager.cs b/source/Cosmos.IL2CPU/PlugManager.cs index bf171453d..2345d3199 100644 --- a/source/Cosmos.IL2CPU/PlugManager.cs +++ b/source/Cosmos.IL2CPU/PlugManager.cs @@ -32,6 +32,11 @@ namespace Cosmos.IL2CPU // List of inheritable plugs. Plugs that start at an ancestor and plug all // descendants. For example, delegates protected Dictionary> mPlugImplsInhrt = new Dictionary>(); + + // same as above 2 fields, except for generic plugs + protected Dictionary> mGenericPlugImpls = new Dictionary>(); + protected Dictionary> mGenericPlugImplsInhrt = new Dictionary>(); + // list of field plugs protected IDictionary> mPlugFields = new Dictionary>(); @@ -63,9 +68,10 @@ namespace Cosmos.IL2CPU return LabelName.GenerateFullName(m); } - public PlugManager(LogExceptionDelegate aLogException) + public PlugManager(LogExceptionDelegate aLogException, Action aLogWarning) { LogException = aLogException; + LogWarning = aLogWarning; } public void FindPlugImpls() @@ -121,7 +127,15 @@ namespace Cosmos.IL2CPU // TODO: Integrate with builder options to allow Mono support again. if (!xAttrib.IsMonoOnly) { - var mPlugs = xAttrib.Inheritable ? mPlugImplsInhrt : mPlugImpls; + Dictionary> mPlugs; + if (xTargetType.ContainsGenericParameters) + { + mPlugs = xAttrib.Inheritable ? mGenericPlugImplsInhrt : mGenericPlugImpls; + } + else + { + mPlugs = xAttrib.Inheritable ? mPlugImplsInhrt : mPlugImpls; + } List xImpls; if (mPlugs.TryGetValue(xTargetType, out xImpls)) { @@ -145,6 +159,7 @@ namespace Cosmos.IL2CPU ScanPlugs(mPlugImpls); ScanPlugs(mPlugImplsInhrt); } + public void ScanPlugs(Dictionary> aPlugs) { foreach (var xPlug in aPlugs) @@ -307,7 +322,10 @@ namespace Cosmos.IL2CPU if (xAttrib == null || xAttrib.IsOptional) { - throw new Exception("Invalid plug method! Target method not found. : " + xMethod.GetFullName()); + if (LogWarning != null) + { + LogWarning("Invalid plug method! Target method not found. : " + xMethod.GetFullName()); + } } } } @@ -316,7 +334,10 @@ namespace Cosmos.IL2CPU if (xAttrib.IsWildcard && xAttrib.Assembler == null) { - throw new Exception("Wildcard PlugMethods need to use an assembler for now."); + if (LogWarning != null) + { + LogWarning("Wildcard PlugMethods need to use an assembler for now."); + } } } } @@ -341,7 +362,9 @@ namespace Cosmos.IL2CPU } } - public MethodBase ResolvePlug(Type aTargetType, List aImpls, MethodBase aMethod, Type[] aParamTypes) + public Action LogWarning; + + private MethodBase ResolvePlug(Type aTargetType, List aImpls, MethodBase aMethod, Type[] aParamTypes) { //TODO: This method is "reversed" from old - remember that when porting MethodBase xResult = null; @@ -526,6 +549,10 @@ namespace Cosmos.IL2CPU xResult = xSigMethod; break; } + //if (aMethod.DeclaringType.IsGenericTypeDefinition) + //{ + // if (xTargetMethod.GetF) + //} if (xAttrib != null && xAttrib.Signature != null) { var xName = DataMember.FilterStringForIncorrectChars(LabelName.GenerateFullName(aMethod)); @@ -642,9 +669,14 @@ namespace Cosmos.IL2CPU //} return xResult; } + public MethodBase ResolvePlug(MethodBase aMethod, Type[] aParamTypes) { MethodBase xResult = null; + if (aMethod.Name == "CreateComparer") + { + ; + } var xMethodKey = BuildMethodKeyName(aMethod); if (ResolvedPlugs.Contains(xMethodKey, out xResult)) { @@ -652,10 +684,6 @@ namespace Cosmos.IL2CPU } else { - // TODO: Right now plugs are compiled in, even if they are not needed. - // Maybe change this so plugs that are not needed are not compiled in? - // To do so, maybe plugs could be marked as they are used - List xImpls; // Check for exact type plugs first, they have precedence if (mPlugImpls.TryGetValue(aMethod.DeclaringType, out xImpls)) @@ -683,6 +711,62 @@ namespace Cosmos.IL2CPU } } } + if (xResult == null) + { + xImpls = null; + if (aMethod.DeclaringType.IsGenericType) + { + var xMethodDeclaringTypeDef = aMethod.DeclaringType.GetGenericTypeDefinition(); + if (mGenericPlugImpls.TryGetValue(xMethodDeclaringTypeDef, out xImpls)) + { + var xBindingFlagsToFindMethod = BindingFlags.Default; + if (aMethod.IsPublic) + { + xBindingFlagsToFindMethod = BindingFlags.Public; + } + else + { + // private + xBindingFlagsToFindMethod = BindingFlags.NonPublic; + } + if (aMethod.IsStatic) + { + xBindingFlagsToFindMethod |= BindingFlags.Static; + } + else + { + xBindingFlagsToFindMethod |= BindingFlags.Instance; + } + var xGenericMethod = (from item in xMethodDeclaringTypeDef.GetMethods(xBindingFlagsToFindMethod) + where item.Name == aMethod.Name + && item.GetParameters().Length == aParamTypes.Length + select item).SingleOrDefault(); + if (xGenericMethod != null) + { + var xTempResult = ResolvePlug(xMethodDeclaringTypeDef, xImpls, xGenericMethod, aParamTypes); + + if (xTempResult != null) + { + if (xTempResult.DeclaringType.IsGenericTypeDefinition) + { + var xConcreteTempResultType = xTempResult.DeclaringType.MakeGenericType(aMethod.DeclaringType.GetGenericArguments()); + xResult = (from item in xConcreteTempResultType.GetMethods(BindingFlags.Static | BindingFlags.Public) + where item.Name == aMethod.Name + && item.GetParameters().Length == aParamTypes.Length + select item).SingleOrDefault(); + } + } + ; + ; + ; + ; + + } + + /// + } + } + } ResolvedPlugs.Add(xMethodKey, xResult); diff --git a/source/Cosmos.IL2CPU/Plugs/System/Runtime/CompilerServices/RuntimeHelpersImpl.cs b/source/Cosmos.IL2CPU/Plugs/System/Runtime/CompilerServices/RuntimeHelpersImpl.cs index 0ef48dce9..61c22b0b4 100644 --- a/source/Cosmos.IL2CPU/Plugs/System/Runtime/CompilerServices/RuntimeHelpersImpl.cs +++ b/source/Cosmos.IL2CPU/Plugs/System/Runtime/CompilerServices/RuntimeHelpersImpl.cs @@ -13,6 +13,21 @@ namespace Cosmos.IL2CPU.Plugs.System.Runtime.CompilerServices { //TODO: do something } + public new static bool Equals(object o1, object o2) + { + if (o1 == null + && o2 == null) + { + return true; + } + if (o1 == null + || o2 == null) + { + return false; + } + return object.Equals(o1, o2); + } + [Inline(TargetPlatform = TargetPlatform.x86)] [PlugMethod] public static void InitializeArray(Array array, RuntimeFieldHandle fldHandle) { diff --git a/source/Cosmos.System.Plugs/Cosmos.System.Plugs.csproj b/source/Cosmos.System.Plugs/Cosmos.System.Plugs.csproj index be071ea18..8d71fc9b1 100644 --- a/source/Cosmos.System.Plugs/Cosmos.System.Plugs.csproj +++ b/source/Cosmos.System.Plugs/Cosmos.System.Plugs.csproj @@ -88,6 +88,7 @@ + diff --git a/source/Cosmos.System.Plugs/System/CharImpl.cs b/source/Cosmos.System.Plugs/System/CharImpl.cs index 6d6de0526..7b0c83153 100644 --- a/source/Cosmos.System.Plugs/System/CharImpl.cs +++ b/source/Cosmos.System.Plugs/System/CharImpl.cs @@ -39,6 +39,11 @@ namespace Cosmos.System.Plugs.System return new string(xResult); } + public static bool Equals(ref char aThis, char that) + { + return aThis == that; + } + public static char ToUpper(char aThis) { // todo: properly implement Char.ToUpper() @@ -50,4 +55,4 @@ namespace Cosmos.System.Plugs.System return aChar == ' ' || aChar == '\t'; } } -} \ No newline at end of file +} diff --git a/source/Cosmos.System.Plugs/System/Collections/Generic/EqualityComparerImpl.cs b/source/Cosmos.System.Plugs/System/Collections/Generic/EqualityComparerImpl.cs new file mode 100644 index 000000000..d733871fd --- /dev/null +++ b/source/Cosmos.System.Plugs/System/Collections/Generic/EqualityComparerImpl.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using Cosmos.IL2CPU.Plugs; + +namespace Cosmos.System.Plugs.System.Collections.Generic +{ + [Plug(Target = typeof(EqualityComparer<>))] + public static class EqualityComparerImpl + { + public static EqualityComparer CreateComparer() + { + throw new Exception("Create comparer not yet implemented!"); + } + } +} diff --git a/source/Cosmos.System.Plugs/System/ConsoleImpl.cs b/source/Cosmos.System.Plugs/System/ConsoleImpl.cs index e535fa57c..bdc69cf2b 100644 --- a/source/Cosmos.System.Plugs/System/ConsoleImpl.cs +++ b/source/Cosmos.System.Plugs/System/ConsoleImpl.cs @@ -57,8 +57,7 @@ namespace Cosmos.System.Plugs.System public static bool get_CapsLock() { - WriteLine("Not implemented: get_CapsLock"); - return false; + return Global.CapsLock; } public static int get_CursorLeft() @@ -80,7 +79,15 @@ namespace Cosmos.System.Plugs.System // for now: return; } - xConsole.X = x; + + if (x < get_WindowWidth()) + { + xConsole.X = x; + } + else + { + WriteLine("x must be lower than the console width!"); + } } public static int get_CursorSize() @@ -124,13 +131,25 @@ namespace Cosmos.System.Plugs.System // for now: return; } - GetConsole().Y = y; + + if (y < get_WindowHeight()) + { + xConsole.Y = y; + } + else + { + WriteLine("y must be lower than the console height!"); + } } public static bool get_CursorVisible() { - WriteLine("Not implemented: get_CursorVisible"); - return false; + var xConsole = GetConsole(); + if (xConsole == null) + { + return false; + } + return GetConsole().CursorVisible; } public static void set_CursorVisible(bool value) @@ -199,8 +218,7 @@ namespace Cosmos.System.Plugs.System public static bool get_NumberLock() { - WriteLine("Not implemented: get_NumberLock"); - return false; + return Global.NumLock; } //public static TextWriter get_Out() { @@ -382,7 +400,6 @@ namespace Cosmos.System.Plugs.System public static ConsoleKeyInfo ReadKey(Boolean intercept) { var key = Cosmos.HAL.Global.Keyboard.ReadKey(); - if (false == intercept && key.KeyChar != '\0') { Write(key.KeyChar); @@ -494,7 +511,8 @@ namespace Cosmos.System.Plugs.System public static void ResetColor() { - WriteLine("Not implemented: ResetColor"); + set_BackgroundColor(ConsoleColor.Black); + set_ForegroundColor(ConsoleColor.White); } public static void SetBufferSize(int width, int height) @@ -504,7 +522,8 @@ namespace Cosmos.System.Plugs.System public static void SetCursorPosition(int left, int top) { - WriteLine("Not implemented: SetCursorPosition"); + set_CursorLeft(left); + set_CursorTop(top); } //public static void SetError(TextWriter newError) { @@ -823,4 +842,4 @@ namespace Cosmos.System.Plugs.System #endregion } -} \ No newline at end of file +} diff --git a/source/Cosmos.VS.Package/Cosmos.VS.Package.csproj b/source/Cosmos.VS.Package/Cosmos.VS.Package.csproj index 44d14d2fe..955a8afc9 100644 --- a/source/Cosmos.VS.Package/Cosmos.VS.Package.csproj +++ b/source/Cosmos.VS.Package/Cosmos.VS.Package.csproj @@ -145,6 +145,7 @@ + diff --git a/source/Cosmos.VS.Package/CosmosPage.Designer.cs b/source/Cosmos.VS.Package/CosmosPage.Designer.cs index a90ffd7f4..84b70eb88 100644 --- a/source/Cosmos.VS.Package/CosmosPage.Designer.cs +++ b/source/Cosmos.VS.Package/CosmosPage.Designer.cs @@ -2,12 +2,12 @@ { partial class CosmosPage { - /// + /// /// Required designer variable. /// private System.ComponentModel.IContainer components = null; - /// + /// /// Clean up any resources being used. /// /// true if managed resources should be disposed; otherwise, false. @@ -22,8 +22,8 @@ #region Component Designer generated code - /// - /// Required method for Designer support - do not modify + /// + /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() @@ -85,7 +85,8 @@ this.checkStartBochsDebugGui = new System.Windows.Forms.CheckBox(); this.checkEnableBochsDebug = new System.Windows.Forms.CheckBox(); this.tabPXE = new System.Windows.Forms.TabPage(); - this.textPxeInterface = new System.Windows.Forms.TextBox(); + this.butnPxeRefresh = new System.Windows.Forms.Button(); + this.comboPxeInterface = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.tabUSB = new System.Windows.Forms.TabPage(); this.label7 = new System.Windows.Forms.Label(); @@ -116,9 +117,9 @@ this.tabISO.SuspendLayout(); this.tabSlave.SuspendLayout(); this.SuspendLayout(); - // + // // panel1 - // + // this.panel1.Controls.Add(this.lablCurrentProfile); this.panel1.Controls.Add(this.label11); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; @@ -126,27 +127,27 @@ this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(635, 43); this.panel1.TabIndex = 3; - // + // // lablCurrentProfile - // + // this.lablCurrentProfile.AutoSize = true; this.lablCurrentProfile.Location = new System.Drawing.Point(99, 17); this.lablCurrentProfile.Name = "lablCurrentProfile"; this.lablCurrentProfile.Size = new System.Drawing.Size(41, 13); this.lablCurrentProfile.TabIndex = 1; this.lablCurrentProfile.Text = "label12"; - // + // // label11 - // + // this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(17, 17); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(76, 13); this.label11.TabIndex = 0; this.label11.Text = "Current Profile:"; - // + // // TabControl1 - // + // this.TabControl1.Controls.Add(this.tabProfile); this.TabControl1.Controls.Add(this.tabCompile); this.TabControl1.Controls.Add(this.tabAssembler); @@ -166,9 +167,9 @@ this.TabControl1.SelectedIndex = 0; this.TabControl1.Size = new System.Drawing.Size(635, 512); this.TabControl1.TabIndex = 1; - // + // // tabProfile - // + // this.tabProfile.Controls.Add(this.lablPreset); this.tabProfile.Controls.Add(this.panel2); this.tabProfile.Controls.Add(this.lablDeployText); @@ -180,9 +181,9 @@ this.tabProfile.TabIndex = 8; this.tabProfile.Text = "Profile"; this.tabProfile.UseVisualStyleBackColor = true; - // + // // lablPreset - // + // this.lablPreset.AutoSize = true; this.lablPreset.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lablPreset.ForeColor = System.Drawing.SystemColors.HotTrack; @@ -191,9 +192,9 @@ this.lablPreset.Size = new System.Drawing.Size(247, 13); this.lablPreset.TabIndex = 7; this.lablPreset.Text = "** This is a preset. Some options are restricted."; - // + // // panel2 - // + // this.panel2.Controls.Add(this.lboxProfile); this.panel2.Controls.Add(this.toolStrip1); this.panel2.Dock = System.Windows.Forms.DockStyle.Left; @@ -201,9 +202,9 @@ this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(200, 480); this.panel2.TabIndex = 6; - // + // // lboxProfile - // + // this.lboxProfile.Dock = System.Windows.Forms.DockStyle.Fill; this.lboxProfile.FormattingEnabled = true; this.lboxProfile.Location = new System.Drawing.Point(0, 27); @@ -211,9 +212,9 @@ this.lboxProfile.Size = new System.Drawing.Size(200, 453); this.lboxProfile.Sorted = true; this.lboxProfile.TabIndex = 3; - // + // // toolStrip1 - // + // this.toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.butnProfileClone, @@ -224,9 +225,9 @@ this.toolStrip1.Size = new System.Drawing.Size(200, 27); this.toolStrip1.TabIndex = 2; this.toolStrip1.Text = "toolStrip1"; - // + // // butnProfileClone - // + // this.butnProfileClone.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.butnProfileClone.Image = ((System.Drawing.Image)(resources.GetObject("butnProfileClone.Image"))); this.butnProfileClone.ImageTransparentColor = System.Drawing.Color.Magenta; @@ -234,9 +235,9 @@ this.butnProfileClone.Size = new System.Drawing.Size(24, 24); this.butnProfileClone.Text = "Clone"; this.butnProfileClone.ToolTipText = "Create a new profile from an existing one."; - // + // // butnProfileDelete - // + // this.butnProfileDelete.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.butnProfileDelete.Image = ((System.Drawing.Image)(resources.GetObject("butnProfileDelete.Image"))); this.butnProfileDelete.ImageTransparentColor = System.Drawing.Color.Magenta; @@ -244,9 +245,9 @@ this.butnProfileDelete.Size = new System.Drawing.Size(24, 24); this.butnProfileDelete.Text = "Delete"; this.butnProfileDelete.ToolTipText = "Delete selected profile"; - // + // // butnProfileRename - // + // this.butnProfileRename.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.butnProfileRename.Image = ((System.Drawing.Image)(resources.GetObject("butnProfileRename.Image"))); this.butnProfileRename.ImageTransparentColor = System.Drawing.Color.Magenta; @@ -254,17 +255,17 @@ this.butnProfileRename.Size = new System.Drawing.Size(24, 24); this.butnProfileRename.Text = "Rename"; this.butnProfileRename.ToolTipText = "Rename selected profile."; - // + // // lablDeployText - // + // this.lablDeployText.Location = new System.Drawing.Point(217, 44); this.lablDeployText.Name = "lablDeployText"; this.lablDeployText.Size = new System.Drawing.Size(228, 137); this.lablDeployText.TabIndex = 4; this.lablDeployText.Text = "label1"; - // + // // lablBuildOnly - // + // this.lablBuildOnly.AutoSize = true; this.lablBuildOnly.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lablBuildOnly.ForeColor = System.Drawing.SystemColors.HotTrack; @@ -273,9 +274,9 @@ this.lablBuildOnly.Size = new System.Drawing.Size(310, 13); this.lablBuildOnly.TabIndex = 3; this.lablBuildOnly.Text = "** This is a build only option. No process will be launched."; - // + // // tabCompile - // + // this.tabCompile.AutoScroll = true; this.tabCompile.Controls.Add(this.labelBinFormat); this.tabCompile.Controls.Add(this.comboBinFormat); @@ -291,10 +292,10 @@ this.tabCompile.TabIndex = 0; this.tabCompile.Text = "Compile"; this.tabCompile.UseVisualStyleBackColor = true; - // + // // labelBinFormat - // - this.labelBinFormat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + // + this.labelBinFormat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.labelBinFormat.AutoSize = true; this.labelBinFormat.Enabled = false; @@ -306,18 +307,18 @@ this.labelBinFormat.TabIndex = 23; this.labelBinFormat.Text = "Bin format:"; this.labelBinFormat.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // comboBinFormat - // + // this.comboBinFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBinFormat.FormattingEnabled = true; this.comboBinFormat.Location = new System.Drawing.Point(34, 136); this.comboBinFormat.Name = "comboBinFormat"; this.comboBinFormat.Size = new System.Drawing.Size(228, 21); this.comboBinFormat.TabIndex = 22; - // + // // comboFramework - // + // this.comboFramework.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboFramework.Enabled = false; this.comboFramework.FormattingEnabled = true; @@ -325,9 +326,9 @@ this.comboFramework.Name = "comboFramework"; this.comboFramework.Size = new System.Drawing.Size(228, 21); this.comboFramework.TabIndex = 5; - // + // // buttonOutputBrowse - // + // this.buttonOutputBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonOutputBrowse.Location = new System.Drawing.Point(430, 37); this.buttonOutputBrowse.Name = "buttonOutputBrowse"; @@ -335,10 +336,10 @@ this.buttonOutputBrowse.TabIndex = 20; this.buttonOutputBrowse.Text = ".."; this.buttonOutputBrowse.UseVisualStyleBackColor = true; - // + // // label2 - // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -349,19 +350,19 @@ this.label2.TabIndex = 19; this.label2.Text = "Output path:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // textOutputPath - // - this.textOutputPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.textOutputPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textOutputPath.Location = new System.Drawing.Point(34, 38); this.textOutputPath.Name = "textOutputPath"; this.textOutputPath.Size = new System.Drawing.Size(390, 20); this.textOutputPath.TabIndex = 4; - // + // // labelFramework - // - this.labelFramework.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + // + this.labelFramework.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.labelFramework.AutoSize = true; this.labelFramework.Enabled = false; @@ -373,9 +374,9 @@ this.labelFramework.TabIndex = 21; this.labelFramework.Text = "Framework:"; this.labelFramework.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // tabAssembler - // + // this.tabAssembler.Controls.Add(this.checkUseInternalAssembler); this.tabAssembler.Controls.Add(this.labelInternalAssembler); this.tabAssembler.Location = new System.Drawing.Point(4, 22); @@ -384,10 +385,10 @@ this.tabAssembler.TabIndex = 10; this.tabAssembler.Text = "Assembler"; this.tabAssembler.UseVisualStyleBackColor = true; - // + // // checkUseInternalAssembler - // - this.checkUseInternalAssembler.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + // + this.checkUseInternalAssembler.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.checkUseInternalAssembler.AutoSize = true; this.checkUseInternalAssembler.Enabled = false; @@ -399,9 +400,9 @@ this.checkUseInternalAssembler.TabIndex = 6; this.checkUseInternalAssembler.Text = "Use Internal Assembler"; this.checkUseInternalAssembler.UseVisualStyleBackColor = true; - // + // // labelInternalAssembler - // + // this.labelInternalAssembler.Enabled = false; this.labelInternalAssembler.Location = new System.Drawing.Point(40, 32); this.labelInternalAssembler.Margin = new System.Windows.Forms.Padding(44, 0, 3, 0); @@ -409,9 +410,9 @@ this.labelInternalAssembler.Size = new System.Drawing.Size(224, 18); this.labelInternalAssembler.TabIndex = 20; this.labelInternalAssembler.Text = "Experimental. Check if you like to crash!"; - // + // // tabDebug - // + // this.tabDebug.AutoScroll = true; this.tabDebug.Controls.Add(this.chckEnableDebugStub); this.tabDebug.Controls.Add(this.panlDebugSettings); @@ -422,9 +423,9 @@ this.tabDebug.TabIndex = 2; this.tabDebug.Text = "Debug"; this.tabDebug.UseVisualStyleBackColor = true; - // + // // chckEnableDebugStub - // + // this.chckEnableDebugStub.AutoSize = true; this.chckEnableDebugStub.Location = new System.Drawing.Point(14, 6); this.chckEnableDebugStub.Name = "chckEnableDebugStub"; @@ -432,9 +433,9 @@ this.chckEnableDebugStub.TabIndex = 7; this.chckEnableDebugStub.Text = "Enable Remote Debugging"; this.chckEnableDebugStub.UseVisualStyleBackColor = true; - // + // // panlDebugSettings - // + // this.panlDebugSettings.Controls.Add(this.stackCorruptionDetectionGroupBox); this.panlDebugSettings.Controls.Add(this.debugLevelGroupBox); this.panlDebugSettings.Controls.Add(this.debugStubGroupBox); @@ -442,9 +443,9 @@ this.panlDebugSettings.Name = "panlDebugSettings"; this.panlDebugSettings.Size = new System.Drawing.Size(280, 400); this.panlDebugSettings.TabIndex = 33; - // + // // stackCorruptionDetectionGroupBox - // + // this.stackCorruptionDetectionGroupBox.Controls.Add(this.label12); this.stackCorruptionDetectionGroupBox.Controls.Add(this.comboStackCorruptionDetectionLevel); this.stackCorruptionDetectionGroupBox.Controls.Add(this.chkEnableStackCorruptionDetection); @@ -453,18 +454,18 @@ this.stackCorruptionDetectionGroupBox.Size = new System.Drawing.Size(260, 90); this.stackCorruptionDetectionGroupBox.TabIndex = 34; this.stackCorruptionDetectionGroupBox.TabStop = false; - // + // // label12 - // + // this.label12.AutoSize = true; this.label12.Location = new System.Drawing.Point(3, 42); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(85, 13); this.label12.TabIndex = 30; this.label12.Text = "Detection Level:"; - // + // // comboStackCorruptionDetectionLevel - // + // this.comboStackCorruptionDetectionLevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboStackCorruptionDetectionLevel.FormattingEnabled = true; this.comboStackCorruptionDetectionLevel.Location = new System.Drawing.Point(33, 58); @@ -472,9 +473,9 @@ this.comboStackCorruptionDetectionLevel.Size = new System.Drawing.Size(220, 21); this.comboStackCorruptionDetectionLevel.TabIndex = 9; this.comboStackCorruptionDetectionLevel.SelectedIndexChanged += new System.EventHandler(this.stackCorruptionDetectionLevelComboBox_SelectedIndexChanged); - // + // // chkEnableStackCorruptionDetection - // + // this.chkEnableStackCorruptionDetection.AutoSize = true; this.chkEnableStackCorruptionDetection.Location = new System.Drawing.Point(6, 19); this.chkEnableStackCorruptionDetection.Name = "chkEnableStackCorruptionDetection"; @@ -483,9 +484,9 @@ this.chkEnableStackCorruptionDetection.Text = "Enable Stack Corruption Detection"; this.chkEnableStackCorruptionDetection.UseVisualStyleBackColor = true; this.chkEnableStackCorruptionDetection.CheckedChanged += new System.EventHandler(this.chkEnableStacckCorruptionDetection_CheckedChanged); - // + // // debugLevelGroupBox - // + // this.debugLevelGroupBox.Controls.Add(this.comboTraceMode); this.debugLevelGroupBox.Controls.Add(this.label5); this.debugLevelGroupBox.Controls.Add(this.label4); @@ -495,18 +496,18 @@ this.debugLevelGroupBox.Size = new System.Drawing.Size(260, 125); this.debugLevelGroupBox.TabIndex = 34; this.debugLevelGroupBox.TabStop = false; - // + // // comboTraceMode - // + // this.comboTraceMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboTraceMode.FormattingEnabled = true; this.comboTraceMode.Location = new System.Drawing.Point(34, 94); this.comboTraceMode.Name = "comboTraceMode"; this.comboTraceMode.Size = new System.Drawing.Size(220, 21); this.comboTraceMode.TabIndex = 10; - // + // // label5 - // + // this.label5.AutoSize = true; this.label5.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label5.Location = new System.Drawing.Point(3, 73); @@ -516,9 +517,9 @@ this.label5.TabIndex = 26; this.label5.Text = "Tracing:"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // label4 - // + // this.label4.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label4.Location = new System.Drawing.Point(3, 19); this.label4.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3); @@ -527,18 +528,18 @@ this.label4.TabIndex = 24; this.label4.Text = "Debug Level:"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // + // // comboDebugMode - // + // this.comboDebugMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboDebugMode.FormattingEnabled = true; this.comboDebugMode.Location = new System.Drawing.Point(34, 46); this.comboDebugMode.Name = "comboDebugMode"; this.comboDebugMode.Size = new System.Drawing.Size(220, 21); this.comboDebugMode.TabIndex = 9; - // + // // debugStubGroupBox - // + // this.debugStubGroupBox.Controls.Add(this.checkIgnoreDebugStubAttribute); this.debugStubGroupBox.Controls.Add(this.label9); this.debugStubGroupBox.Controls.Add(this.cmboVisualStudioDebugPort); @@ -549,9 +550,9 @@ this.debugStubGroupBox.Size = new System.Drawing.Size(260, 140); this.debugStubGroupBox.TabIndex = 31; this.debugStubGroupBox.TabStop = false; - // + // // checkIgnoreDebugStubAttribute - // + // this.checkIgnoreDebugStubAttribute.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.checkIgnoreDebugStubAttribute.Location = new System.Drawing.Point(6, 19); this.checkIgnoreDebugStubAttribute.Name = "checkIgnoreDebugStubAttribute"; @@ -559,18 +560,18 @@ this.checkIgnoreDebugStubAttribute.TabIndex = 11; this.checkIgnoreDebugStubAttribute.Text = "Ignore DebugStub Attribute Settings"; this.checkIgnoreDebugStubAttribute.UseVisualStyleBackColor = true; - // + // // label9 - // + // this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(6, 42); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(69, 13); this.label9.TabIndex = 29; this.label9.Text = "Cosmos Port:"; - // + // // cmboVisualStudioDebugPort - // + // this.cmboVisualStudioDebugPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmboVisualStudioDebugPort.FormattingEnabled = true; this.cmboVisualStudioDebugPort.Items.AddRange(new object[] { @@ -584,9 +585,9 @@ this.cmboVisualStudioDebugPort.Size = new System.Drawing.Size(220, 21); this.cmboVisualStudioDebugPort.Sorted = true; this.cmboVisualStudioDebugPort.TabIndex = 13; - // + // // cmboCosmosDebugPort - // + // this.cmboCosmosDebugPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmboCosmosDebugPort.FormattingEnabled = true; this.cmboCosmosDebugPort.Items.AddRange(new object[] { @@ -600,18 +601,18 @@ this.cmboCosmosDebugPort.Size = new System.Drawing.Size(220, 21); this.cmboCosmosDebugPort.Sorted = true; this.cmboCosmosDebugPort.TabIndex = 12; - // + // // label10 - // + // this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(6, 90); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(93, 13); this.label10.TabIndex = 30; this.label10.Text = "Visual Studio Port:"; - // + // // tabDeployment - // + // this.tabDeployment.Controls.Add(this.lboxDeployment); this.tabDeployment.Location = new System.Drawing.Point(4, 22); this.tabDeployment.Name = "tabDeployment"; @@ -619,9 +620,9 @@ this.tabDeployment.TabIndex = 11; this.tabDeployment.Text = "Deployment"; this.tabDeployment.UseVisualStyleBackColor = true; - // + // // lboxDeployment - // + // this.lboxDeployment.Dock = System.Windows.Forms.DockStyle.Left; this.lboxDeployment.FormattingEnabled = true; this.lboxDeployment.Location = new System.Drawing.Point(0, 0); @@ -629,9 +630,9 @@ this.lboxDeployment.Size = new System.Drawing.Size(206, 486); this.lboxDeployment.Sorted = true; this.lboxDeployment.TabIndex = 15; - // + // // tabLaunch - // + // this.tabLaunch.Controls.Add(this.lboxLaunch); this.tabLaunch.Location = new System.Drawing.Point(4, 22); this.tabLaunch.Name = "tabLaunch"; @@ -639,9 +640,9 @@ this.tabLaunch.TabIndex = 12; this.tabLaunch.Text = "Launch"; this.tabLaunch.UseVisualStyleBackColor = true; - // + // // lboxLaunch - // + // this.lboxLaunch.Dock = System.Windows.Forms.DockStyle.Left; this.lboxLaunch.FormattingEnabled = true; this.lboxLaunch.Location = new System.Drawing.Point(0, 0); @@ -649,9 +650,9 @@ this.lboxLaunch.Size = new System.Drawing.Size(206, 486); this.lboxLaunch.Sorted = true; this.lboxLaunch.TabIndex = 16; - // + // // tabVMware - // + // this.tabVMware.Controls.Add(this.checkEnableGDB); this.tabVMware.Controls.Add(this.checkStartCosmosGDB); this.tabVMware.Controls.Add(this.label3); @@ -663,9 +664,9 @@ this.tabVMware.TabIndex = 4; this.tabVMware.Text = "VMware"; this.tabVMware.UseVisualStyleBackColor = true; - // + // // checkEnableGDB - // + // this.checkEnableGDB.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.checkEnableGDB.Location = new System.Drawing.Point(9, 77); this.checkEnableGDB.Name = "checkEnableGDB"; @@ -673,9 +674,9 @@ this.checkEnableGDB.TabIndex = 19; this.checkEnableGDB.Text = "Enable GDB Debugger"; this.checkEnableGDB.UseVisualStyleBackColor = true; - // + // // checkStartCosmosGDB - // + // this.checkStartCosmosGDB.AutoSize = true; this.checkStartCosmosGDB.Enabled = false; this.checkStartCosmosGDB.Location = new System.Drawing.Point(24, 103); @@ -685,18 +686,18 @@ this.checkStartCosmosGDB.TabIndex = 20; this.checkStartCosmosGDB.Text = "Use Cosmos GDB Client"; this.checkStartCosmosGDB.UseVisualStyleBackColor = true; - // + // // label3 - // + // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(6, 12); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(42, 13); this.label3.TabIndex = 18; this.label3.Text = "Edition:"; - // + // // cmboVMwareEdition - // + // this.cmboVMwareEdition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmboVMwareEdition.FormattingEnabled = true; this.cmboVMwareEdition.Location = new System.Drawing.Point(26, 37); @@ -704,9 +705,9 @@ this.cmboVMwareEdition.Size = new System.Drawing.Size(143, 21); this.cmboVMwareEdition.Sorted = true; this.cmboVMwareEdition.TabIndex = 18; - // + // // tabBochs - // + // this.tabBochs.Controls.Add(this.checkStartBochsDebugGui); this.tabBochs.Controls.Add(this.checkEnableBochsDebug); this.tabBochs.Location = new System.Drawing.Point(4, 22); @@ -716,9 +717,9 @@ this.tabBochs.TabIndex = 5; this.tabBochs.Text = "Bochs"; this.tabBochs.UseVisualStyleBackColor = true; - // + // // checkStartBochsDebugGui - // + // this.checkStartBochsDebugGui.Enabled = false; this.checkStartBochsDebugGui.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.checkStartBochsDebugGui.Location = new System.Drawing.Point(24, 43); @@ -727,9 +728,9 @@ this.checkStartBochsDebugGui.TabIndex = 35; this.checkStartBochsDebugGui.Text = "Use Bochs Debugger GUI"; this.checkStartBochsDebugGui.UseVisualStyleBackColor = true; - // + // // checkEnableBochsDebug - // + // this.checkEnableBochsDebug.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.checkEnableBochsDebug.Location = new System.Drawing.Point(9, 17); this.checkEnableBochsDebug.Name = "checkEnableBochsDebug"; @@ -737,10 +738,11 @@ this.checkEnableBochsDebug.TabIndex = 21; this.checkEnableBochsDebug.Text = "Enable Bochs Debugger"; this.checkEnableBochsDebug.UseVisualStyleBackColor = true; - // + // // tabPXE - // - this.tabPXE.Controls.Add(this.textPxeInterface); + // + this.tabPXE.Controls.Add(this.butnPxeRefresh); + this.tabPXE.Controls.Add(this.comboPxeInterface); this.tabPXE.Controls.Add(this.label1); this.tabPXE.Location = new System.Drawing.Point(4, 22); this.tabPXE.Name = "tabPXE"; @@ -749,25 +751,37 @@ this.tabPXE.TabIndex = 6; this.tabPXE.Text = "PXE"; this.tabPXE.UseVisualStyleBackColor = true; - // - // textPxeInterface - // - this.textPxeInterface.Location = new System.Drawing.Point(28, 32); - this.textPxeInterface.Name = "textPxeInterface"; - this.textPxeInterface.Size = new System.Drawing.Size(146, 20); - this.textPxeInterface.TabIndex = 22; - // + // + // butnPxeRefresh + // + // + this.butnPxeRefresh.AutoSize = true; + this.butnPxeRefresh.Image = ((System.Drawing.Image)(resources.GetObject("butnPxeRefresh.Image"))); + this.butnPxeRefresh.Location = new System.Drawing.Point(177, 31); + this.butnPxeRefresh.Margin = new System.Windows.Forms.Padding(0); + this.butnPxeRefresh.Name = "butnPxeRefresh"; + this.butnPxeRefresh.Size = new System.Drawing.Size(23, 23); + this.butnPxeRefresh.TabIndex = 23; + this.butnPxeRefresh.UseVisualStyleBackColor = true; + // + // comboPxeInterface + // + this.comboPxeInterface.Location = new System.Drawing.Point(28, 32); + this.comboPxeInterface.Name = "comboPxeInterface"; + this.comboPxeInterface.Size = new System.Drawing.Size(146, 21); + this.comboPxeInterface.TabIndex = 22; + // // label1 - // + // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(13, 16); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(52, 13); this.label1.TabIndex = 0; this.label1.Text = "Interface:"; - // + // // tabUSB - // + // this.tabUSB.Controls.Add(this.label7); this.tabUSB.Location = new System.Drawing.Point(4, 22); this.tabUSB.Name = "tabUSB"; @@ -776,18 +790,18 @@ this.tabUSB.TabIndex = 7; this.tabUSB.Text = "USB"; this.tabUSB.UseVisualStyleBackColor = true; - // + // // label7 - // + // this.label7.Location = new System.Drawing.Point(16, 15); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(375, 102); this.label7.TabIndex = 1; this.label7.Text = "There are no current USB options. The target drive will be requested when you run" + " the project."; - // + // // tabISO - // + // this.tabISO.Controls.Add(this.label8); this.tabISO.Location = new System.Drawing.Point(4, 22); this.tabISO.Name = "tabISO"; @@ -796,17 +810,17 @@ this.tabISO.TabIndex = 8; this.tabISO.Text = "ISO"; this.tabISO.UseVisualStyleBackColor = true; - // + // // label8 - // + // this.label8.Location = new System.Drawing.Point(17, 16); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(375, 102); this.label8.TabIndex = 1; this.label8.Text = "There are currently no ISO options."; - // + // // tabSlave - // + // this.tabSlave.Controls.Add(this.cmboSlavePort); this.tabSlave.Controls.Add(this.label6); this.tabSlave.Location = new System.Drawing.Point(4, 22); @@ -816,9 +830,9 @@ this.tabSlave.TabIndex = 13; this.tabSlave.Text = "Slave"; this.tabSlave.UseVisualStyleBackColor = true; - // + // // cmboSlavePort - // + // this.cmboSlavePort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmboSlavePort.FormattingEnabled = true; this.cmboSlavePort.Items.AddRange(new object[] { @@ -832,18 +846,18 @@ this.cmboSlavePort.Size = new System.Drawing.Size(146, 21); this.cmboSlavePort.Sorted = true; this.cmboSlavePort.TabIndex = 23; - // + // // label6 - // + // this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(15, 15); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(59, 13); this.label6.TabIndex = 34; this.label6.Text = "Slave Port:"; - // + // // CosmosPage - // + // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.TabControl1); @@ -890,65 +904,66 @@ #endregion - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Label lablCurrentProfile; - private System.Windows.Forms.Label label11; - private System.Windows.Forms.TabControl TabControl1; - private System.Windows.Forms.TabPage tabProfile; - private System.Windows.Forms.Label lablDeployText; - private System.Windows.Forms.Label lablBuildOnly; - private System.Windows.Forms.TabPage tabDeployment; - private System.Windows.Forms.ListBox lboxDeployment; - private System.Windows.Forms.TabPage tabLaunch; - private System.Windows.Forms.ListBox lboxLaunch; - private System.Windows.Forms.TabPage tabCompile; - private System.Windows.Forms.ComboBox comboFramework; - private System.Windows.Forms.Button buttonOutputBrowse; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox textOutputPath; - private System.Windows.Forms.Label labelFramework; - private System.Windows.Forms.TabPage tabAssembler; - private System.Windows.Forms.CheckBox checkUseInternalAssembler; - private System.Windows.Forms.Label labelInternalAssembler; - private System.Windows.Forms.TabPage tabDebug; - private System.Windows.Forms.CheckBox chckEnableDebugStub; - private System.Windows.Forms.Panel panlDebugSettings; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.ComboBox cmboVisualStudioDebugPort; - private System.Windows.Forms.ComboBox comboTraceMode; - private System.Windows.Forms.ComboBox cmboCosmosDebugPort; - private System.Windows.Forms.ComboBox comboDebugMode; - private System.Windows.Forms.Label label10; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label9; - private System.Windows.Forms.CheckBox checkIgnoreDebugStubAttribute; - private System.Windows.Forms.TabPage tabBochs; - private System.Windows.Forms.CheckBox checkEnableBochsDebug; - private System.Windows.Forms.TabPage tabVMware; - private System.Windows.Forms.CheckBox checkEnableGDB; - private System.Windows.Forms.CheckBox checkStartCosmosGDB; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.ComboBox cmboVMwareEdition; - private System.Windows.Forms.TabPage tabPXE; - private System.Windows.Forms.TabPage tabUSB; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.TabPage tabISO; - private System.Windows.Forms.Label label8; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.ToolStrip toolStrip1; - private System.Windows.Forms.ListBox lboxProfile; - private System.Windows.Forms.ToolStripButton butnProfileClone; - private System.Windows.Forms.ToolStripButton butnProfileDelete; - private System.Windows.Forms.Label lablPreset; - private System.Windows.Forms.ToolStripButton butnProfileRename; - private System.Windows.Forms.TextBox textPxeInterface; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TabPage tabSlave; - private System.Windows.Forms.ComboBox cmboSlavePort; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.CheckBox chkEnableStackCorruptionDetection; - private System.Windows.Forms.Label labelBinFormat; - private System.Windows.Forms.ComboBox comboBinFormat; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label lablCurrentProfile; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TabControl TabControl1; + private System.Windows.Forms.TabPage tabProfile; + private System.Windows.Forms.Label lablDeployText; + private System.Windows.Forms.Label lablBuildOnly; + private System.Windows.Forms.TabPage tabDeployment; + private System.Windows.Forms.ListBox lboxDeployment; + private System.Windows.Forms.TabPage tabLaunch; + private System.Windows.Forms.ListBox lboxLaunch; + private System.Windows.Forms.TabPage tabCompile; + private System.Windows.Forms.ComboBox comboFramework; + private System.Windows.Forms.Button buttonOutputBrowse; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox textOutputPath; + private System.Windows.Forms.Label labelFramework; + private System.Windows.Forms.TabPage tabAssembler; + private System.Windows.Forms.CheckBox checkUseInternalAssembler; + private System.Windows.Forms.Label labelInternalAssembler; + private System.Windows.Forms.TabPage tabDebug; + private System.Windows.Forms.CheckBox chckEnableDebugStub; + private System.Windows.Forms.Panel panlDebugSettings; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.ComboBox cmboVisualStudioDebugPort; + private System.Windows.Forms.ComboBox comboTraceMode; + private System.Windows.Forms.ComboBox cmboCosmosDebugPort; + private System.Windows.Forms.ComboBox comboDebugMode; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.CheckBox checkIgnoreDebugStubAttribute; + private System.Windows.Forms.TabPage tabBochs; + private System.Windows.Forms.CheckBox checkEnableBochsDebug; + private System.Windows.Forms.TabPage tabVMware; + private System.Windows.Forms.CheckBox checkEnableGDB; + private System.Windows.Forms.CheckBox checkStartCosmosGDB; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.ComboBox cmboVMwareEdition; + private System.Windows.Forms.TabPage tabPXE; + private System.Windows.Forms.TabPage tabUSB; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.TabPage tabISO; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.ToolStrip toolStrip1; + private System.Windows.Forms.ListBox lboxProfile; + private System.Windows.Forms.ToolStripButton butnProfileClone; + private System.Windows.Forms.ToolStripButton butnProfileDelete; + private System.Windows.Forms.Label lablPreset; + private System.Windows.Forms.ToolStripButton butnProfileRename; + private System.Windows.Forms.ComboBox comboPxeInterface; + private System.Windows.Forms.Button butnPxeRefresh; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TabPage tabSlave; + private System.Windows.Forms.ComboBox cmboSlavePort; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.CheckBox chkEnableStackCorruptionDetection; + private System.Windows.Forms.Label labelBinFormat; + private System.Windows.Forms.ComboBox comboBinFormat; private System.Windows.Forms.CheckBox checkStartBochsDebugGui; private System.Windows.Forms.GroupBox stackCorruptionDetectionGroupBox; private System.Windows.Forms.ComboBox comboStackCorruptionDetectionLevel; diff --git a/source/Cosmos.VS.Package/CosmosPage.cs b/source/Cosmos.VS.Package/CosmosPage.cs index 182e19456..b37494f5f 100644 --- a/source/Cosmos.VS.Package/CosmosPage.cs +++ b/source/Cosmos.VS.Package/CosmosPage.cs @@ -6,6 +6,7 @@ using System.IO.Ports; using System.Drawing; using System.Data; using System.Linq; +using System.Net.NetworkInformation; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; @@ -258,12 +259,6 @@ namespace Cosmos.VS.Package // Locked to COM1 for now. //cmboCosmosDebugPort.SelectedIndex = 0; - #region PXE - - textPxeInterface.Text = mProps.PxeInterface; - - #endregion - #region Slave cmboSlavePort.SelectedIndex = cmboSlavePort.Items.IndexOf(mProps.SlavePort); @@ -461,10 +456,10 @@ namespace Cosmos.VS.Package #region PXE - textPxeInterface.TextChanged += delegate(Object sender, EventArgs e) + comboPxeInterface.TextChanged += delegate(Object sender, EventArgs e) { if (FreezeEvents) return; - var x = textPxeInterface.Text.Trim(); + var x = comboPxeInterface.Text.Trim(); if (x != mProps.PxeInterface) { mProps.PxeInterface = x; @@ -483,6 +478,8 @@ namespace Cosmos.VS.Package } }; + butnPxeRefresh.Click += new EventHandler(butnPxeRefresh_Click); + #endregion #region Debug @@ -694,7 +691,12 @@ namespace Cosmos.VS.Package lboxProfile.SelectedIndex = FillProfile(xID); } - protected BuildProperties mProps = new BuildProperties(); + void butnPxeRefresh_Click(object sender, EventArgs e) + { + FillNetworkInterfaces(); + } + + protected BuildProperties mProps = new BuildProperties(); public override PropertiesBase Properties { @@ -810,6 +812,8 @@ namespace Cosmos.VS.Package #region PXE + FillNetworkInterfaces(); + cmboSlavePort.Items.Clear(); cmboSlavePort.Items.Add("None"); FillComPorts(cmboSlavePort.Items); @@ -828,6 +832,53 @@ namespace Cosmos.VS.Package } } + protected void FillNetworkInterfaces() + { + comboPxeInterface.Items.Clear(); + + comboPxeInterface.Items.AddRange(GetNetworkInterfaces().ToArray()); + + if (mProps.PxeInterface == String.Empty) + { + if (comboPxeInterface.Items.Count > 0) + { + comboPxeInterface.Text = comboPxeInterface.Items[0].ToString(); + } + else + { + comboPxeInterface.Text = "192.168.42.1"; + } + } + else + { + comboPxeInterface.Text = mProps.PxeInterface; + } + } + + protected List GetNetworkInterfaces() + { + NetworkInterface[] nInterfaces = NetworkInterface.GetAllNetworkInterfaces(); + List interfaces_list = new List(); + + foreach (NetworkInterface nInterface in nInterfaces) + { + if (nInterface.OperationalStatus == OperationalStatus.Up) + { + IPInterfaceProperties ipProperties = nInterface.GetIPProperties(); + + foreach (var ip in ipProperties.UnicastAddresses) + { + if (ip.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) + { + interfaces_list.Add(ip.Address.ToString()); + } + } + } + } + + return interfaces_list; + } + private void OutputBrowse_Click(object sender, EventArgs e) { string folderPath = String.Empty; @@ -901,4 +952,4 @@ namespace Cosmos.VS.Package } } } -} \ No newline at end of file +} diff --git a/source/Cosmos.VS.Package/CosmosPage.resx b/source/Cosmos.VS.Package/CosmosPage.resx index 49465f5f7..8633fba07 100644 --- a/source/Cosmos.VS.Package/CosmosPage.resx +++ b/source/Cosmos.VS.Package/CosmosPage.resx @@ -117,55 +117,59 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - + + 17, 17 + - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHkSURBVDhPvZHfS1NhHIf3p5QypLr2D4goMwoMCi/qIugH - Xe1Cr7qKDIMkZixwNhfWLGWbnuki0kXKzLU023KubBNPJrbRdOzocm6e2dPOO21mMS+CHvjcvOf9PF++ - 79H9M+7RT2iRRsIi9sEAXe43yAvf2LpSHq28G9uAnytNT4jMLewtcQ2Ht2pF8ps/aOt+gccX5lxD694S - +1BQFD1RkN5DSFa4Z3uONKbgHE3h8KZ4OJTC1J8UiSzmfhd2uf1CoJHbyKOsZokl0kKwm+aeJaov+wjO - rpQkVqdXfOz0bWAcVLghfaXxkUz3y2VxvpMGSwL3uMKh+gHezSSLEnNhX23vtYzKUirDfGyFj/Iy1mdx - UWqR8iKhwtQLxjgH659y4EwvVXWPiwJt3/Ws+muywRrlqvkDdx3zQrCN8l1ldnEd3/QqFmkS/akHJYGS - zjLzOUEwEsMf+sLI2zmaOou/93pPGoM5zvk7UU7fnBKxSBPoT7SXBNW1F/9Io2lKCNTCeomUyrS8xnBA - wfUqyf1eP5U1ptJD/o1LzeNCsHPydtqdr6k4aiwvOHvNSya3ibU/QIdrEkvfhJislc32MfYfuV1eUGPw - FF7bIVJVZ0N/soPK421UHGstlFvYd/hWecF/Qqf7CR0A5wwgSQA2AAAAAElFTkSuQmCC + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAeRJREFUOE+9kd9LU2Ech/enlDKkuvYPiCgzCgwKL+oi6Add7UKvuooMgyRmLHA2 + F9YsZZue6SLSRcrMtTTbcq5sE08mttF07Ohybp7Z0847bWYxL4Ie+Ny85/08X77v0f0z7tFPaJFGwiL2 + wQBd7jfIC9/YulIerbwb24CfK01PiMwt7C1xDYe3akXymz9o636BxxfmXEPr3hL7UFAUPVGQ3kNIVrhn + e440puAcTeHwpng4lMLUnxSJLOZ+F3a5/UKgkdvIo6xmiSXSQrCb5p4lqi/7CM6ulCRWp1d87PRtYBxU + uCF9pfGRTPfLZXG+kwZLAve4wqH6Ad7NJIsSc2Ffbe+1jMpSKsN8bIWP8jLWZ3FRapHyIqHC1AvGOAfr + n3LgTC9VdY+LAm3f9az6a7LBGuWq+QN3HfNCsI3yXWV2cR3f9CoWaRL9qQclgZLOMvM5QTASwx/6wsjb + OZo6i7/3ek8agznO+TtRTt+cErFIE+hPtJcE1bUX/0ijaUoI1MJ6iZTKtLzGcEDB9SrJ/V4/lTWm0kP+ + jUvN40Kwc/J22p2vqThqLC84e81LJreJtT9Ah2sSS9+EmKyVzfYx9h+5XV5QY/AUXtshUlVnQ3+yg8rj + bVQcay2UW9h3+FZ5wX9Cp/sJHQDnDCBJADYAAAAASUVORK5CYII= - iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAYAAADJViUEAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAH8SURBVDhPnZJtS1NhGMf3GQqqV1GQRQ+o5WqbbmcP5dwK - SiIsFqwXBS32QmYNpJjl5rL6BEHPlCGCYBREWW6ZGGpu5jBXahtbe1LzK/w659iUcU4v6sX/hvvm/7uv - i+v6a0rLK/yvZHgiFqfN7yc6/JHi0i9Vo5o0hcVlnvf2YbUeweF08vrNW6Q3NXO+tMRM8hvPenrku0Z6 - 6O3rp9V3GZ3BhNVm5/6DR4oPsvkS7yIfaD7RTDAUXoWlIzn3g5HRMXxtfuqNZgSzhY5AgEyu8Acscr2z - E4utke5bd0hnc+twWfniIo+fPMV22I4g2Ah2hRmbiNEVvo3JaKTjRoiFdHbNr5i2NLDYVAL3ufMc0jWg - 0xsxmQUueLxiJ8UK719XNfg+Qp3WgKHehN1xjLmFtMKjCk/PzOI4epzqmgPU1GrRHtRjb3IqfAo4IYJS - pd17qrl4yctQdJgzLje1++u4e+9hhbcCnv0+T5NYcev2Klxn3WKrKXmyknxX2tHrG0h8TSrhbKGEx9vK - jl37sFgbGf8cXzNlxFXNpzKcPNUiJrFdDksF3D/wgk1btlG1cy/BcDepzOouy5JCMzk1jdEkEP+SkO8y - /FP8+eq1ABs2bqbltItP45OqEZUqBkM3GRyKrMOSoiOjeMQBDbx8JQYhowDLyolBUk3Yv2mF35ElDFrI - IuM7AAAAAElFTkSuQmCC + iVBORw0KGgoAAAANSUhEUgAAAA8AAAAQCAYAAADJViUEAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAfxJREFUOE+dkm1LU2EYx/cZCqpXUZBFD6jlaptuZw/l3ApKIiwWrBcFLfZCZg2k + mOXmsvoEQc+UIYJgFERZbpkYam7mMFdqG1t7UvMr/Drn2JRxTi/qxf+G++b/u6+L6/prSssr/K9keCIW + p83vJzr8keLSL1WjmjSFxWWe9/ZhtR7B4XTy+s1bpDc1c760xEzyG896euS7Rnro7eun1XcZncGE1Wbn + /oNHig+y+RLvIh9oPtFMMBRehaUjOfeDkdExfG1+6o1mBLOFjkCATK7wByxyvbMTi62R7lt3SGdz63BZ + +eIij588xXbYjiDYCHaFGZuI0RW+jclopONGiIV0ds2vmLY0sNhUAve58xzSNaDTGzGZBS54vGInxQrv + X1c1+D5CndaAod6E3XGMuYW0wqMKT8/M4jh6nOqaA9TUatEe1GNvcip8CjghglKl3XuquXjJy1B0mDMu + N7X767h772GFtwKe/T5Pk1hx6/YqXGfdYqspebKSfFfa0esbSHxNKuFsoYTH28qOXfuwWBsZ/xxfM2XE + Vc2nMpw81SImsV0OSwXcP/CCTVu2UbVzL8FwN6nM6i7LkkIzOTWN0SQQ/5KQ7zL8U/z56rUAGzZupuW0 + i0/jk6oRlSoGQzcZHIqsw5KiI6N4xAENvHwlBiGjAMvKiUFSTdi/aYXfkSUMWsgi4zsAAAAASUVORK5C + YII= - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG - YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 - 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw - bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc - VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 - c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 - Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo - mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ - kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D - TgDQASA1MVpwzwAAAABJRU5ErkJggg== + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAgNJREFUOE+lkutLk2EYxvePhJaHShFBUTEPiCieQOmDiEZgrEbpYGiCQxkqA80I + RUkUEZ0YRMS+DDI70MkTmzJnDc8iU8QT2mAEItnle90wHwTDyBduXnie5/rd133Q4ZKfAJqHFs9E08A8 + zD1emDpmYXjqRlnTFIrMk8iuGkNaxWekGEaQrHecBfw+/vPXODw6hj9whN2fh/Bt/8LSRgA3cxr/DeBZ + 9kvmTNMoHGNbIrYN+3Aj23IxgJkpds0doP3VstgmsNexhutZ9QrAms8T0zYzU5xXM46kcjsmvfvoeL2i + AeoUgA07T8yaaZuZKab1rzN74jgys1YB2O2gmBZzH49LODXrrJlnzEzxe9cOLH1ziMioVgCOiuIFX0CE + Q+/WYf+yieiCFrRp9tkwxnP7Kt5MbKGm6wfC000KwDlTXNLgEvHMkh+Db32o7fYivtQm1l9+3IBOp5P7 + yjYPwlKNCsAluWudxgvtknb5t9oWcL/VLU2Mvd2JFq3uqs7vAtE/ceNayiMF4KiYMSjmY2O7B4Ua+NaD + YQGEJumRbvyG1IcfBHI12aAAXM8R57aIWTNrLLY4tfNPiCvpR1SeVeu6WWzHFD6THSDwFMDdpmUG62NJ + PKM4Or9ZxBxb8H8l7g5CEu8pAOfM3WanSeeS8CFHxW4zM2umbWamOCShXAH+/wNOANABIDUxWnDPAAAA + AElFTkSuQmCC - + 122, 17 - + + + + Resources\Refresh_16x.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/source/Cosmos.VS.Package/Resources/Refresh_16x.png b/source/Cosmos.VS.Package/Resources/Refresh_16x.png new file mode 100644 index 000000000..bc31d5e1f Binary files /dev/null and b/source/Cosmos.VS.Package/Resources/Refresh_16x.png differ diff --git a/source/Cosmos.sln b/source/Cosmos.sln index 37528bbde..7ce465648 100644 --- a/source/Cosmos.sln +++ b/source/Cosmos.sln @@ -1233,7 +1233,6 @@ Global {511C4498-E62A-4FF2-94BA-472CF448B39B}.Debug|Any CPU.ActiveCfg = Debug|x86 {511C4498-E62A-4FF2-94BA-472CF448B39B}.Debug|x64.ActiveCfg = Debug|x86 {511C4498-E62A-4FF2-94BA-472CF448B39B}.Debug|x86.ActiveCfg = Debug|x86 - {511C4498-E62A-4FF2-94BA-472CF448B39B}.Debug|x86.Build.0 = Debug|x86 {511C4498-E62A-4FF2-94BA-472CF448B39B}.Release|Any CPU.ActiveCfg = Debug|x86 {511C4498-E62A-4FF2-94BA-472CF448B39B}.Release|Any CPU.Build.0 = Debug|x86 {511C4498-E62A-4FF2-94BA-472CF448B39B}.Release|x64.ActiveCfg = Debug|x86 diff --git a/source/Tools/PlugsInspector/Form1.cs b/source/Tools/PlugsInspector/Form1.cs index c0f8ae738..068fabb64 100644 --- a/source/Tools/PlugsInspector/Form1.cs +++ b/source/Tools/PlugsInspector/Form1.cs @@ -74,7 +74,9 @@ namespace PlugsInspector plugManager = new PlugManager((Exception ex) => { AddExceptionEntry(ex.Message); - }); + }, warning => + { + }); plugManager.ThrowExceptions = false; } diff --git a/source/Tools/PlugsInspector/PlugsInspector.csproj b/source/Tools/PlugsInspector/PlugsInspector.csproj index cbe8ae328..47d51c378 100644 --- a/source/Tools/PlugsInspector/PlugsInspector.csproj +++ b/source/Tools/PlugsInspector/PlugsInspector.csproj @@ -146,6 +146,10 @@ {7c64b97f-516d-4a6d-b9e1-3fe48f561409} Cosmos.System.Plugs + + {d9a87aad-fcc9-4517-b31d-e904dad00784} + Cosmos.Core.Plugs +