mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-21 21:38:52 +00:00
Add extra playground libraries.
This commit is contained in:
parent
744088fe1e
commit
6a3cd41554
8 changed files with 213 additions and 68 deletions
|
|
@ -15,7 +15,8 @@ namespace Playground
|
|||
{
|
||||
Console.WriteLine("Started");
|
||||
|
||||
HALGlobal.Execute();
|
||||
SystemGlobal.Execute();
|
||||
|
||||
|
||||
Console.WriteLine("Done");
|
||||
Console.ReadLine();
|
||||
|
|
|
|||
25
Users/Matthijs/PlaygroundHAL/HALGlobal.cs
Normal file
25
Users/Matthijs/PlaygroundHAL/HALGlobal.cs
Normal file
|
|
@ -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();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
58
Users/Matthijs/PlaygroundHAL/PlaygroundHAL.csproj
Normal file
58
Users/Matthijs/PlaygroundHAL/PlaygroundHAL.csproj
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{E978986A-8160-4979-919E-F099A43EF146}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>PlaygroundHAL</RootNamespace>
|
||||
<AssemblyName>PlaygroundHAL</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="HALGlobal.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\source\Cosmos.Common\Cosmos.Common.csproj">
|
||||
<Project>{1FAC100C-D732-4EA4-B518-5AF4BAF64F2E}</Project>
|
||||
<Name>Cosmos.Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\source\Cosmos.Core\Cosmos.Core.csproj">
|
||||
<Project>{5AC4773C-CB4E-4CD9-8D50-02E10A07DEE6}</Project>
|
||||
<Name>Cosmos.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
40
Users/Matthijs/PlaygroundHAL/Properties/AssemblyInfo.cs
Normal file
40
Users/Matthijs/PlaygroundHAL/Properties/AssemblyInfo.cs
Normal file
|
|
@ -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)]
|
||||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="HALGlobal.cs" />
|
||||
<Compile Include="SystemGlobal.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
@ -51,6 +51,10 @@
|
|||
<Project>{3DEF0461-08AB-471A-8F03-A9C556652A0F}</Project>
|
||||
<Name>Cosmos.System</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\PlaygroundHAL\PlaygroundHAL.csproj">
|
||||
<Project>{E978986A-8160-4979-919E-F099A43EF146}</Project>
|
||||
<Name>PlaygroundHAL</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
|
|
|||
68
Users/Matthijs/PlaygroundSystem/SystemGlobal.cs
Normal file
68
Users/Matthijs/PlaygroundSystem/SystemGlobal.cs
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
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;
|
||||
using PlaygroundHAL;
|
||||
|
||||
namespace PlaygroundSystem
|
||||
{
|
||||
public class SystemGlobal
|
||||
{
|
||||
public static void Execute()
|
||||
{
|
||||
HALGlobal.Test();
|
||||
//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();
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -178,6 +178,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlaygroundSystem", "..\User
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.System.VSTests", "Cosmos.System.VSTests\Cosmos.System.VSTests.csproj", "{AAA0328F-60E1-442D-B949-A13DD34BD0AD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlaygroundHAL", "..\Users\Matthijs\PlaygroundHAL\PlaygroundHAL.csproj", "{E978986A-8160-4979-919E-F099A43EF146}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -823,6 +825,18 @@ Global
|
|||
{AAA0328F-60E1-442D-B949-A13DD34BD0AD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{AAA0328F-60E1-442D-B949-A13DD34BD0AD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{AAA0328F-60E1-442D-B949-A13DD34BD0AD}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E978986A-8160-4979-919E-F099A43EF146}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E978986A-8160-4979-919E-F099A43EF146}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E978986A-8160-4979-919E-F099A43EF146}.Debug|Itanium.ActiveCfg = Debug|Any CPU
|
||||
{E978986A-8160-4979-919E-F099A43EF146}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{E978986A-8160-4979-919E-F099A43EF146}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{E978986A-8160-4979-919E-F099A43EF146}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{E978986A-8160-4979-919E-F099A43EF146}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E978986A-8160-4979-919E-F099A43EF146}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E978986A-8160-4979-919E-F099A43EF146}.Release|Itanium.ActiveCfg = Release|Any CPU
|
||||
{E978986A-8160-4979-919E-F099A43EF146}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{E978986A-8160-4979-919E-F099A43EF146}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{E978986A-8160-4979-919E-F099A43EF146}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
@ -886,5 +900,6 @@ Global
|
|||
{8E3537CB-D0F9-4CFB-AE6F-72B465CA03F6} = {A0073D91-D9D3-4A90-9845-10E5CDBA5511}
|
||||
{82F6DDA3-E45D-4E7A-AA09-85FC2EDE2F76} = {A0073D91-D9D3-4A90-9845-10E5CDBA5511}
|
||||
{AAA0328F-60E1-442D-B949-A13DD34BD0AD} = {056A94C1-6C75-4730-B62A-675779CD07FB}
|
||||
{E978986A-8160-4979-919E-F099A43EF146} = {A0073D91-D9D3-4A90-9845-10E5CDBA5511}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
|||
Loading…
Reference in a new issue