Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/CosmosOS/Cosmos
Browse files Browse the repository at this point in the history
# Conflicts:
#	Demos/Guess/GuessOS.cs
#	Tests/Cosmos.Compiler.Tests.Bcl/Kernel.cs
#	source/Cosmos.System.Plugs/Cosmos.System.Plugs.csproj
  • Loading branch information
fanoI committed Mar 7, 2016
2 parents eb53335 + 4a3b6a5 commit 35583c6
Show file tree
Hide file tree
Showing 113 changed files with 4,133 additions and 1,813 deletions.
18 changes: 18 additions & 0 deletions Demos/Guess/GuessKernel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cosmos.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983, processorArchitecture=x86">
<HintPath>..\..\source\Cosmos.Common\bin\Debug\Cosmos.Common.dll</HintPath>
Expand Down
84 changes: 42 additions & 42 deletions Demos/Guess/GuessOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,54 @@

namespace GuessKernel
{
public class GuessOS: Sys.Kernel
{
protected int mCount = 0;
protected int mMagicNo = 22;

public GuessOS()
public class GuessOS : Sys.Kernel
{
// Didnt check if tickcount is working yet.. can change this later
//var xRandom = new Random(234243534);
//mMagicNo = xRandom.Next(1, 100);
}
protected int mCount = 0;

protected int mMagicNo = 22;

protected override void BeforeRun()
{
public GuessOS()
{
// Didnt check if tickcount is working yet.. can change this later
//var xRandom = new Random(234243534);
//mMagicNo = xRandom.Next(1, 100);
}

protected override void BeforeRun()
{
//Cosmos.Core.HMI.Init();

Console.WriteLine("Guess Demo");
Console.WriteLine("Please guess a number from 1 to 100.");
}
}

private Debugger mDebugger = new Debugger("User", "Guess");

protected override void Run()
{
mCount++;
protected override void Run()
{
mCount++;

mDebugger.Send("");
mDebugger.SendMessage("Kernel", "New iteration");
Console.WriteLine();
Console.WriteLine("Guess #" + mCount);
Console.Write("Please enter a guess: ");
string xInputStr = Console.ReadLine();
Console.Write("Input length: ");
Console.WriteLine(xInputStr.Length.ToString());
int xGuess = int.Parse(xInputStr);
Console.WriteLine("Your guess was " + xGuess);
if (xGuess < mMagicNo)
{
Console.WriteLine("Too low.");
}
else if (xGuess > mMagicNo)
{
Console.WriteLine("Too high.");
}
else
{
Console.WriteLine("You guessed it!");
Stop();
}
mDebugger.Send("");
mDebugger.SendMessage("Kernel", "New iteration");
Console.WriteLine();
Console.WriteLine("Guess #" + mCount);
Console.Write("Please enter a guess: ");
string xInputStr = Console.ReadLine();
Console.Write("Input length: ");
Console.WriteLine(xInputStr.Length.ToString());
int xGuess = int.Parse(xInputStr);
Console.WriteLine("Your guess was " + xGuess);
if (xGuess < mMagicNo)
{
Console.WriteLine("Too low.");
}
else if (xGuess > mMagicNo)
{
Console.WriteLine("Too high.");
}
else
{
Console.WriteLine("You guessed it!");
Stop();
}
}
}
}
}
18 changes: 18 additions & 0 deletions Tests/BoxingTests/BoxingTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cosmos.Debug.Kernel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
Expand Down
18 changes: 18 additions & 0 deletions Tests/Cosmos.Common.Tests/Cosmos.Common.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
Expand Down
18 changes: 18 additions & 0 deletions Tests/Cosmos.Compiler.Tests.Bcl/Cosmos.Compiler.Tests.Bcl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<Profile>VMware</Profile>
<Profile>Bochs</Profile>
<!-- Looks like this was a mispelled attribute. Replaced by DebugEnabled below.
<DebugEnable>true</DebugEnable>
-->
Expand All @@ -22,10 +22,32 @@
<VMWareEdition>Player</VMWareEdition>
<OutputPath>bin\Debug\</OutputPath>
<Name>Cosmos.Compiler.Tests.BclBoot</Name>
<Description>Use VMware Player or Workstation to deploy and debug.</Description>
<Description>Use Bochs emulator to deploy and debug.</Description>
<Deployment>ISO</Deployment>
<Launch>VMware</Launch>
<Launch>Bochs</Launch>
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
<VMware_Name>Cosmos.Compiler.Tests.BclBoot</VMware_Name>
<VMware_Description>Use VMware Player or Workstation to deploy and debug.</VMware_Description>
<VMware_Deployment>ISO</VMware_Deployment>
<VMware_Launch>VMware</VMware_Launch>
<VMware_DebugEnabled>true</VMware_DebugEnabled>
<VMware_DebugMode>Source</VMware_DebugMode>
<VMware_VisualStudioDebugPort>Pipe: Cosmos\Serial</VMware_VisualStudioDebugPort>
<VMware_VMwareEdition>Player</VMware_VMwareEdition>
<VMware_OutputPath>bin\Debug\</VMware_OutputPath>
<VMware_EnableGDB>False</VMware_EnableGDB>
<VMware_StartCosmosGDB>false</VMware_StartCosmosGDB>
<Bochs_Name>Cosmos.Compiler.Tests.BclBoot</Bochs_Name>
<Bochs_Description>Use Bochs emulator to deploy and debug.</Bochs_Description>
<Bochs_Deployment>ISO</Bochs_Deployment>
<Bochs_Launch>Bochs</Bochs_Launch>
<Bochs_DebugEnabled>true</Bochs_DebugEnabled>
<Bochs_DebugMode>Source</Bochs_DebugMode>
<Bochs_VisualStudioDebugPort>Pipe: Cosmos\Serial</Bochs_VisualStudioDebugPort>
<Bochs_VMwareEdition>Player</Bochs_VMwareEdition>
<Bochs_OutputPath>bin\Debug\</Bochs_OutputPath>
<Bochs_EnableGDB>False</Bochs_EnableGDB>
<Bochs_StartCosmosGDB>false</Bochs_StartCosmosGDB>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cosmos.Core.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
Expand Down
2 changes: 1 addition & 1 deletion Tests/Cosmos.Compiler.Tests.Bcl/Kernel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ protected override void Run()
}
}
}
}
}
1 change: 0 additions & 1 deletion Tests/Cosmos.Compiler.Tests.Bcl/System/CharTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public static void Execute()
int expectedResultAsInt = (int)value | ((int)value << 16);

Assert.IsTrue((resultAsInt == expectedResultAsInt), "Char.GetHashCode() doesn't work");

#if false
// Now let's try ToString() again but printed in hex (this test fails for now!)
result = value.ToString("X2");
Expand Down
4 changes: 4 additions & 0 deletions Tests/Cosmos.Compiler.Tests.Bcl/System/StringTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ public static void Execute()
{
Assert.IsTrue(("a" + "b") == "ab", "concatting 2 string using + doesn't work");
Assert.IsTrue(("a" + 'b') == "ab", "concatting 1 string and 1 character doesn't work");

char x = 'a';
string y = "a";
Assert.IsTrue(x.ToString() == y, "String == operator ");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
Expand All @@ -49,6 +49,24 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,24 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,24 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down
Loading

0 comments on commit 35583c6

Please sign in to comment.