Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmos on linux, improved better as per a request #2836

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Build/VMWare/Workstation/Filesystem.vmdk
Binary file not shown.
4 changes: 2 additions & 2 deletions Docs/articles/Installation/DevKit.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
Run `make` to build Cosmos. Cosmos will clone all the required repos, build itself, and install it and it's nuget packages to the system automatically.

### dotnet Project Templates
If you are using linux or prefer not using Visual Studio for your projects, you can install the dotnet project template using `dotnet new --install ./source/templates/csharp/` assuming you are currently in the Cosmos base directory.
If you are using linux or prefer not using Visual Studio for your projects, you can install the dotnet project template using `dotnet new --install ./source/templates/csharp-linux/` assuming you are currently in the Cosmos base directory.
After installing the template use `dotnet new cosmosCSKernel -n {name}` to create a new Cosmos Kernel project.
The dotnet template can be removed at a later time using `dotnet new --uninstall ./source/templates/csharp/`.
The dotnet template can be removed later on using `dotnet new --uninstall ./source/templates/csharp-linux/`.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
"requested": "[4.7.0, )",
"resolved": "4.7.0",
"contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA=="
},
"Microsoft.NETFramework.ReferenceAssemblies": {
"type": "Direct",
"requested": "[1.0.3, )",
"resolved": "1.0.3",
"contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==",
"dependencies": {
"Microsoft.NETFramework.ReferenceAssemblies.net48": "1.0.3"
}
},
"Microsoft.NETFramework.ReferenceAssemblies.net48": {
"type": "Transitive",
"resolved": "1.0.3",
"contentHash": "zMk4D+9zyiEWByyQ7oPImPN/Jhpj166Ky0Nlla4eXlNL8hI/BtSJsgR8Inldd4NNpIAH3oh8yym0W2DrhXdSLQ=="
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions source/Cosmos.Build.Tasks/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
"System.Collections.Immutable": "5.0.0"
}
},
"Microsoft.NETFramework.ReferenceAssemblies": {
"type": "Direct",
"requested": "[1.0.3, )",
"resolved": "1.0.3",
"contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==",
"dependencies": {
"Microsoft.NETFramework.ReferenceAssemblies.net48": "1.0.3"
}
},
"Dapper.StrongName": {
"type": "Transitive",
"resolved": "2.0.90",
Expand All @@ -42,6 +51,11 @@
"resolved": "1.3.0",
"contentHash": "/fn1Tfo7j7k/slViPlM8azJuxQmri7FZ8dQ+gTeLbI29leN/1VK0U/BFcRdJNctsRCUgyKJ2q+I0Tjq07Rc1/Q=="
},
"Microsoft.NETFramework.ReferenceAssemblies.net48": {
"type": "Transitive",
"resolved": "1.0.3",
"contentHash": "zMk4D+9zyiEWByyQ7oPImPN/Jhpj166Ky0Nlla4eXlNL8hI/BtSJsgR8Inldd4NNpIAH3oh8yym0W2DrhXdSLQ=="
},
"Microsoft.VisualStudio.Setup.Configuration.Interop": {
"type": "Transitive",
"resolved": "1.16.30",
Expand Down
13 changes: 13 additions & 0 deletions source/templates/csharp-linux/.template.config/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "CosmosOS",
"classifications": [ "OS" ],
"tags": {
"language": "C#",
"type":"project"
},
"identity": "CosmosOS.Cosmos.Kernel.CSharp",
"name": "Cosmos C# Kernel",
"shortName": "cosmosCSKernel",
"sourceName": "CSharpProject"
}
29 changes: 29 additions & 0 deletions source/templates/csharp-linux/CSharpProject.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Platform>cosmos</Platform>
<SupportsX86Intrinsics>false</SupportsX86Intrinsics>
<SelfContained>True</SelfContained>
</PropertyGroup>

<PropertyGroup>
<DebugEnabled>false</DebugEnabled>
<EnableGDB>False</EnableGDB>
<StartCosmosGDB>False</StartCosmosGDB>
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
<CosmosDebugPort>Serial: COM1</CosmosDebugPort>
<Launch>VMware</Launch>
<Profile>VMware</Profile>
<Description>Use VMware Player or Workstation to deploy and debug.</Description>
<PxeInterface>192.168.0.8</PxeInterface>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cosmos.Build" Version="0-*" NoWarn="NU1604" />
<PackageReference Include="Cosmos.Debug.Kernel" Version="0-*" NoWarn="NU1604" />
<PackageReference Include="Cosmos.System2" Version="0-*" NoWarn="NU1604" />
<PackageReference Include="Cosmos.Plugs" Version="0-*" NoWarn="NU1604" />
</ItemGroup>

</Project>
24 changes: 24 additions & 0 deletions source/templates/csharp-linux/Kernel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;
using Sys = Cosmos.System;

namespace $safeprojectname$
{
public class Kernel: Sys.Kernel
{

protected override void BeforeRun()
{
Console.WriteLine("Cosmos booted successfully. Type a line of text to get it echoed back.");
}

protected override void Run()
{
Console.Write("Input: ");
var input = Console.ReadLine();
Console.Write("Text typed: ");
Console.WriteLine(input);
}
}
}
1 change: 0 additions & 1 deletion source/templates/csharp/CSharpProject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
</PropertyGroup>

<PropertyGroup>
<DebugEnabled>false</DebugEnabled>
<EnableGDB>False</EnableGDB>
<StartCosmosGDB>False</StartCosmosGDB>
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
Expand Down
17 changes: 17 additions & 0 deletions source/templates/csharp/CSharpProject.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpProject", "CSharpProject.csproj", "{DE2AFF01-488B-4B4F-98F4-D70F7C6F5FA1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DE2AFF01-488B-4B4F-98F4-D70F7C6F5FA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE2AFF01-488B-4B4F-98F4-D70F7C6F5FA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE2AFF01-488B-4B4F-98F4-D70F7C6F5FA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE2AFF01-488B-4B4F-98F4-D70F7C6F5FA1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Loading