diff --git a/source/Cosmos.Build.Windows/Builder/Builder.cs b/source/Cosmos.Build.Windows/Builder/Builder.cs index 9088d482a..72151f048 100644 --- a/source/Cosmos.Build.Windows/Builder/Builder.cs +++ b/source/Cosmos.Build.Windows/Builder/Builder.cs @@ -1,4 +1,5 @@ -//#define OUTPUT_ELF +// leave the use of the following directive in: it eases a LOT during development, as it lets you use gdb for debugging +#define OUTPUT_ELF using System; using System.Diagnostics; using System.IO; diff --git a/source/MatthijsTest/Program.cs b/source/MatthijsTest/Program.cs index 5d6335562..266344177 100644 --- a/source/MatthijsTest/Program.cs +++ b/source/MatthijsTest/Program.cs @@ -8,6 +8,7 @@ using System.Security.Cryptography; using System.Reflection; using System.Diagnostics; using Cosmos.Sys.Network; +using Cosmos.Hardware; namespace MatthijsTest { @@ -26,16 +27,28 @@ namespace MatthijsTest var xBoot = new Cosmos.Sys.Boot(); xBoot.Execute(); - Console.WriteLine("Echoing started."); - do + + //TCPIPStack.Init(); + + //TCPIPStack.ConfigIP( + var xCount = 0; + for (int i = 0; i < Device.Devices.Count; i++) { - var xString = Console.ReadLine(); - if (xString.Length > 2) + var xItem = Device.Devices[i]; + if (xItem == null) { - Console.WriteLine(xString); + Console.WriteLine("NULL item!"); + continue; } - } while (true); + var xType = Device.Devices[i].Type; + if (Device.Devices[i].Type == Device.DeviceType.Network) + { + xCount++; + } + } + Console.Write("Network cards found: "); + Console.WriteLine(xCount.ToString()); } - } + } } \ No newline at end of file diff --git a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Call.cs b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Call.cs index e88f33381..9b65ef112 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Call.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU.X86/IL/Call.cs @@ -64,10 +64,10 @@ namespace Cosmos.IL2CPU.X86.IL { } public static void DoExecute(Assembler Assembler, MethodInfo aCurrentMethod, MethodBase aTargetMethod, uint aTargetMethodUID, int aCurrentPosition) { - if (aTargetMethod.IsVirtual) { - Callvirt.DoExecute(Assembler, aCurrentMethod, aTargetMethod, aTargetMethodUID, aCurrentPosition); - return; - } + //if (aTargetMethod.IsVirtual) { + // Callvirt.DoExecute(Assembler, aCurrentMethod, aTargetMethod, aTargetMethodUID, aCurrentPosition); + // return; + //} var xMethodInfo = aTargetMethod as System.Reflection.MethodInfo; string xCurrentMethodLabel = MethodInfoLabelGenerator.GenerateLabelName(aCurrentMethod.MethodBase); @@ -77,7 +77,8 @@ namespace Cosmos.IL2CPU.X86.IL { if (aTargetMethod.IsStatic || !aTargetMethod.IsVirtual || aTargetMethod.IsFinal) { xNormalAddress = MethodInfoLabelGenerator.GenerateLabelName(aTargetMethod); } else { - throw new Exception("Call: non-concrete method called!"); + xNormalAddress = MethodInfoLabelGenerator.GenerateLabelName(aTargetMethod); + //throw new Exception("Call: non-concrete method called!"); } var xParameters = aTargetMethod.GetParameters(); int xArgCount = xParameters.Length; diff --git a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs index 0d67e103e..491a26c29 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs @@ -543,6 +543,10 @@ namespace Cosmos.IL2CPU { if (xVirtMethod != null) { Queue(xVirtMethod, aMethod, "Virtual Base"); mVirtuals.Add(xVirtMethod); + if (aMethod.Name == "ToString") + { + Console.Write(""); + } // List changes as we go, cant be foreach for (int i = 0; i < mItemsList.Count; i++) {