From 6a3cd41554bb4cf7d67e1285c4e9838209fa07ba Mon Sep 17 00:00:00 2001 From: Matthijs ter Woord Date: Sun, 14 Dec 2014 16:14:17 +0100 Subject: [PATCH] Add extra playground libraries. --- Users/Matthijs/Playground/Kernel.cs | 3 +- Users/Matthijs/PlaygroundHAL/HALGlobal.cs | 25 +++++++ .../PlaygroundHAL/PlaygroundHAL.csproj | 58 ++++++++++++++++ .../PlaygroundHAL/Properties/AssemblyInfo.cs | 40 +++++++++++ Users/Matthijs/PlaygroundSystem/HALGlobal.cs | 66 ------------------ .../PlaygroundSystem/PlaygroundSystem.csproj | 6 +- .../Matthijs/PlaygroundSystem/SystemGlobal.cs | 68 +++++++++++++++++++ source/Cosmos.sln | 15 ++++ 8 files changed, 213 insertions(+), 68 deletions(-) create mode 100644 Users/Matthijs/PlaygroundHAL/HALGlobal.cs create mode 100644 Users/Matthijs/PlaygroundHAL/PlaygroundHAL.csproj create mode 100644 Users/Matthijs/PlaygroundHAL/Properties/AssemblyInfo.cs delete mode 100644 Users/Matthijs/PlaygroundSystem/HALGlobal.cs create mode 100644 Users/Matthijs/PlaygroundSystem/SystemGlobal.cs diff --git a/Users/Matthijs/Playground/Kernel.cs b/Users/Matthijs/Playground/Kernel.cs index 0ab19c3a5..7d30e1feb 100644 --- a/Users/Matthijs/Playground/Kernel.cs +++ b/Users/Matthijs/Playground/Kernel.cs @@ -15,7 +15,8 @@ namespace Playground { Console.WriteLine("Started"); - HALGlobal.Execute(); + SystemGlobal.Execute(); + Console.WriteLine("Done"); Console.ReadLine(); diff --git a/Users/Matthijs/PlaygroundHAL/HALGlobal.cs b/Users/Matthijs/PlaygroundHAL/HALGlobal.cs new file mode 100644 index 000000000..6b9ac6700 --- /dev/null +++ b/Users/Matthijs/PlaygroundHAL/HALGlobal.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Cosmos.Core; + +namespace PlaygroundHAL +{ + public static class HALGlobal + { + public static void Test() + { + Heap.SendStatsToDebugger(); + Heap.SendStatsToDebugger(); + new object(); + new object(); + new object(); + new object(); + new object(); + Heap.SendStatsToDebugger(); + + } + } +} \ No newline at end of file diff --git a/Users/Matthijs/PlaygroundHAL/PlaygroundHAL.csproj b/Users/Matthijs/PlaygroundHAL/PlaygroundHAL.csproj new file mode 100644 index 000000000..4c596ce30 --- /dev/null +++ b/Users/Matthijs/PlaygroundHAL/PlaygroundHAL.csproj @@ -0,0 +1,58 @@ + + + + + Debug + AnyCPU + {E978986A-8160-4979-919E-F099A43EF146} + Library + Properties + PlaygroundHAL + PlaygroundHAL + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + {1FAC100C-D732-4EA4-B518-5AF4BAF64F2E} + Cosmos.Common + + + {5AC4773C-CB4E-4CD9-8D50-02E10A07DEE6} + Cosmos.Core + + + + + \ No newline at end of file diff --git a/Users/Matthijs/PlaygroundHAL/Properties/AssemblyInfo.cs b/Users/Matthijs/PlaygroundHAL/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..e509131d4 --- /dev/null +++ b/Users/Matthijs/PlaygroundHAL/Properties/AssemblyInfo.cs @@ -0,0 +1,40 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +using Cosmos.Common; + +[assembly: AssemblyTitle("PlaygroundHAL")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PlaygroundHAL")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8a3a2639-a13b-4550-86e0-aca62cde3c00")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + +[assembly: Ring(Ring.HAL)] \ No newline at end of file diff --git a/Users/Matthijs/PlaygroundSystem/HALGlobal.cs b/Users/Matthijs/PlaygroundSystem/HALGlobal.cs deleted file mode 100644 index 0b67be4d5..000000000 --- a/Users/Matthijs/PlaygroundSystem/HALGlobal.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Cosmos.HAL; -using Cosmos.HAL.Drivers.PCI.Network; -using Cosmos.System.Network; -using Cosmos.System.Network.IPv4; - -namespace PlaygroundSystem -{ - public class HALGlobal - { - public static void Execute() - { - Console.WriteLine("Finding PCI device"); - var xNicDev = PCI.GetDevice(0x1022, 0x2000); - if (xNicDev == null) - { - Console.WriteLine(" Not found!!"); - return; - } - - var xNicDevNormal = xNicDev as PCIDeviceNormal; - if (xNicDevNormal == null) - { - Console.WriteLine(" Unable to cast as PCIDeviceNormal!"); - return; - } - var xNic = new AMDPCNetII(xNicDevNormal); - NetworkStack.Init(); - xNic.Enable(); - NetworkStack.ConfigIP(xNic, new Config(new Address(192, 168, 17, 100), new Address(255, 255, 255, 0))); - - var xClient = new UdpClient(15); - xClient.Connect(new Address(192, 168, 17, 1), 25); - xClient.Send(new byte[] - { - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 0xAA, - 0xBB, - 0xCC, - 0xDD, - 0xEE, - 0xFF - }); - - while (true) - { - NetworkStack.Update(); - - Console.WriteLine("Done"); - Console.ReadLine(); - } - } - } -} \ No newline at end of file diff --git a/Users/Matthijs/PlaygroundSystem/PlaygroundSystem.csproj b/Users/Matthijs/PlaygroundSystem/PlaygroundSystem.csproj index 56318d8f8..75c787d0e 100644 --- a/Users/Matthijs/PlaygroundSystem/PlaygroundSystem.csproj +++ b/Users/Matthijs/PlaygroundSystem/PlaygroundSystem.csproj @@ -35,7 +35,7 @@ - + @@ -51,6 +51,10 @@ {3DEF0461-08AB-471A-8F03-A9C556652A0F} Cosmos.System + + {E978986A-8160-4979-919E-F099A43EF146} + PlaygroundHAL +