forked from CosmosOS/Cosmos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the concept of Encoding to the Console for now ASCII (default) …
…and CP437 are supported (for others as CP858 I think it is needed to change font too) - moved EncodingTest on Text subdir - added ConsoleTest (not enabled by default) - removed ASCIIEncodingImpl (it was not needed) - Made plugs of Console better and added plugs for formatted versions - Removed code to test Hashtable, Hashtable it will be a separate PR
- Loading branch information
Showing
23 changed files
with
562 additions
and
1,253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{9246ba1f-fbdb-4b09-806a-7968bf4d3eb9}</ProjectGuid> | ||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging> | ||
<Name>ConsoleTestBoot</Name> | ||
<BinFormat>elf</BinFormat> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> | ||
<Profile>VMware</Profile> | ||
<DebugEnabled>true</DebugEnabled> | ||
<DebugMode>Source</DebugMode> | ||
<TraceMode>User</TraceMode> | ||
<EnableGDB>False</EnableGDB> | ||
<StartCosmosGDB>false</StartCosmosGDB> | ||
<VMWareEdition>Player</VMWareEdition> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<Name>ConsoleTestBoot</Name> | ||
<Description>Use VMware Player or Workstation to deploy and debug.</Description> | ||
<Deployment>ISO</Deployment> | ||
<Launch>VMware</Launch> | ||
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\source\Cosmos.HAL\Cosmos.HAL.csproj"> | ||
<Name>Cosmos.HAL</Name> | ||
<Project>{6a991d03-1435-4005-9809-b8bacdf3b021}</Project> | ||
<Private>True</Private> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\source\Cosmos.System\Cosmos.System.csproj"> | ||
<Name>Cosmos.System</Name> | ||
<Project>{3def0461-08ab-471a-8f03-a9c556652a0f}</Project> | ||
<Private>True</Private> | ||
</ProjectReference> | ||
<ProjectReference Include="..\Cosmos.TestRunner.Core\Cosmos.TestRunner.Core.csproj"> | ||
<Name>Cosmos.TestRunner.Core</Name> | ||
<Project>{758faf24-9974-4db8-82ef-1b64daf2f0bc}</Project> | ||
<Private>True</Private> | ||
</ProjectReference> | ||
<ProjectReference Include=".\ConsoleTest.csproj"> | ||
<Name>ConsoleTest</Name> | ||
<Project>{fb23bd72-aec3-485e-b86c-8e7db0b3bb9b}</Project> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="Cosmos.Core_Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" /> | ||
<Reference Include="Cosmos.System_Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" /> | ||
<Reference Include="Cosmos.Debug.Kernel.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" /> | ||
</ItemGroup> | ||
<!--<ItemGroup> | ||
<Content Include="Cosmos.bxrc"> | ||
<SubType>Content</SubType> | ||
</Content> | ||
</ItemGroup>--> | ||
<Import Project="$(MSBuildExtensionsPath)\Cosmos\Cosmos.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="ConsoleTestBoot.Cosmos" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\source\Cosmos.Debug.Kernel\Cosmos.Debug.Kernel.csproj" /> | ||
<ProjectReference Include="..\..\source\Cosmos.System2\Cosmos.System2.csproj" /> | ||
<ProjectReference Include="..\Cosmos.TestRunner.TestController\Cosmos.TestRunner.TestController.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
using System; | ||
using Sys = Cosmos.System; | ||
using Cosmos.TestRunner; | ||
using Cosmos.System.Graphics; | ||
using System.Text; | ||
using Cosmos.System.ExtendedASCII; | ||
using Cosmos.System.ScanMaps; | ||
|
||
/* | ||
* Please note this is an atypical TestRunner: | ||
* - no Assertion can be done | ||
* - it cannot be executed automatically | ||
* | ||
* it exists to make easier tests while changing low level stuff (it would be better and faster to use the Demo kernel but | ||
* sometimes it is a problem to make it see modifications done at low level) | ||
* | ||
* Remember to comment this test again on TestKernelSets.cs when you are ready to merge your modifications! | ||
*/ | ||
namespace ConsoleTest | ||
{ | ||
public class Kernel : Sys.Kernel | ||
{ | ||
protected override void BeforeRun() | ||
{ | ||
Console.WriteLine("Cosmos booted successfully. Let's Test Console!"); | ||
|
||
/* This is needed to enable the Codepage based Encodings */ | ||
Encoding.RegisterProvider(CosmosEncodingProvider.Instance); | ||
} | ||
|
||
protected override void Run() | ||
{ | ||
try | ||
{ | ||
Console.Clear(); | ||
|
||
Console.WriteLine("Testing Console Enconding"); | ||
|
||
Console.WriteLine($"ConsoleInputEncoding {Console.InputEncoding.BodyName}"); | ||
|
||
Console.WriteLine($"ConsoleOutputEncoding {Console.OutputEncoding.BodyName}"); | ||
|
||
/* Let's change it in the legacy IBM437 encoding */ | ||
Console.InputEncoding = Encoding.GetEncoding(437); | ||
Console.OutputEncoding = Encoding.GetEncoding(437); | ||
|
||
Console.WriteLine($"ConsoleInputEncoding in now {Console.InputEncoding.BodyName}"); | ||
Console.WriteLine($"ConsoleOutputEncoding in now {Console.OutputEncoding.BodyName}"); | ||
|
||
Console.WriteLine("Let's write some accented characters: èòàùì"); | ||
Console.WriteLine("Let's print all the CP437 codepage"); | ||
|
||
Sys.Global.mDebugger.SendInternal(""); | ||
|
||
Console.Write("Ç ü é â ä à å ç ê ë è ï î ì Ä Å\n" + | ||
"É æ Æ ô ö ò û ù ÿ Ö Ü ¢ £ ¥ ₧ ƒ\n" + | ||
"á í ó ú ñ Ñ ª º ¿ ⌐ ¬ ½ ¼ ¡ « »\n" + | ||
"░ ▒ ▓ │ ┤ ╡ ╢ ╖ ╕ ╣ ║ ╗ ╝ ╜ ╛ ┐\n" + | ||
"└ ┴ ┬ ├ ─ ┼ ╞ ╟ ╚ ╔ ╩ ╦ ╠ ═ ╬ ╧\n" + | ||
"╨ ╤ ╥ ╙ ╘ ╒ ╓ ╫ ╪ ┘ ┌ █ ▄ ▌ ▐ ▀\n" + | ||
"α ß Γ π Σ σ µ τ Φ Θ Ω δ ∞ φ ε ∩\n" + | ||
"≡ ± ≥ ≤ ⌠ ⌡ ÷ ≈ ° ∙ · √ ⁿ ² ■ \u00A0\n"); | ||
//Console.WriteLine(); | ||
|
||
Console.WriteLine("The following line should appear as a continuos line of '─'"); | ||
Console.WriteLine("──────────────────────────────────────────────────────────"); | ||
|
||
Console.ReadKey(); | ||
Console.WriteLine("The next line should be empty"); | ||
Console.WriteLine(); | ||
Console.WriteLine("True follows..."); | ||
Console.WriteLine(true); | ||
Console.WriteLine("The letter 'A'"); | ||
Console.WriteLine('A'); | ||
char[] charBuffer = new char[] { 'A', 'B', 'C' }; | ||
Console.WriteLine("Then ABC"); | ||
Console.WriteLine(charBuffer); | ||
Console.WriteLine("...42.42"); | ||
Console.WriteLine(42.42); | ||
Console.WriteLine("...42.42 (float)"); | ||
Console.WriteLine(42.42f); | ||
Console.WriteLine("...42"); | ||
Console.WriteLine(42); | ||
Console.WriteLine("...42 (long)"); | ||
Console.WriteLine(42L); | ||
Console.ReadKey(); | ||
object test = "Test"; | ||
Console.WriteLine("...Test (as object)"); | ||
Console.WriteLine(test); | ||
Console.WriteLine("The next line should be empty (null object)"); | ||
object s = null; | ||
Console.WriteLine(s); | ||
Console.WriteLine("...42 (uint)"); | ||
Console.WriteLine(42U); | ||
Console.WriteLine("...42 (ulong)"); | ||
Console.WriteLine(42UL); | ||
Console.WriteLine("...BC"); | ||
Console.WriteLine(charBuffer, 1, 2); | ||
|
||
Console.WriteLine("Test Format arg0 {0}", "test"); | ||
Console.WriteLine("Test Format arg0 {0} arg1 {1}", "test", 42); | ||
Console.WriteLine("Test Format arg0 {0} arg1 {1} arg2 {2}", "test", 42, 69.69); | ||
Console.WriteLine("Test Format arg0 {0} arg1 {1} arg2 {2} arg3 {3}", "test", 42, 69.69, 25000L); | ||
/* String.Format does not support x or X and probably neither the rest of "special" formatting */ | ||
//Console.WriteLine("Test Format (hex) {0:x}", 42); | ||
|
||
Console.WriteLine("Layout switched to DE..."); | ||
SetKeyboardScanMap(new DE_Standard()); | ||
Console.WriteLine("Write in germanic now I'll read it with Console.ReadLine()..."); | ||
|
||
var str = Console.ReadLine(); | ||
Console.WriteLine($"You have written: {str}"); | ||
|
||
Console.WriteLine("Write in germanic now I'll read it with Console.ReadKey()..."); | ||
var character = Console.ReadKey(); | ||
Console.WriteLine($"You have written: {character.KeyChar}"); | ||
|
||
Console.WriteLine("Press any key to terminate this test..."); | ||
|
||
Console.ReadKey(); | ||
TestController.Completed(); | ||
} | ||
catch (Exception e) | ||
{ | ||
mDebugger.Send("Exception occurred: " + e.Message); | ||
mDebugger.Send(e.Message); | ||
TestController.Failed(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
Tests/Cosmos.Compiler.Tests.Bcl/System/Collections/Not Generic/HashtableTest.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.